So I’m just starting to evaluate Home Assistant (currently openHAB power user).
I like that you can seperate the passwords into a secrets.yaml file. However it does not seem to work for addons, only in configuration.yaml.
I have an entry in my \\192.168.40.32\config\secrets.yaml
saying
and on the page http://pi-homeassistant:8123/hassio/addon/core_samba/config I try with
password: !secret samba_password
password: “!secret samba_password”
password: ‘!secret samba_password’
None of these work for me. Error message on save is:
Failed to save add-on configuration, Unknown secret 'samba_password' in Samba share (core_samba). Got {'workgroup': 'WORKGROUP', 'username': 'xxxxxxxxx', 'password': '!secret samba_password', 'allow_hosts': ['10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16', 'fe80::/10'], 'veto_files': ['._*', '.DS_Store', 'Thumbs.db', 'icon?', '.Trashes'], 'compatibility_mode': False}
I do have restarted Home Assistant (http://pi-homeassistant:8123/config/server_control
> Restart) and tried with the various quotation mark variants.
I have seen users mentioning here that it works for them, so… what am I doing wrong?
3 Likes
I’ve encountered this with several add-ons when setting a friends Home Assistant.
It’s not Home Assistant that needs to be restarted, it’s the add-on. It’s like the copy of secrets.yaml that it has access to, is cached. Write anything in for now as the username and password just so you can start the add-on. Then go in to the config and replace the password with !secret samba_password
and then when you hit save it will ask if you want to restart the add-on with the new configuration. It should work after that.
13 Likes
Wow, that was a fast solution, thank you! Indeed I had to first restart the addon (http://pi-homeassistant:8123/hassio/addon/core_samba/info > Restart) and then restart it again after putting in !secret … in the configuration.
1 Like
Not sure what has changed, none of the add-ons previously exhibited this weird behaviour in the past, it’s a recent change. Glad to have helped you sort it though.
Yop1403
(GuentherH)
February 4, 2022, 2:07am
5
eikowagenknecht:
!secret samba_password
Good the HA community is out there - I finally also figured how this works. Thank you!
thomine
(Thomas)
January 15, 2023, 9:02am
6
Hello,
You can also consider this solution to edit the file in YAML directly:
I think I solved it myself.
For one I deleted the entry in config/.storage/core.device_registry. There still was a MariaDB entry in there (also an entry for the uninstalled phpMyAdmin.
Not sure if this is crucial, but the error in the log seems to have disappeared.
More importantly:
The move to UI seems to be incomplete for MariaDB integration.
you have to select “Edit YAML” if you want to use secrets. The exact same code works if you copy it into the edit in yaml mode.
Hi guys,
I Know i am a little bit late but maybe someone get this as a result of search …
You can use the way explained above:
set something as user & pass
start addon
edit user & pass to !secret samba_user & !secret samba_pass
But you also just can type it in correctly dont mind yaml or frontend mode just type it into quotes…
username: “!secret samba_user”
password: “!secret samba_pass”
then it throws no error message while saving config file
1 Like