core: TOD (Times Of the Day) is not working correctly after daylight saving

The problem

TOD sensor is ignoring daylight saving time.

Sensor changed state at 10:30, after CET->CEST (+1h). After HA reboot everything works correctly.

What is version of Home Assistant Core has the issue?

2021.3.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

tod

Link to integration documentation on our website

https://www.home-assistant.io/integrations/tod/

Example YAML snippet

- platform: tod
  name: day
  after: '09:30'
  before: '22:00'

Anything in the logs that might be useful for us?

Screenshot 2021-03-29 at 11 10 28

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 7
  • Comments: 36 (1 by maintainers)

Most upvoted comments

There’s a fix for this issue (See #84931) . Just waiting for a review (@bdraco )

Just ran into this issue myself. Hopefully that PR can be merged…

Encountered this issue following this morning’s UK Daylight Savings change.

configuration.yaml

binary_sensor:
  - platform: tod
    name: "tod_ha_night"
    after: "22:00"
    before: sunrise
    before_offset: "-01:30"

Following clocks change binary_sensor.tod_ha_night state changed to ‘on’ at 21:00. Host OS and the HA Time & Date sensor both showed correct time, After a HA restart at 21:04 binary_sensor.tod_ha_night correctly showed ‘off’.

Pet the gitbot. Go to sleep again.