Hi, I need a template sensor that indicates when we are using Daylight Saving Time.
In my country the time changes “the last sunday of march” and “the last sunday of october”
I have been trying generating dates, firing an automation every night at 3:01 (passed the time change), and checking the different conditions…but I’d like to have it calculated in a sensor.
Isn’t there a sensor that tells us automatically if DST is being applied in the current timezone?
To clarify, the template I provided would not be suitable for use in a Template Sensor in any recent version of Home Assistant (since 0.87 or thereabouts). That’s because the function now() is not an entity that Home Assistant monitors for changes.
The example I offered was simply to demonstrate how to get DST information from a datetime object. If it were to be used in a Template Sensor, some other entity is needed that can be monitored by Home Assistant. Your suggestion to use sensor.time is perfect because that’s an entity that Home Assistant monitors once every minute (sensor.date is monitored once every day).