Update 2022.12.0 changes in mqtt .yaml?

Hi,

I am a little bit confused.

I am using a lot of MQTT based sensors.

Now I got an information about the new version 2022.12.0 will not accept my current config. I have to read documentation.

Unfortunately I am now unsure how to deal with multiple sensors. Which of the following will be the correct one?

#version 1
mqtt:
  sensor:
    -state_topic: "home/bedroom/temperature"
    -name "Temp - SZ"
  sensor:
    -state_topic: "home/kitchen/temperature"
    -name "Temp - K"

Or this one:

#version 2
mqtt:
  sensor:
    -state_topic: "home/bedroom/temperature"
    -name "Temp - SZ"
mqtt:
  sensor:
    -state_topic: "home/kitchen/temperature"
    -name "Temp - K"

Before upgrading I want to make sure the config is correct, so please bring some light in here.

Thanks a lot!

/KNEBB

neither, this

mqtt:
  sensor:
    - state_topic: "home/bedroom/temperature"
      name "Temp - SZ"

    - state_topic: "home/kitchen/temperature"
      name "Temp - K"

I believe it would be more like this “Version 3”

#version 3
mqtt:
  sensor:
    - name "Temp - SZ"
      state_topic: "home/bedroom/temperature"
    - name "Temp - K"
      state_topic: "home/kitchen/temperature"
2 Likes

Oh. I haven’t expected that.

Thank you so much!

/KNEBB

Hey

I tried the above for my binary_sensors and although I then no longer get the error alert when restarting, none of the motion sensors actually work with the new config so I’ve gone back to the old yaml.
Below is my new config…It looks spot on to me?

mqtt:
  binary_sensor:
    - state_topic: "LRMultisense001/pir/state"
      name: "Livingroom PIR"
      payload_on: "YES"
      payload_off: "NO"
      device_class: motion
      availability_topic: "LRMultisense001/LWT"
      payload_available: "Online"
      payload_not_available: "Offline"

You most likely have 2 mqtt binary sensor sections or 2 mqtt sections. You should only have 1 mqtt section with 1 binary sensor section, and all binary sensors listed beneath it.

1 Like

that is it.
what a rookie error. I created an mqtt file to !include in the configuration and then started that file with the like mqtt:
Dumbkopf! It doesn’t need the mqtt if it’s in it’s own file… I removed it and now it works
Thanks petro

I am struggling with the same problem, but it’s the MQTT integration of TeslaMate.

I’ve implemented it like described in HomeAssistant Integration | TeslaMate

configuration.yaml basically looks like this:

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

mqtt_sensor.yaml (HomeAssistant Integration | TeslaMate)

- name: tesla_display_name
   state_topic: "teslamate/cars/1/display_name"
   icon: mdi:car

 - name: tesla_state
   state_topic: "teslamate/cars/1/state"
   icon: mdi:car-connected
  ...

mqtt_binary_sensor.yaml (HomeAssistant Integration | TeslaMate):

 - name: tesla_healthy
   state_topic: "teslamate/cars/1/healthy"
   payload_on: "true"
   payload_off: "false"
   icon: mdi:heart-pulse

 - name: tesla_update_available
   state_topic: "teslamate/cars/1/update_available"
   payload_on: "true"
   payload_off: "false"
   icon: mdi:alarm
  ...

This results in the same error message.
Any ideas how to change it so that it will not break in the upcoming 2022.12 release?

1 Like

I renived the binary_sensor for mqtt devices…
Sensor and Swithc worked fine for me.

Did y’all just make all your changes manually for each and every MQTT sensor? I have over a hundred so it’s gonna take me a while.

Hi,

I suggest to use your scripting skills and some combination of grep, sed, cut, awk or whatever might be helpful in this case.

Sorry, no other idea.

/KNEBB