I’ve had a working automation which remembered me to put out my trash cans. Therefore I had a “trash calendar” with all-day-events (i.e. start-time = 00:00h). If the actual time is 6 hours (21.600 seconds) before the start-time (so, if it’s 18:00h) I should get a telegram message. It worked in 2018, it did not now. I get the messages at 00:00h. Here is my sensor:
The template engine will attempt to work out what entities should trigger an update of the sensor. This can fail, for example if your template loops over the contents of a group. In this case you can use entity_id to provide a list of entity IDs that will cause the sensor to update or you can run the service homeassistant.update_entity to update the sensor at will.