After I upgraded to 2022.9, I saw notification to change mqtt switch and sensor config.
I followed up documentation examples, but after upgrade MQTT sensor and
switches have stopped working
After I’ve changed back to “OLD” configuration, switches and sensors came back.
Still using 2022.9
Here is example of old config:
##############OLD_MQTT_SWITCH_CONFIG###########
switch:
Here is example of “NEW” config: #NEW_MQTT_SWITCH_CONFIGURATION##################
mqtt:
switch:
- command_topic: “broker/ac4”
unique_id: lr_ac
name: “Lisa_Room_AC”
payload_on: “Y1”
payload_off: “OFF”
state_on: “ON”
state_off: “OFF”
I have found that when I use “NEW” config - MQTT messages just are not transmitted.
With “OLD” config I see messages go out with no issues.
I am running HA in Docker Containers
Please switch to the new style, as we have been warned about since 2022.6
eg:
mqtt:
sensor:
- name: "wx-Barometer"
state_topic: "weather/barometer_inHg"
unit_of_measurement: "inHg"
unique_id: wx0ec2f07076f0414e9124659bf8ca4f31 #since you might as well add unique id's while you are moving to the proper format
device_class: pressure
state_class: measurement
- name: next sensor etc
Hi , all,
I think I had some sort of formatting issue. I have re-formatted mqtt sensor config as in example above and all sensors came back online!
Thank you.
Hi
Also not able to setup the configuration.ymal to the new format. Missing example of how to use both MQTT switch and sensor in the configuration.ymal.
I got a error at the sensor
I ran into problem when changing my platform: mqtt over to new format, that even tho all idents and stuff was correct, my switch did not appear and also gave no errors and development tools checked yaml and was happy with everything.
Turned out, that i had mqtt defined lower for other things before (sensors) and making new mqtt: to root, did not produce any errors but just got ignored.
Moved my switched to previously defined mqtt root sector and all worked again.