Just realize that I should add secrets.YAML and base on information the way to do it is adding esphome/secrets.YAML with this <<: !include ../secrets.yaml
I reboot my HA and the ESPHome Addon, on my ESPHome I already see secrets editor,
however, when I add !secret on my ESPHome device I got a red X on the first line saying it did not find secrets.YAML or error.
So I did not dare to go through worrying my device will become disabled.
Does anyone know what I did wrong?
Running HA 2021.7.4 with supervised + ESPHome AddOn. The ESPHome Directory is inside the config directory.
Sorry for necroposting, but I faced some problems with this issue too. But it seems to only be a problem with the add-on “File editor” for me, not an actual problem. I run a supervised instance.
As soon as I enter the required <<: !include ../secrets.yaml in the /config/esphome/secrets.yaml file through File editor, a red exclamation pops up in File editor with a weird message:
cannot merge mappings; the provided source object is unacceptable (1:29)
1 | <<: .include ../secrets.yaml "
---------------------------------^
Initially I thought I had the same problem with the others and tried to debug. But I gave up and just thought to try to compile and upload to a node. YAML was validated, compilation completed without any errors and as soon as the firmware was uploaded, the node connected to wifi just fine. I had initially replaced the wifi_ssid name only, and went on and tried with wifi_passw after that. It worked too. So in my case it’s just a false positive on the File editor’s GUI, nothing more than that.
If someone has figured out what that message means, please let us know.
I have the same problem posted by @Tryfos. Is there a solution that the HA File Editor does not complain as described? Even knowing that it works nevertheless, it is a bit “disturbing”.
Home Assistant 2023.4.6
Supervisor 2023.04.1
Operating System 9.5
Frontend 20230411.1 - latest
PS/EDIT: Unfortunately, with this …
<<: .include ../secrets.yaml
… in /config/esphome/secrets.yaml
… I cannot update, because the update quits with this error message:
Updating /config/esphome/esp32-ha1.yaml
------------------------------------------------------------
INFO Reading configuration /config/esphome/esp32-ha1.yaml...
ERROR Error while reading config: Invalid YAML syntax:
While constructing a mapping
in "/config/esphome/secrets.yaml", line 1, column 1:
<<: .include ../secrets.yaml
^
Expected a mapping or list of mappings for merging, but found <class 'esphome.helpers.EStr'>
in "/config/esphome/secrets.yaml", line 1, column 5:
<<: .include ../secrets.yaml
^
========== [ERROR] /config/esphome/esp32-ha1.yaml ==========
That’s all inspiring, but I just kept 1 secrets.yaml file and put a symbolic link from my extended folders back to the original in config/esphome.
Then the secrets thing works in the addon, the fussy include thing can be ignored, and all is well in Mudville.
cd {to the folder trying to reference the secrets.yaml}
ln -s {Path to your esphome folder}/secrets.yaml secrets.yaml