Appdaemon does not load new "secrets" on HA restart, but does on AppDaemon restart?

I have the following AppDaemon app:

grocy_automator:
  module: grocy_automator
  class: GrocyAutomator
  grocy_api_key: !secret grocy_api_key

in my secrets.yaml I have updated grocy_api_key, for simplicity, it used to be

grocy_api_key: "old_key"

and I have since updated it to

grocy_api_key: "NEW_key"

But in the GrocyAutomator class in grocy_automator.py this:

self.log(self.args['grocy_api_key'])

logs "old_key".

I have restarted Home Assistant multiple times, and done a “find an replace” for any other mentions of "old_key" (replaced to "NEW_key") both in all of config and all of AppDaemon Samba mounts.

But it keeps showing the old value from secrets.yaml no matter how many times I restart HA.

BUT restarting AppDaemon addon does make it load new secrets value. Is this expected behavior? I would have thought that a HA restart included an AppDaemon restart?

No, or at least not generally. It is possible there is some supervisor support for this I don’t know about.

Addons run in parallel next to HA. This is a benefit for many addons.

If you want to force it, there are service calls to stop/start/restart addons. Use them in an automation triggered by start or shutdown events.

I just restart AppDaemon addon from UI, it’s not really a problem.

I was just a bit perplexed that I needed to manually restart from addon page, and that it didn’t reload after restarting HA.