Automation help - Reboot HA if Nabu Casa is down

Hi there!

I have a HA instance on my summer home and suddenly I couldn’t access via Nabu Casa. HA was not down because I have it connected to Google home and I could interact with all my devices though Google Home. Also, the internet connection was working properly. The cloud connection was severed, and I did not have any other means to access.

Finally, I managed to get someone in the house and power off /on the RPI and the connection came back up.

I thought of having an automation to ping my Nabu Casa remote access address and to reboot the RPI if there was no answer for a reasonable time.

Can someone help on how to implement it?

Thanks in advance!!

Rebooting is rather drastic.

Even restarting Home Assistant is probably overkill. Try a reconnect first, then if that does not work try a restart.

- alias: Cloud Connect
    platform: state
    entity_id: binary_sensor.remote_ui
    to: "off"
    - service: cloud.remote_connect # try to reconnect first
    - delay: 10
    - choose: # if that does not work try a restart. 
        - conditions:
            - condition: state
              entity_id: binary_sensor.remote_ui
              state: "off"
            - service: homeassistant.restart
1 Like