WTH Can't an integration auto-reload when it becomes unavailable?

Many integrations become unavailable from time to time. In my case, it’s mostly ESPhome integrations, but this is definitely not exclusive to ESPhome. It would be nice if there could be a switch to enable auto-reload of the integration if an entity becomes unavailable. There could also be a cool-off period before reloading again.

For example:

  1. An entity provided by an integration becomes unavailable
  2. Wait for 20s
  3. Reload that integration
  4. If that did not help, wait for an hour
  5. Reload again
  6. Did not help
    7a. If endless reloading is enabled, go to 4
    7b. else abort (and maybe send a notification)

Note: Yes, reloading an ESPhome integration fixes the problem in 99 % of the cases. It’s the same with, for example, Google home (leikoilja) or NUT.

Note 2: Yes, I know I can write an automation for that but having an automation for every integration is crazy.

Actually, ESPHome does reload when a device becomes available again.

So there are 2 different things.

  • One is reconnecting (which by default it does when during unavailable).
  • The other is listening on the network for the device to pop up again in discovery. E.g., in case of a changed IP address, it will update the integration configuration and actually reload it.

This sounds like an issue with how you run Home Assistant or your network, as the WTH you are filing is actually implemented.

EDIT: You also described Google Home and NUT. Those rely on mDNS like ESPHome. Sounds like you have an not working zeroconf/mDNS issue on your network, preventing HA from discovering changes.

Hi, did you find a solution? I have many devices and this happens to me quite often … it is very annoying if the automation calculates with them and they are unavailable … and I have to reload them manually