Does anyone know how to configure Tasmota DST/ST settings?

I am trying to configure Tasmota to have proper timezone settings.

These are the lines I put in my user_config.h:

#define TIME_DST North, Second, Sun, Mar, 2, -240
#define TIME_STD North, First, Sun, Nov, 3, -300

The second Sunday in March is when the US switches to Daylight Saving Time. I believe I have the right syntax for the TIME_DST value. All the examples I found used only FIRST and LAST.

I would also like to know if these values can be set from the Tasmota command line, or do I have to compile Tasmota every time I want to change these values?

I did all my time setup via the console. I found the time_dst function confusing as hell and I could not get it to work. I ended up only using “Timezone 10” ( I live in Melbourne which is GST+10) and it is now the correct time

could you please explain how. how do I do it on the console I leave in east USA

Go to the tasmota interface, click on “console”, in the “enter command” box type “Timezone -5” and hit enter… -5 should be east usa zone I think. adjust as needed for other locations (5 hours behind GMT)

1 Like

In case it will help someone, we can do all the settings through the Tasmota console.
Ref: Sonoff commands
The steps are:

  1. Set device to use Timezone with DST by issuing the following “Timezone 99”

  2. Setup when daylight savings start by using the command “TimeDST H,W,M,D,H,T”
    eg. “TimeDST 1,1,10,1,2,660” for Melbourne, Australia.
    H , W , M , D , h , T
    H = hemisphere ( 0 = northern hemisphere / 1 = southern hemisphere) [Melbourne = Southern hemisphere]
    W = week ( 0 = last week of month, 1..4 = first … fourth) [DST starts on 1st week of month]
    M = month ( 1..12 ) [DST starts in Oct for Australia]
    D = day of week ( 1..7 1 = sunday 7 = saturday) [DST time change is on a Sunday for Australia]
    h = hour ( 0..23 ) [DST time change is 2.00AM for Australia]
    T = timezone ( -780..780 ) (offset from UTC in MINUTES - 780min/60min=13hrs) [Time offset for Melbourne is +11 hours or +660 minutes during DST]

  3. Now we need to setup the normal time offset when there is no DST. Issue the following command in your console “TimeSTD 1,1,4,1,2,600” if you live in Melbourne, Australia.
    Similar to the above
    1 = Southern hemisphere
    1 = DST stops on 1st week of month
    4 = DST stops in April
    1 = It changes on a Sunday
    2 = Change at 2.00AM
    600 = Normal time offset is +10 hours which equals 600 minutes

Hope that this will help someone. :slight_smile:

15 Likes

thanks for the info I tried to change the input data based on my location. tasmota seems to accept it but does not change the time. Restart the device and I have to use the timezone command. maybe it will change next time. I will update this message.

I’ve been tripped up by time and Tasmota recently.

By default the ISO string returned is UTC but does not have the TZ at the end so any system getting that time string assumes it to be local time (as per the standard).

You should add the timezone character by using setOption 52. If no TZ is set this should always be ‘Z’ i.e. UTC. HA should then take that and do the necessary changes wrt the local timezone. This is the safest way to handle time in Tasmota (other than exporting epoch timestamp) and does not rely on getting the DST settings correct.

It did help :slight_smile: Thanks. Keeping this post on my list of “I need to know”.

1 Like

Interesting. I never thought about letting HA handle the timezone. I normally like all things to be standardized (UTC is a great way to do that), but it bothers me that the console timestamps are off when I’m trying to work on it.

I found an easy method for changing timezone for my devices as I flash them.

For myself, I’m in Eastern Timezone in US, so I type these three commands in console as follows:

TimeZone 99
TimeDST 0,2,3,1,2,-240
TimeSTD 0,1,11,1,2,-300

Though, I am working on an easier way using curl and the URLs to send the same commands. Right now I just copy/paste a string of 4 curl commands (3 to set those above, and the last to set option19 to 1).

I am curious on where the time even comes into play. When the tasmota device sends the mqtt message to mosquito, I see the time being logged. If I change the timezone, how will HA respond? I see no TZ data in the payload. Will it mess up any historical data/graphs with a change?

04:41:18 MQT: tele/th16_1/switch1/SENSOR = {"Time":"2020-04-26T04:41:18","AM2301":{"Temperature":20.3,"Humidity":52.5,"DewPoint":10.2},"TempUnit":"C"}

Now I don’t know if I should change every tasmota device to UTC or continue setting them all to my local TZ. So long as you keep it consistent, are there any drawbacks or advantages to either?

Thanks it did help :slight_smile: and I tweaked for South Australia with:
TimeDST 1,1,10,1,2,630
TimeSTD 1,1,4,1,3,570

And it is still helping - thank you.

This is still tripping me up any help very much appreciated.

Problem:
Just had daylight savings time and my devices are once again one hour behind

Details:
Daylight saving time 2021 in Massachusetts began at 2:00 AM on
Sunday, March 14
and ends at 2:00 AM on
Sunday, November 7
(see here)

With that, I think the following is correct (see TimeDst TimeStd from here):

  • timedst 0,3,3,1,2,-240;
  • timestd 0,2,11,1,2,-300

Note: the 2nd value (week) I think I got right

  • March 14 = 3 (3rd week of the month)
  • Nov 7 = 2 (2nd week of the month)

Which I execute with the following (which I picked up from here):

  • backlog ntpserver pool.ntp.org; time 0;timedst 0,3,3,1,2,-240;timestd 0,2,11,1,2,-300

Not forgetting that to use TimeDst and TimeStd, timezone must be configured with 99 (see timezone from here

  • timezone 99

Just checking in to see if there are any takers on this (^^^) as it’s been about 2.5 weeks since the post. I have about 20 devices, having the correct time is critical for lights to turn on/off at the expected time. Any help and/or insight would be greatly appreciated.

Scratch, 2.5 weeks later I ran the same 2 commands and all of a sudden they work as expected, I literally changed nothing just ran the same exact commands as specified. I utilized TasmotaAdmin to run the commands to simplify the task

  • timezone 99
  • backlog ntpserver pool.ntp.org; time 0;timestd 0,1,11,1,2,-300; timedst 0,3,3,1,2,-240;
5 Likes

To make it easier for anyone else who does this search and ends up here.

There’s a list of timezones and the correct tasmota commands here:
https://tasmota.github.io/docs/Commands/timezone_table/

3 Likes

The easiest way I’ve found as of 2023
https://tasmota-tz.netlify.app/

3 Likes

Hi you all,

can someone give me a hint please?
I’m trying to change the time/date format from MM/DD to DD/MM shouldn’t be that hard ?
I can’t figure it out?!
Tried TimeDST H,W,D,M,H,T (swapped the D & M) but that doesn’t do anything.
And something else, how to display the humidity at the nspanel?
In HA there is air pressure in the wheather add-on but how to send that to the nspanel ?

thank you!

https://tasmota.github.io/docs/Timezone-Table/

1 Like

Thanks !