Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting of TIME_DST and TIME_STD values from Tasmota Console #2721

Closed
apastuszak opened this issue May 13, 2018 · 31 comments
Closed

Allow setting of TIME_DST and TIME_STD values from Tasmota Console #2721

apastuszak opened this issue May 13, 2018 · 31 comments

Comments

@apastuszak
Copy link

Have you look for this feature in other issues and in the wiki?

Yes

Is your feature request related to a problem? Please describe.

I am unable to use local time to set timers without recompiling Tasmota myself. The provided binaries do not work well for me, since they're compiled with UTC+1.

Describe the solution you'd like
Be able to set TIME_DST and TIME_STD from the console, the way you can other paramters.

Describe alternatives you've considered

I can't think of an alternative, since I was told these values can only be set at compile time.

Additional context

I think the binaries available for download should be as generic as possible. Not being able to configure timezone rules after install from the console makes the supplied binaries on Github more difficult to use.

(Please, remember to close the issue when the problem has been addressed)

@ascillato
Copy link
Contributor

Agree.

@ascillato
Copy link
Contributor

what approach you think would be good to accomplish that?

a command for each part? like DST_MONTH DST_HOUR ?

@arendst
Copy link
Owner

arendst commented May 13, 2018

It will have to be a compromise between code size and functionality. The problem with these parameters are that many user input errors need to be prevented. Allowing only numbers saves a lot of code space wasted on string comparison but is less user friendly...

Your approach of separate commands sounds good. Let me think about a way to store all possible values in as small as possible Settings value(s).

@apastuszak
Copy link
Author

Well, right now, users need to set it manually and compile it. So, there is no option at all. Perhaps someone could wrote a small python script that allows you to calculate the number that Tasmota is using and you enter that value. Would that not prevent an increase in memory? We could make that the v.1 deliverable and work further on refining it and making it more user friendly. Just exposing it to the console for manipulation would be an improvement.

