Why am I getting an invalid YAML syntax error in the WiFi component?
If I comment out the Miranda lines from the wifi component, there’s no error. But I can’t see what is wrong with the Miranda lines. I’ve also made sure there were no TAB characters anywhere.
There is a comment at the top of the actual file that I didn’t copy, so the line# is off by one… I’ve added it to the post so that the line number is correct.
Could there be something in the serenity password that messes up the lines after? I would try to put the miranda password above the serenity one and see if the problem moves to naboo.
INFO Reading configuration /config/esphome/steve-desk-light.yaml...
ERROR Error while reading config: Invalid YAML syntax:
Secret 'miranda_password' not defined
in "/config/esphome/common/wifi.yaml", line 9, column 15:
password: !secret miranda_password
^
Holy bleep. I have three.
In:
config
config/esphome.
config/esphome/common
The one that opens when I click on “SECRETS” in the ESPHome panel is where I’ve been adding the passwords.
The one that ESPHome is using is the common folder.
The secrets.yaml in the config folder holds my latitude and longitude, my MQTT broker credentials and various usernames and passwords for external hosts and cameras.
At any rate, adding the Miranda password into the secrets.yaml in the common folder fixed the issue.
@stevemann
Hmm… maybe has something to do with the type of installation you are using…
I don’t have \esphome\common\secrets.yaml, I only have one: \esphome\secrets.yaml.
And having \esphome\secrets.yaml as well as HA’s secrets.yaml makes sense; not everyone uses ESPHome as HA addon; it can also be running stand alone, and in that case it would need its own secrets.yaml
PS, in your case you’re telling common ESPhome to include ESPhome secrets, and then tell ESPhome secrets to include HA’s secrets.yaml from the parent folder
That only happened when I added some Network Access Points and use different AP names. To make it easier, I moved my wifi: component into a package. This is why the common/secrets.yaml.