Automation trigger while power outage

What happens to trigger which was suppose to fire during power outage (or HASS not working)?
For example: trigger is at ‘10:30:00’ and there was power outage from 10:00 to 11:00. Machine with HAS been restored just after 11:00.

Is it just skipped, right?
And what about wait_template? Does HASS resume waiting?

So how do you deal with HASS reliability when you’re required to keep some switch on during period of time (ex. 4 hours)? Using trigger every 5 min with conditions?


No system has reset. Everything will be waiting to trigger.

Build an automation that checks minutely (or 5 minutely if you want) the status of the switch and turns it on if it’s off.

This automation will check the state of the switch every 5 minutes between 8 am and noon. If the switch is off, it will turn it on.

- alias:
    - platform: time
      minutes: '/5'
      seconds: 00
    - condition: state
      entity_id: switch.x
      state: 'off'
    - condition: time
      after: '08:00:00'
      before: '12:00:00'
    - service: switch.turn_on
      entity_id: switch.x

So HASS does not persist waiting into DB? It would be great for reliability of long-lasting waits…

OK, just a basic example, works nice.
If I want to make sure that switch is turned off “outside” the period I need another one automation with proper time range, right? Or can I trigger checks every 5 min and set some rule like “if time is within range then switch on, else switch off”? Is it possible to make such single automation?

No it does not. Personally I think this is a mute point because you can purchase an APC to keep your electronics alive during brown outs. If you want to be cheap, you can build your own automation using appdaemon w/ python to handle something like this. Or you can make a feature request to have this functionality added, but then you’ll be waiting on other people requesting the functionality.

Yes it’s possible but it requires templating.