Trying to get ahead of the MQTT YAML syntax change in the 2022.6 update, but can’t get it right without throwing a ton of errors. Can anyone help?
My working config section that doesn’t conform to the new format:
sensor:
- platform: mqtt
state_topic: "rtl_433/226d4b83cd4b/devices/LaCrosse-TX141THBv2/0/63/temperature_C"
device_class: temperature
unique_id: LaCrosse_temp
name: outside_temp
unit_of_measurement: '°C'
- platform: mqtt
state_topic: "rtl_433/226d4b83cd4b/devices/LaCrosse-TX141THBv2/0/63/humidity"
device_class: humidity
unique_id: LaCrosse_humidity
name: outside_humidity
unit_of_measurement: '%'
#Sensor for dead Z-WaveJS nodes
- platform: template
sensors:
failed_zwave:
value_template: >
{{ states | selectattr("entity_id", "search", "node_status") |
selectattr('state', 'in', 'dead, unavailable, unknown') |
map(attribute='entity_id') | list }}
binary_sensor:
- platform: mqtt
name: "BlueIris Doorbell Motion"
state_topic: BlueIris/MotionAlarm/doorbell
payload_on: "1"
payload_off: "0"
device_class: motion
- platform: mqtt
name: "BlueIris Driveway Motion"
state_topic: BlueIris/MotionAlarm/driveway
payload_on: "1"
payload_off: "0"
device_class: motion
- platform: mqtt
name: "BlueIris Backyard Motion"
state_topic: BlueIris/MotionAlarm/backyard
payload_on: "1"
payload_off: "0"
device_class: motion
- platform: mqtt
name: "BlueIris North Gate Motion"
state_topic: BlueIris/MotionAlarm/northgate
payload_on: "1"
payload_off: "0"
device_class: motion
- platform: mqtt
name: "BlueIris Back Patio Motion"
state_topic: BlueIris/MotionAlarm/backpatio
payload_on: "1"
payload_off: "0"
device_class: motion
- platform: mqtt
name: "BlueIris Shop Motion"
state_topic: BlueIris/MotionAlarm/shop
payload_on: "1"
payload_off: "0"
device_class: motion
My hacked up attempt that I can’t get working (I’m stuck on the -platform: template sensor section, and the binary_sensor section, specifically I think.
mqtt:
- sensor:
state_topic: "rtl_433/226d4b83cd4b/devices/LaCrosse-TX141THBv2/0/63/temperature_C"
device_class: temperature
unique_id: LaCrosse_temp
name: outside_temp
unit_of_measurement: '°C'
- sensor:
state_topic: "rtl_433/226d4b83cd4b/devices/LaCrosse-TX141THBv2/0/63/humidity"
device_class: humidity
unique_id: LaCrosse_humidity
name: outside_humidity
unit_of_measurement: '%'
binary_sensor:
- platform: mqtt
name: "BlueIris Doorbell Motion"
state_topic: BlueIris/MotionAlarm/doorbell
payload_on: "1"
payload_off: "0"
device_class: motion
- platform: mqtt
name: "BlueIris Driveway Motion"
state_topic: BlueIris/MotionAlarm/driveway
payload_on: "1"
payload_off: "0"
device_class: motion
- platform: mqtt
name: "BlueIris Backyard Motion"
state_topic: BlueIris/MotionAlarm/backyard
payload_on: "1"
payload_off: "0"
device_class: motion
- platform: mqtt
name: "BlueIris North Gate Motion"
state_topic: BlueIris/MotionAlarm/northgate
payload_on: "1"
payload_off: "0"
device_class: motion
- platform: mqtt
name: "BlueIris Back Patio Motion"
state_topic: BlueIris/MotionAlarm/backpatio
payload_on: "1"
payload_off: "0"
device_class: motion
- platform: mqtt
name: "BlueIris Shop Motion"
state_topic: BlueIris/MotionAlarm/shop
payload_on: "1"
payload_off: "0"
device_class: motion
#Sensor for dead Z-WaveJS nodes
- platform: template
sensors:
failed_zwave:
value_template: >
{{ states | selectattr("entity_id", "search", "node_status") |
selectattr('state', 'in', 'dead, unavailable, unknown') |
map(attribute='entity_id') | list }}