Manual mqtt configuration help please

Hi
I was running a flashed sonoff device with tasmota / MQTT to operate RF controlled blinds. Just stopped working with one of the recent releases. I know I need to update the code structure for the recent MQTT changes…but having a nightmare. Can anyone please help?

I’ve done a full clean install of HASS:

  • Core2024.1.6
  • Supervisor2023.12.1
  • Operating System11.4
  • Frontend20240104.0

Using MQTT Broker/MQTT & Tasmota. All looks good but it wont detect the switch below>.

Original code was:

switch:
#Close B1
  - platform: mqtt
    name: "Close B1"
    command_topic: "cmnd/tasmota_C26FAA/Backlog"
    availability_topic: "tele/tasmota_C26FAA/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
    state_topic: "tele/tasmota_C26FAA/RESULT"
    value_template: '{{value_json.RfCode}}'
    payload_on: "RFRAW AA B0 4C 04 08 140A 026C 0122 1450 38192A192A1A1A19292A19292A1A1929292929292929292A1A192A1A1A1A192A1A1A1A1A1A1A1A1A192A1A1A1A1A1A1A1A1A192A1A1A1A19292A1A192A192A192929 55"
    payload_off: "RFRAW AA B0 4C 04 08 140A 026C 0122 1450 38192A192A1A1A19292A19292A1A1929292929292929292A1A192A1A1A1A192A1A1A1A1A1A1A1A1A192A1A1A1A1A1A1A1A1A192A1A1A1A19292A1A192A192A192929 55off"
    state_on: "RFRAW AA B0 4C 04 08 140A 026C 0122 1450 38192A192A1A1A19292A19292A1A1929292929292929292A1A192A1A1A1A192A1A1A1A1A1A1A1A1A192A1A1A1A1A1A1A1A1A192A1A1A1A19292A1A192A192A192929 55"
    state_off: "RFRAW AA B0 4C 04 08 140A 026C 0122 1450 38192A192A1A1A19292A19292A1A1929292929292929292A1A192A1A1A1A192A1A1A1A1A1A1A1A1A192A1A1A1A1A1A1A1A1A192A1A1A1A19292A1A192A192A192929 55"
    optimistic: true
    retain: false
    qos: 2

What I now have:

mqtt:
  switch:
  - name: "Close B1"
    command_topic: "cmnd/tasmota_C26FAA/Backlog"
    availability_topic: "tele/tasmota_C26FAA/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
    state_topic: "tele/tasmota_C26FAA/RESULT"
    value_template: '{{value_json.RfCode}}'
    payload_on: "RFRAW AA B0 4C 04 08 140A 026C 0122 1450 38192A192A1A1A19292A19292A1A1929292929292929292A1A192A1A1A1A192A1A1A1A1A1A1A1A1A192A1A1A1A1A1A1A1A1A192A1A1A1A19292A1A192A192A192929 55"
    payload_off: "RFRAW AA B0 4C 04 08 140A 026C 0122 1450 38192A192A1A1A19292A19292A1A1929292929292929292A1A192A1A1A1A192A1A1A1A1A1A1A1A1A192A1A1A1A1A1A1A1A1A192A1A1A1A19292A1A192A192A192929 55off"
    state_on: "RFRAW AA B0 4C 04 08 140A 026C 0122 1450 38192A192A1A1A19292A19292A1A1929292929292929292A1A192A1A1A1A192A1A1A1A1A1A1A1A1A192A1A1A1A1A1A1A1A1A192A1A1A1A19292A1A192A192A192929 55"
    state_off: "RFRAW AA B0 4C 04 08 140A 026C 0122 1450 38192A192A1A1A19292A19292A1A1929292929292929292A1A192A1A1A1A192A1A1A1A1A1A1A1A1A192A1A1A1A1A1A1A1A1A192A1A1A1A19292A1A192A192A192929 55"
    optimistic: true
    retain: false
    qos: 2

Your old syntax removal was announced in 2022.6 and removed in 2022.9 :slight_smile:
Part of an exemple from the documentation

mqtt:
  - switch:
      unique_id: bedroom_switch
      name: "Bedroom Switch"
      ...

So you’re missing the first - at the switch tag. And there is no - for the switch itself.

So, it could be (not tested obviously)

mqtt:
  - switch:
      unique_id: 8ffb15fe-a74d-4f46-b36b-a152f90a714f
      name: "Close B1"
      command_topic: "cmnd/tasmota_C26FAA/Backlog"
      availability_topic: "tele/tasmota_C26FAA/LWT"
      payload_available: "Online"
      payload_not_available: "Offline"
      state_topic: "tele/tasmota_C26FAA/RESULT"
      value_template: '{{value_json.RfCode}}'
      payload_on: "RFRAW AA B0 4C 04 08 140A 026C 0122 1450 38192A192A1A1A19292A19292A1A1929292929292929292A1A192A1A1A1A192A1A1A1A1A1A1A1A1A192A1A1A1A1A1A1A1A1A192A1A1A1A19292A1A192A192A192929 55"
      payload_off: "RFRAW AA B0 4C 04 08 140A 026C 0122 1450 38192A192A1A1A19292A19292A1A1929292929292929292A1A192A1A1A1A192A1A1A1A1A1A1A1A1A192A1A1A1A1A1A1A1A1A192A1A1A1A19292A1A192A192A192929 55off"
      state_on: "RFRAW AA B0 4C 04 08 140A 026C 0122 1450 38192A192A1A1A19292A19292A1A1929292929292929292A1A192A1A1A1A192A1A1A1A1A1A1A1A1A192A1A1A1A1A1A1A1A1A192A1A1A1A19292A1A192A192A192929 55"
      state_off: "RFRAW AA B0 4C 04 08 140A 026C 0122 1450 38192A192A1A1A19292A19292A1A1929292929292929292A1A192A1A1A1A192A1A1A1A1A1A1A1A1A192A1A1A1A1A1A1A1A1A192A1A1A1A19292A1A192A192A192929 55"
      optimistic: true
      retain: false
      qos: 2

Don’t do like me, take the good habit to put a unique id, so it is somehow editable in the UI.
You can find a UUID generator here (each reload gives you a new one)

1 Like

Thank you very much. That fixed about 90% of it and I’ve worked out the rest now.

Back up and running! Appreciate the help