"Modern way" of MQTT Switch definition

Dear Community,

I have several mqtt switches defined in my configuration, here’s one example:

# switch Livingroom Mainlight
- platform: mqtt
  name: "Livingroom Mainlight"
  icon: 'mdi:lightbulb'
  command_topic: "fgg/groundfloor/livingroom/LivingRoomMainLight/cmnd/POWER"
  state_topic: "fgg/groundfloor/livingroom/LivingRoomMainLight/stat/POWER"
  qos: 2
  payload_on: "ON"
  payload_off: "OFF"

Lately at startup I’m getting the notification

The mentioned “documentation” is this MQTT Switch

So, I went on re-defining my switches like that:

mqtt:
# switch Livingroom Mainlight
  switch:
    - unique_id: living_room_main 
      command_topic: "fgg/groundfloor/livingroom/LivingRoomMainLight/cmnd/POWER"
      state_topic: "fgg/groundfloor/livingroom/LivingRoomMainLight/stat/POWER"
      # name: "Livingroom Mainlight"
      # icon: 'mdi:lightbulb'
      # qos: 2
      payload_on: "ON"
      payload_off: "OFF"

Unfortunately, the switches are not appearing as entities.
Any clue what I may doing wrong?

Thanks!

Include the name option.

mqtt:
  switch:
    - name: "Livingroom Mainlight"
      unique_id: living_room_main 
      command_topic: "fgg/groundfloor/livingroom/LivingRoomMainLight/cmnd/POWER"
      state_topic: "fgg/groundfloor/livingroom/LivingRoomMainLight/stat/POWER"
      icon: 'mdi:lightbulb'
      qos: 2

No need to include payload_on: "ON" and payload_off: "OFF" because the default values are ON and OFF.

A post was split to a new topic: Help needed configuring MQTT switch