Power failures - Auto-restart

Hi,

lastly we had some power failures in our house.

HA starts faster as my router provides an internet connection, so there will be a persistant notification telling me some services could not connect.

I actually don’t now if those services only connect at start of ha or if they will also connect later.

Is it possible to use an ingoing persistant_notification as a trigger? If possible I would do an automation like this

- alias: Auto-Restart
  initial_state: 'on'
  trigger:
     #persistant_notification_trigger
  action:
    - service: homeassistant.restart

Because this is what I do manually when I get does messages, normally there will be an internet connection after this reboot, so all services can connect.

Not sure about the persistent notification piece, but an alternative could be to actually test your internet connectivity and trigger the restart when the sensor changes from down to up. Check out the example in this thread: WAN test script - quick and dirty

1 Like

Thank u, I use this for a persistant_not pop up at the start

- alias: Auto-Restart - Persistant Notification (60sec)
  initial_state: 'on'
  trigger:
    - event: start
      platform: homeassistant
  action:
    - delay: 00:01:00
    - condition: state
      entity_id: persistent_notification.invalid_config
      state: 'notifying'
    - service: homeassistant.restart

and this one when internet drops while homeassistant runs (most probably I will need this rarely)

- alias: Auto-Restart - Kein Internet (30min)
  initial_state: 'on'
  trigger:
    platform: state
    entity_id: binary_sensor.ping_binary_sensor
    to: 'off'
    for: '00:30:00'
  action:
    - service: homeassistant.restart
1 Like