"The mqtt platform for the switch integration does not support platform setup."

I’m getting this message after upgrading to 2023.6 and I really can’t make sense of it. I reworked my configuration painstakingly to get rid of all and any warnings on 2023.5.

There’s no configuration line given, either, so I really don’t know where to look to fix this.

1 Like

What does your config look like?
Here is an example of mine that works:
mqtt:
switch:
- name: “One Lights”
state_topic: “shellies/OneLights/relay/0”
command_topic: “shellies/OneLights/relay/0/command”
payload_on: “on”
payload_off: “off”
retain: false
icon: hass:lightbulb

This is the old version:
switch:

  • platform: mqtt
    name: “One Lights”
    state_topic: “shellies/OneLights/relay/0”
    command_topic: “shellies/OneLights/relay/0/command”
    payload_on: “on”
    payload_off: “off”
    retain: false
    icon: hass:lightbulb
    (Edit - sorry, not sure how to get the above to look like code)

place three backticks (```) on the line before the code and then on the line after it.

or select the code and click the </> symbol in the post editor menu.

It means you’ll have to remove platform mqtt from you configuration.yaml. it now it stored seperately from UI.
Not sure if it’s automatically imported there, so don’t throw the current lines away yet. (Comment them out).
Error will go away

Okay so I have

mqtt:
  binary_sensor: !include mqtt_binary_sensor.yaml
  sensor: !include mqtt_sensor.yaml

right now and you’re saying I don’t need these lines because HA stored them somewhere else and it will still work without?

Tried that. The error still showed up AND the entities that I defined were gone. So I reverted for now. Seems to work despite the “error”.

this is mine

in my config file I Have

mqtt:
  sensor: !include_dir_merge_list mqtt/sensor/
  climate: !include_dir_merge_list mqtt/climate/
  binary_sensor: !include_dir_merge_list mqtt/binary_sensor/
  switch: !include_dir_merge_list mqtt/switch/
  light: !include_dir_merge_list mqtt/light/

which means I can put any file the Folders

so in the light folder

and

doing it this way I can add as many files into the folders just by remembering the SPACEING and can give the files logical naming

sorry, mqtt seems slightly different. The ‘platform’ like @eftimg showed as 'old’config, isnt supported, moving to ‘mqtt’ tags is supported. So indeed this config should work, but if you say there is still error, please check if there is leftovers on a tag ‘platform’ remaining.

The only platform: mqtt I can find is in automations. Bit annoying. Using HA since 2017 and not one upgrade goes by where things don’t break … I will try to do more research where this message comes from and how to avoid it.

1 Like

Like that?

1 Like

Yes, that seems to be it. It’s a bug, then?

Seems not, seeing the reply from Pedro on it.

Right, you need to look in switch.yaml based on your screenshots.

You have a

- platform: mqtt

somewhere in that file.

FYI, I highly suggest you guys use text editors that can search files. VSCode → Find all in files → search for platform: mqtt, done. Ignore the ones in automations.

EDIT: I noticed that’s myles file, who has a correct config. Regardless, this will be in your switch: section of your configuration.

Hi community,

I am still having this warning but I’ve checked my configuration.yaml and cannot find any “platform: mqtt” configurations. Any idea what else should I check?

Use a find in files function in your entire config folder. Notepad++ or VSCode both have this ability.

Ah. Thanks. I did a search and found all “platform: mqtt” are in the zigbee2mqtt.yaml. I’ll leave them be at this moment. The entities are not used and probably z2m team will fix them in the next update.

zigbee2mqtt.yaml is not provided by Z2M, that’s something you created. Z2M has discovery enabled (which does not have this problem)

There is an updated zigbee2mqtt.yaml content available which solved that error for me.