MQTT switch entities not showing up

I have followed the documentation for the MQTT integration and some youtube videos, but I cant get the entity to show up for use on the dashboard or in the development tools. Here is how I have the YAML configured.
mqtt_YAML

What file is that definition in? The “mqtt:” line should be in “configuration.yaml”. You can then either follow it with the rest of the definition, or put it in a separate file and “!include” it in - your config may already be set up this way, expecting the definition to be in “mqtt.yaml”.

Then you need to reload either with “Developer Tools > YAML > Manually configured MQTT entities” or a restart. Then you should see it in dev tools.

I wen to the overview section and clicked the raw configuration editor.
image

if this isn’t where I’m supposed to enter this, how can I get to the configuration.yaml file from the HA server?

Install the file editor add-on (if you have HA OS)

afbeelding

okay. so I was able to get to this folder and edit it like this:

but when verifying the YAML i get this warning message:

Still no entities I can use, and unsure what the warning messages refer to.

Please post code as text, not as picture

mqtt:
  - switch
    - name: xxx
      unique_id: xxx
      command_topic: xxx
      state_topic
    - name: yyyy

Thanks guys. It was the weird spacing with with yaml stuff. it works now :slight_smile: