I’m facing a strange issue with my Home Assistant setup, and despite trying a number of things, I haven’t been able to solve it. I’m hoping someone here might have an idea.
The problem:
I have automations that are triggered based on specific times – using both time and time_pattern triggers.
Recently, these time-based automations stopped triggering on time. Instead, they fire with a delay of anywhere between 2 and 20 minutes (seemingly random). I only noticed this after the fact, so unfortunately I can’t pinpoint exactly when it started (the logbook is deleted after 10 days).
Here’s an example of a time-based trigger that fired 8 minutes and 41 seconds late (intended time was 05:30):
Disabled all but one automation to rule out interference
Rebooted in Safe Mode – no improvement
Switched some triggers to use template-based triggers like {{ states('sensor.time') == '05:30' }} – slightly better, but still a 1–2 second delay
To eliminate the VM environment as the cause, I even set up a second clean HA instance in a VM with no integrations and just a minimal automation (send a notification at specific times using time and time_pattern triggers). This worked perfectly – triggers fired exactly on time.
So it seems like something is broken in my main system regarding time-based triggers.
Unfortunately, my backups don’t go back far enough to before the issue started (I noticed it too late – my bad for not keeping more history).
My questions:
Do you have any further ideas on how to diagnose or repair this issue? Like disabling something,… etc
Alternatively, how could I rebuild my HA instance from scratch without losing everything? I’d especially like to keep historical energy data, which is very important to me.
No… Not sure…
It would of course be good to fix it.
But what about ruling out the pump?
What happens if you duplicate the automation and replace the pump with an helper boolean, will this make it work?
But in the mean time you could make one template trigger with all the times.
{{ states('sensor.time') in ["05:30", "07:30", "11:30", "16:00", "18:00"] }}
Oh and also try and remove the device actions and make them switch.turn_on /off instead.
It shouldn’t be the reason but let’s try it all
Thanks a lot for your help — I really appreciate it!
I actually tested something similar just some days aso: just a new, simple, time-based automation triggering a notification — and even that one shows the delay.
So it doesn’t seem related to the device itself, unfortunately. Several automations are affected (but i did not post the yaml for all of them, to keep it simple)
Well the best patch I can give you is the template.
You could also have another template that would react to if the switch was not turned on between 5:30 and 6:00 and make another try.
But I don’t have the skills to help you with the actual problem.