Switch mqtt in NEW version not work!

Hi,
I installed the new version homeassistant OS for raspberry 3:
“/9.5/haos_rpi3-64-9.5.img.xz”

The version i had previously had a working setup for switches and mqtt in configuration yaml ::

switch: 
  - platform: mqtt 
    name: "luce prova1"
    command_topic: "/scsshield/device/luce prova1/switch"
    state_topic: "/scsshield/device/luce prova1/status"
    payload_on: "on"
    payload_off: "off"
    state_on: "on"
    state_off: "off"```


In this new version NOT work can't find devices !!! Why???
the problem is that it does not find any device

You ignored the release notes from 2022.06 to 2022.12 and ended up with an unsupported setup for MQTT. See Breaking Changes 2022.12 and MQTT Switch Integration documentation, how to adjust your configuration.yaml to make it work again.

Recommend to pay more attention to the release notes (especially breaking changes) in the future.

2 Likes

Hi
I try this example but crash homeassistant

You have to add something like this to your configuration.yaml:

mqtt:
  switch:
    - unique_id: luce_prova1
      name: "luce prova1"
      state_topic: "/scsshield/device/luce prova1/status"
      command_topic: "/scsshield/device/luce prova1/switch"
      payload_on: "on"
      payload_off: "off"
      state_on: "on"
      state_off: "off"

Be sure not to have another mqtt: key in your configuration, else put the switch: line and the rest under the mqtt:
MQTT device tracker is something completly different and has nothing to do with a switch.

spectacular thanks works perfectly now I understand !!