MQTT Switch not registered

I have an issue with the new MQTT registration of switches. For some reason, my swich will not show up as entity anymore. Not sure what I am doing wrong. This is my code:

This is my MQTT integeration:

mqtt: !include_dir_merge_named mqtt

This is the mqtt switch

switch:
  unique_id: global_person_sitter
  name: global_person_sitter
  state_topic: "homeassistant/person/sitter"
  command_topic: 'homeassistant/person/sitter'
  payload_on: 'home'
  payload_off: 'not_home'
  retain: true

Does anyone have an idea of what I am doing wrong here? De config doesn’t give any errors. The switch however, does not show up in the entities list either. :frowning:

Edit: My HA is on core-2022.6.0

looks to me you are missing the “-” infront of unique_id:

SHouldn’t it be like this?

switch:
   - unique_id: global_person_sitter
     name: global_person_sitter
     state_topic: "homeassistant/person/sitter"
     command_topic: 'homeassistant/person/sitter'
     payload_on: 'home'
     payload_off: 'not_home'
     retain: true
1 Like

Damn! Did not see that at all! :slight_smile: Thanks!

1 Like

you’re welcome