Using secrets file with AppDaemon on Hass.io

I’m having a weird issue trying to set up AppDaemon. The docs say that secrets.yaml should work, and I’ve put the url and long-lived token info in there, leading to the following appdaemon.yaml:

secrets: /config/secrets.yaml
log:
  logfile: /config/appdaemon/logs/appdaemon.log
  errorfile: /config/appdaemon/logs/error.log
appdaemon:
  threads: 10
  app_dir: /config/appdaemon/apps
  plugins:
    HASS:
      type: hass
      ha_url: !secret http_url
      token: !secret appdaemon_token

However, when I restart AppDaemon, it strips out the “!secret” part of the last 2 lines, giving me:

      ha_url: http_url
      token: appdaemon_token

Which doesn’t work.

If I just put in the url and token in plaintext directly into appdaemon.yaml, it seems to work fine.

Additionally, I noticed that restarting AppDaemon strips any commented out lines from appdaemon.yaml, which is annotying, but not critical.

Note: I found an earlier bug report where the system appeared to insert the plaintext values into appdaemon.yaml, this isn’t the same problem. This is about it stripping out ‘!secret’

Advice?

This is really weird. I just checked the code, and appdaemon opens appdaemon.yaml as readonly, so I can’t see that appdaemon is changing the file.

Which makes me think that it must be something in the addon, but it must be something that knows what a yaml file looks like to be able to pick the comments out.

yup that is something from the addon.

the hassio sets the url and token itself, and you shouldnt change that.
the hassio gets its token from homeassistant. you shouldnt try to add your own.

thats the way it works with hassio. thats also why comment dissappear.

I’m glad I don’t use it.

1 Like

i wouldnt use something that auto updates and changes settings for my house either :wink:

This is an open issue when using hass.io and @frenck is looking into it.

Interesting. I don’t think it’s a Hass.io issue, since it doesn’t do this to any other plug-ins, must be something specific to this plug-in. Weird. Hope they fix it.