Cloud connection status sensor/retry interval

It would be brilliant if there was a sensor exposed for the status of the cloud connection. This would allow the status to be checked and remedial action taken.

Even better would be a way to retry the connection.

Eg. if my Raspberry Pi reboots and internet access isn’t available it will fail to connect and not appear to retry - I have to restart HASS in order to get HA cloud going again. I could automate this. It’s a bit of a pain to discover the cloud connection is down when you’re sitting in the driveway on the motorcycle trying to close the garage door via google assistant and you receive a ‘sorry, the device isn’t available at this time’ error.

So there’s a delay when your Pi reboots before the internet is accessible? So much so that HA starts before the connection is up?

Also, your Pi reboots unexpectedly?

Sorry, not that helpful, but given this description, I would check out the other stuff first.

There’s a delay if everything in the rack reboots, (eg power loss). VDSL modem takes an eternity to obtain line sync, HA beats it by several minutes. The internal network is online well before then, just no access through to the web.

No it doesn’t reboot unexpectedly. It’s just that the cloud connection doesn’t appear to ever retry (eg. it signed me out because my subscription expired, fixed the sub and it never reconnected, needed to restart HA; second eg. I had to change my power rail, Pi was up first but it never retried the cloud connection after the initial attempt so it wasn’t until I was out on the driveway on the motorbike trying to use google assistant that I discovered there was a problem).

It doesn’t happen often that it disconnects, but a way to catch it when it does (or have the connector retry) would mean it would never be an issue if it did.

I need to solve the same issue. Have HASS running in a remote cottage, where we have, unfortunately frequent outages. Many are short and could be mitigated by a UPS, but the one last week was a bad storm and 3 day outage. No matter, even if my router and HASS are on a UPS, they lose network as the Bell shed 500m away is disrupted.

When power is restored, both the router and HASS start at the same time, and HASS finds no network (yet). Solutions:

  • I want to be able to configure HASS to be able to retry network connection periodically if it does not have internet access (i.e., I cannot reach it). Say it tests ICMP to google.com.
  • Or configure HASS reboot periodically twice per day. Professionally as an IT guy I find rebooting distasteful, but reality is many systems benefit from a reboot to restore to initial running state.)

It has no network, I cannot reach it, so HASS has to do this independently.

My router is not yet exposed to the internet. I could maybe expose its management interface, but since HASS is not caring about the network, I don’t think I can coax it to restart.

Ideas?

I don’t have a working solution for this, but it’s now very rare in my situation.

You could look at using an automation leveraging he ping binary sensor (possibly in conjunction with uptime). Eg.
if uptime < 5mins AND ping google = fail then reboot.

Kind of dirty and brutal, it will continuously reboot until it gets a network connection.

There’d be a far more elegant way to do it but I can’t see a sensory or a way to detect the remote connection status (that would make it easy!).

Actually, there’s a binary_sensor.remote_ui entity.

Automation on that in conjunction with uptime - eg.
if uptime < 5mins AND binary_sensor.remote_ui = off then reboot.

The further I dig the more I find.

So you could even have an automation that fires on boot, sleeps for 5mins (or until a binary sensor pinging an internet host is true) and then calls the cloud.remote_connect service