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
  trigger:
    platform: state
    entity_id: binary_sensor.remote_ui
    to: "off"
  action:
    - 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"
          sequence:
            - service: homeassistant.restart
1 Like