HA updates are released quite often, which is great, but what happens to the automations that are running during the restart of the system?
Example 1: an automation that turns the lights on sunset and then using “wait for trigger” waits for 11pm to shut off the lights. What’s going to happen if I restart HA at 9pm, after sunset?
Example 2: motion activated lights with a 30 minute delay (wait for time to pass). What happens is the system restarts during those 30 minutes after trigger?
The automations are cancelled and the actions after your waits will not occur.
The only way around this is to not use long wait times in automations.
Instead of long wait for triggers, use separate automations with those triggers.
For long delays, store the time you want the next action to occur in an input_datetime and create a time triggered automation. e.g.
- platform: time
Aaah, I actually had it like that (separate automations) before and just cleaned it up. Wanted to have less automation entries. Lol.
The entire automation integration is restarted so, like tom_l explained, any in-progress automations are immediately terminated.
You should know that this also happens after executing Reload Automations. If you use the Automation Editor to create or modify an automation, the moment you click the Save button it automatically executes Reload Automations.
BTW, if you use the suggestion to employ a Time Trigger based on an Input Datetime, you’re not obligated to put it into a separate automation; it can be in the same automation provided you employ a
choose to distinguish which trigger was responsible for triggering the automation.
I’d be surprised if it can’t still be one automation. That’s what trigger IDs are for.
I’ve started using trigger IDs and a corresponding “choose” action for most all automations, even the simple single trigger ones. Makes coming back and adding functionality a little easier.
Didn’t quite get the “choose” idea, but read this blog post and got it now.
Indeed. This is the simple solution:
But adding more triggers and some action logic is also an option.