core: Times of the Day broken
The problem
Times of the Day broke after updating to 2021.5 and 2021.5.1. I have a global night sensor where the light doesn’t turn on from the motion sensor. This sensor goes through midnight. Its working hours are from 23:00 to 10:00. 6.05.2021, when 23:00 came, the sensor turned on and was active after midnight, but at 3 am I decided to restart the server, after turning on the sensor turned off. and in the information about the sensor, it became clear that the new activation time will now be after 23:00 of the new day. Previously, I could reboot the server at any time, even before midnight or after, and it would correctly work out the reboot. Now i restored 2021.4.6 and ‘tod’ work normall again.
What is version of Home Assistant Core has the issue?
core-2021.5 and core-2021.5.1
What was the last working version of Home Assistant Core?
core-2021.4.6
What type of installation are you running?
Home Assistant Container
Integration causing the issue
Times of the Day
Link to integration documentation on our website
https://www.home-assistant.io/integrations/tod/
Example YAML snippet
- platform: tod
name: global_night_weekend
after: '23:00'
before: '10:00'
Anything in the logs that might be useful for us?
No response
Additional information

About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 17 (1 by maintainers)
Update. The sun.sun is not broken.
To anyone that comes here because they have the problem here are two work arounds while we wait for a fix for TOD.
If you need a sensor based on time use this work around https://community.home-assistant.io/t/2021-5-stability-performance-triggers-color-modes/305463/320
If you need a sunrise / sunset based sensor this this work around https://community.home-assistant.io/t/2021-5-stability-performance-triggers-color-modes/305463/329