YAML file Syntax Error Help Needed

I am new to Home Assitant and ESPhome
I installed Home Assistant using Virtual Box
I added on ESPHomne and EMQX
I have devices discovered in ESPhome and they work I can control them on and off.

I need the devices to connect to EMQX
I setup the authentication in EMQX

I need to update the YAML file per the article from ESPHOME on MQFT Client Component setup.

I my YAML File I added this

broker: Localhost
username: broker
password: !secret X1tYK@@

The syntax error is on the password line the Red character is the exclamation mark !strong text

When I update All in ESPHOME I get this error

Error Error while reading config file invalid yaml syntax
secret “xyxxyx” not defined
in "/config/esphone/billboards.d78771.yaml, line 18, column 15:
password: !secret xyxxyz

Any ideas or suggestions?

Thank you


Welcome to the forum!

You are using !secret after password:. Therefore, esphome looks for a password in the secret.yaml. Just remove the !secret part from your .yaml file for your ESPHome device and see if it works.

Also please use code formatting when posting yaml parts, this makes it easier to read. Like so:

broker: Localhost
username: broker
password: xxxx

BTW, there is also a MQTT Addon in the addon store for Home Assistant. Not sure if you already checked.


Thank you I know about MQTT Addon But I am using EMQX recommend by a friend of mine.

I will look into that also.

I removed !secret from the line this time no error

But not sure what that did still investigating.

Welcome Tom. For future posts please take a moment to figure out how to format your code properly. You’ll see that’s “how we do things around here” and it helps us help you. Cheers.