Reload AppDaemon apps on HA restart?

Hi

Is there a way to reload AppDaemon apps on HA restart?

Some of my apps occasionally stops working after I restart HA. If I trigger a restart, e.g. by saving the file again, the app will work again

Hello @tajacobsen,

You can use the plugin: directive in the apps config that you want restarted when HA restarts.

So for example

someapp:
    class: SomeApp
    module: someapp
    plugin: HASS

regards

Actually on a second thought, this should be happening automatically, and the above should only be needed, if more than a single plugin or plugin instance is in use.

Are you sure your apps are not restarting? Can you kindly show a log of what is outputted when HA restarts?

Regards

I can see the apps are indeed all being restarted upon HA restart. That just makes it even more interesting that the specific app sometimes has to be reloaded again (not always) to function correctly.

@tajacobsen,

What might be happening is that at the time AD restarts the app, a particular upon which your app is dependent on wight have not been loaded yet into HA. We do get such issues, like those using zwave devices.

So when you restart later, since the component has now loaded, it will then work fine. Can you outline what you are trying to do, what kind of components/entities are involved and what is your expected end result? This way, it will be easier to advice you on what steps to take.

Regards

This is a bit dated, but I have a similar issue. Appdaemon starts but not all the integrations, etc., that it depends on for source data have started when Appdaemon starts and initializes that app. What I’d like to do is:

  • Restart Home Assistant
  • At that point, the integrations, Appdaemon, etc. restart
  • I get info from the Sonos, trackers, NWS, and other integration to set certain features in HA, but some don’t work as expected because the source info hasn’t loaded (yet) when Appdaemon starts (for example, the Sonos favorites sensor hasn’t loaded with the favorites)
  • After a couple of minutes, I’d like to restart Appdaemon. But I’m not sure how to do that with automation (I currently do it manually)

Can someone offer an automation that does this? It would have to trigger off the HA start, wait a couple of minutes with a time delay, and then reload Appdaemon.

This seems straightforward, but I can’t seem to figure it out :roll_eyes:

Any help is most certainly appreciated!