arendst added a commit that referenced this issue May 13, 2018
Prep for user entry STD/DST (#2721)
@arendst
Copy link
Owner

arendst commented May 13, 2018

@ascillato just uploaded an updated settings.h with room for STD/DST.

@ascillato
Copy link
Contributor

😄 👍

arendst added a commit that referenced this issue May 13, 2018
Prep for user entry STD/DST (#2721)
arendst added a commit that referenced this issue May 13, 2018
Prep for user entry DST/STD (#2721)
@ascillato
Copy link
Contributor

ascillato commented May 13, 2018

Wow! so fast! I was just looking how this can be done and PUFF! you have it! Amazing. It is almost done. Thanks.

@qingz2004
Copy link

I used to set STD/DST in user_config_override.h file and compile.
Yesterday, I updated to v5.13.1b, and all of the sudden, my time is off.
How can I set it in console or GUI without compiling and uploading again?

@ascillato
Copy link
Contributor

ascillato commented May 14, 2018 via email

@qingz2004
Copy link

I was able to set DST and STD in user_config_override.h, and it worked fine with all previous versions.
I just found in this version, it changed the defines for STD/DST. I didn't pay attention and do the same change in user_config_override.h.

arendst added a commit that referenced this issue May 14, 2018
5.13.1c
 * Add user entry DST/STD using commands TimeStd and TimeDst
with options like 0,0,3,1,2,120 (#2721)
@ascillato
Copy link
Contributor

Tested and work great! 👍 Thanks

Added also to the wiki the TimeDST and TimeSTD commands usage.

@ascillato
Copy link
Contributor

@apastuszak please test it and if works close the issue. Thanks

@apastuszak
Copy link
Author

@ascillato I will need to compile in the morning and flash something.

Also, don't see anything in the wiki.

@ascillato
Copy link
Contributor

Please, check it again. It is there on commands.

@ascillato
Copy link
Contributor

image

@apastuszak
Copy link
Author

I did a search for TimeDST instead of Time_DST. It's 11:00 PM in my corner of the world, so I will test in the morning.

@ascillato
Copy link
Contributor

Ups. my bad. The command is TimeDST. updating the wiki

Thanks 👍

@apastuszak
Copy link
Author

That will make my morning. Less frustrating! :-)

@ascillato
Copy link
Contributor

😆

@apastuszak
Copy link
Author

I'm getting a compilation error on sonoff_minimal:

.pioenvs\sonoff-minimal\libFrameworkArduino.a(core_esp8266_main.cpp.o):(.text._ZL12loop_wrapperv+0x4): undefined reference to `setup'
.pioenvs\sonoff-minimal\libFrameworkArduino.a(core_esp8266_main.cpp.o):(.text._ZL12loop_wrapperv+0x8): undefined reference to `loop'
.pioenvs\sonoff-minimal\libFrameworkArduino.a(core_esp8266_main.cpp.o): In function `loop_wrapper()':
core_esp8266_main.cpp:(.text._ZL12loop_wrapperv+0x21): undefined reference to `setup'
core_esp8266_main.cpp:(.text._ZL12loop_wrapperv+0x2d): undefined reference to `loop'
collect2.exe: error: ld returned 1 exit status
*** [.pioenvs\sonoff-minimal\firmware.elf] Error 1

@arendst
Copy link
Owner

arendst commented May 15, 2018

@apastuszak expected with pio. Just start the compilation again and if still fails remove the .pioenvs folder

@qingz2004
Copy link

Compiled and worked good.
Thanks!

@apastuszak
Copy link
Author

Still won't compile for me.

F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xdrv_03_energy.ino: In function 'void EnergySnsInit()':
F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xdrv_03_energy.ino:1046:75: error: no matching function for call to 'TasmotaSerial::TasmotaSerial(uint8_t&, uint8_t&, int)'
PzemSerial = new TasmotaSerial(pin[GPIO_PZEM_RX], pin[GPIO_PZEM_TX], 1);
^
F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xdrv_03_energy.ino:1046:75: note: candidates are:
In file included from F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xdrv_03_energy.ino:415:0:
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:40:5: note: TasmotaSerial::TasmotaSerial(int, int)
TasmotaSerial(int receive_pin, int transmit_pin);
^
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:40:5: note:   candidate expects 2 arguments, 3 provided
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: constexpr TasmotaSerial::TasmotaSerial(const TasmotaSerial&)
class TasmotaSerial : public Stream {
^
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note:   candidate expects 1 argument, 3 provided
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: constexpr TasmotaSerial::TasmotaSerial(TasmotaSerial&&)
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note:   candidate expects 1 argument, 3 provided
F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xdrv_03_energy.ino:1048:23: error: 'class TasmotaSerial' has no member named 'hardwareSerial'
if (PzemSerial->hardwareSerial()) { ClaimSerial(); }
^
F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xsns_15_mhz19.ino: In function 'void MhzInit()':
F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xsns_15_mhz19.ino:287:74: error: no matching function for call to 'TasmotaSerial::TasmotaSerial(uint8_t&, uint8_t&, int)'
MhzSerial = new TasmotaSerial(pin[GPIO_MHZ_RXD], pin[GPIO_MHZ_TXD], 1);
^
F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xsns_15_mhz19.ino:287:74: note: candidates are:
In file included from F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xdrv_03_energy.ino:415:0:
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:40:5: note: TasmotaSerial::TasmotaSerial(int, int)
TasmotaSerial(int receive_pin, int transmit_pin);
^
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:40:5: note:   candidate expects 2 arguments, 3 provided
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: constexpr TasmotaSerial::TasmotaSerial(const TasmotaSerial&)
class TasmotaSerial : public Stream {
^
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note:   candidate expects 1 argument, 3 provided
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: constexpr TasmotaSerial::TasmotaSerial(TasmotaSerial&&)
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note:   candidate expects 1 argument, 3 provided
F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xsns_15_mhz19.ino:289:22: error: 'class TasmotaSerial' has no member named
'hardwareSerial'
if (MhzSerial->hardwareSerial()) { ClaimSerial(); }
^
F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xsns_17_senseair.ino: In function 'void SenseairInit()':
F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xsns_17_senseair.ino:196:78: error: no matching function for call to 'TasmotaSerial::TasmotaSerial(uint8_t&, uint8_t&, int)'
SensairSerial = new TasmotaSerial(pin[GPIO_SAIR_RX], pin[GPIO_SAIR_TX], 1);
^
F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xsns_17_senseair.ino:196:78: note: candidates are:
In file included from F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xdrv_03_energy.ino:415:0:
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:40:5: note: TasmotaSerial::TasmotaSerial(int, int)
TasmotaSerial(int receive_pin, int transmit_pin);
^
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:40:5: note:   candidate expects 2 arguments, 3 provided
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: constexpr TasmotaSerial::TasmotaSerial(const TasmotaSerial&)
class TasmotaSerial : public Stream {
^
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note:   candidate expects 1 argument, 3 provided
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: constexpr TasmotaSerial::TasmotaSerial(TasmotaSerial&&)
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note:   candidate expects 1 argument, 3 provided
F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xsns_17_senseair.ino:198:26: error: 'class TasmotaSerial' has no member named 'hardwareSerial'
if (SensairSerial->hardwareSerial()) { ClaimSerial(); }
^
F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xsns_18_pms5003.ino: In function 'void PmsInit()':
F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xsns_18_pms5003.ino:105:59: error: no matching function for call to 'TasmotaSerial::TasmotaSerial(uint8_t&, int, int)'
PmsSerial = new TasmotaSerial(pin[GPIO_PMS5003], -1, 1);
^
F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xsns_18_pms5003.ino:105:59: note: candidates are:
In file included from F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xdrv_03_energy.ino:415:0:
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:40:5: note: TasmotaSerial::TasmotaSerial(int, int)
TasmotaSerial(int receive_pin, int transmit_pin);
^
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:40:5: note:   candidate expects 2 arguments, 3 provided
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: constexpr TasmotaSerial::TasmotaSerial(const TasmotaSerial&)
class TasmotaSerial : public Stream {
^
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note:   candidate expects 1 argument, 3 provided
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: constexpr TasmotaSerial::TasmotaSerial(TasmotaSerial&&)
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note:   candidate expects 1 argument, 3 provided
F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xsns_18_pms5003.ino:107:22: error: 'class TasmotaSerial' has no member named 'hardwareSerial'
if (PmsSerial->hardwareSerial()) { ClaimSerial(); }
^
F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xsns_20_novasds.ino: In function 'void NovaSdsInit()':
F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xsns_20_novasds.ino:87:62: error: no matching function for call to 'TasmotaSerial::TasmotaSerial(uint8_t&, int, int)'
NovaSdsSerial = new TasmotaSerial(pin[GPIO_SDS0X1], -1, 1);
^
F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xsns_20_novasds.ino:87:62: note: candidates are:
In file included from F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xdrv_03_energy.ino:415:0:
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:40:5: note: TasmotaSerial::TasmotaSerial(int, int)
TasmotaSerial(int receive_pin, int transmit_pin);
^
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:40:5: note:   candidate expects 2 arguments, 3 provided
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: constexpr TasmotaSerial::TasmotaSerial(const TasmotaSerial&)
class TasmotaSerial : public Stream {
^
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note:   candidate expects 1 argument, 3 provided
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: constexpr TasmotaSerial::TasmotaSerial(TasmotaSerial&&)
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note:   candidate expects 1 argument, 3 provided
F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xsns_20_novasds.ino:89:26: error: 'class TasmotaSerial' has no member named 'hardwareSerial'
if (NovaSdsSerial->hardwareSerial()) { ClaimSerial(); }
^
F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xsns_23_sdm120.ino: In function 'void SDM120Init()':
F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xsns_23_sdm120.ino:208:81: error: no matching function for call to 'TasmotaSerial::TasmotaSerial(uint8_t&, uint8_t&, int)'
SDM120Serial = new TasmotaSerial(pin[GPIO_SDM120_RX], pin[GPIO_SDM120_TX], 1);
^
F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xsns_23_sdm120.ino:208:81: note: candidates are:
In file included from F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xdrv_03_energy.ino:415:0:
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:40:5: note: TasmotaSerial::TasmotaSerial(int, int)
TasmotaSerial(int receive_pin, int transmit_pin);
^
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:40:5: note:   candidate expects 2 arguments, 3 provided
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: constexpr TasmotaSerial::TasmotaSerial(const TasmotaSerial&)
class TasmotaSerial : public Stream {
^
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note:   candidate expects 1 argument, 3 provided
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note: constexpr TasmotaSerial::TasmotaSerial(TasmotaSerial&&)
lib\TasmotaSerial-1.2.0\src/TasmotaSerial.h:38:7: note:   candidate expects 1 argument, 3 provided
F:/Andy/Downloads/Sonoff-Tasmota-development/sonoff/xsns_23_sdm120.ino:214:25: error: 'class TasmotaSerial' has no member named 'hardwareSerial'
if (SDM120Serial->hardwareSerial()) { ClaimSerial(); }
^
*C** [.pioenvs\sonoff\src\sonoff.ino.cpp.o] Error 1ompiling .pioenvs\sonoff\lib4dd\ESP8266WiFi\ESP8266WiFiMulti.cpp.o

@arendst
Copy link
Owner

arendst commented May 15, 2018

You'll need to update the TasmotaSerial library too (now 2.0.0)

@ascillato
Copy link
Contributor

ascillato commented May 15, 2018 via email

@apastuszak
Copy link
Author

@arendst Need some hand-holding on how how to do that.

@arendst
Copy link
Owner

arendst commented May 15, 2018

Copy from the repository lib folder the (new) TasmotaSerial-2.0.0 folder to your local lib folder. Remove the current TasmotaSerial-1.2.0 folder

@apastuszak
Copy link
Author

@arendst Had both 1.2 and 2.0 folders. Deleted 1.2 and I think it's OK. Thanks.

@apastuszak
Copy link
Author

OK, got everything to compile. Flashed Sonoff minimal without issue. Flashes full Sonoff and device rebooted and I get a rapidly flashing green light. Flashed with WIFI_MANAGER option. It's not coming up with it's own wifi network to connect to. I held the button down for 10 seconds to do a wipe and it still won't come up or show a wifi network.

I'm going to need to flash using the serial adapter. Sorry for the delay.

@apastuszak
Copy link
Author

Ok flashed to 5.12.0. Then tried to do an OTA to 5.14.0 using Sonoff minimal and am once again am getting flashing green light every second on a Sonoff Basic.

I'll need to take it apart again to flash serially.

@apastuszak
Copy link
Author

Ok, FINALLY managed to flash 5.14.0 using Visual Studio Code and Platform I/O over serial. DST settings seem to be working fine.

Thank you much for implementing this so quickly! Closing issue.

curzon01 pushed a commit to curzon01/Tasmota that referenced this issue Sep 7, 2018
Prep for user entry STD/DST (arendst#2721)
curzon01 pushed a commit to curzon01/Tasmota that referenced this issue Sep 7, 2018
Prep for user entry STD/DST (arendst#2721)
curzon01 pushed a commit to curzon01/Tasmota that referenced this issue Sep 7, 2018
curzon01 pushed a commit to curzon01/Tasmota that referenced this issue Sep 7, 2018
5.13.1c
 * Add user entry DST/STD using commands TimeStd and TimeDst
with options like 0,0,3,1,2,120 (arendst#2721)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants