06-22-2022, 01:00 AM
home assistant MQTT breaking changes RC 2022.6
before MQTT config format:
switch:
- platform: mqtt
name: 'relay11'
unique_id: relay11
state_topic: 'relay32/80f9caa4068e78059e31c622/state'
command_topic: 'relay32/80f9caa4068e78059e31c622/set'
payload_on: '{"relay1":{"on":1}}'
payload_off: '{"relay1":{"on":0}}'
value_template: '{{ value_json.relay1.on }}'
state_on: 1
state_off: 0
new MQTT config format:
mqtt:
switch:
- name: 'relay11'
unique_id: relay11
state_topic: 'relay32/80f9caa4068e78059e31c622/state'
command_topic: 'relay32/80f9caa4068e78059e31c622/set'
payload_on: '{"relay1":{"on":1}}'
payload_off: '{"relay1":{"on":0}}'
value_template: '{{ value_json.relay1.on }}'
state_on: 1
state_off: 0
new MQTT config for two switches format:
mqtt:
switch:
- name: 'relay11'
unique_id: relay11
state_topic: 'relay32/80f9caa4068e78059e31c622/state'
command_topic: 'relay32/80f9caa4068e78059e31c622/set'
payload_on: '{"relay1":{"on":1}}'
payload_off: '{"relay1":{"on":0}}'
value_template: '{{ value_json.relay1.on }}'
state_on: 1
state_off: 0
- name: 'relay22'
unique_id: relay22
state_topic: 'relay32/80f9caa4068e78059e31c622/state'
command_topic: 'relay32/80f9caa4068e78059e31c622/set'
payload_on: '{"relay2":{"on":1}}'
payload_off: '{"relay2":{"on":0}}'
value_template: '{{ value_json.relay2.on }}'
state_on: 1
state_off: 0
before MQTT config format:
switch:
- platform: mqtt
name: 'relay11'
unique_id: relay11
state_topic: 'relay32/80f9caa4068e78059e31c622/state'
command_topic: 'relay32/80f9caa4068e78059e31c622/set'
payload_on: '{"relay1":{"on":1}}'
payload_off: '{"relay1":{"on":0}}'
value_template: '{{ value_json.relay1.on }}'
state_on: 1
state_off: 0
new MQTT config format:
mqtt:
switch:
- name: 'relay11'
unique_id: relay11
state_topic: 'relay32/80f9caa4068e78059e31c622/state'
command_topic: 'relay32/80f9caa4068e78059e31c622/set'
payload_on: '{"relay1":{"on":1}}'
payload_off: '{"relay1":{"on":0}}'
value_template: '{{ value_json.relay1.on }}'
state_on: 1
state_off: 0
new MQTT config for two switches format:
mqtt:
switch:
- name: 'relay11'
unique_id: relay11
state_topic: 'relay32/80f9caa4068e78059e31c622/state'
command_topic: 'relay32/80f9caa4068e78059e31c622/set'
payload_on: '{"relay1":{"on":1}}'
payload_off: '{"relay1":{"on":0}}'
value_template: '{{ value_json.relay1.on }}'
state_on: 1
state_off: 0
- name: 'relay22'
unique_id: relay22
state_topic: 'relay32/80f9caa4068e78059e31c622/state'
command_topic: 'relay32/80f9caa4068e78059e31c622/set'
payload_on: '{"relay2":{"on":1}}'
payload_off: '{"relay2":{"on":0}}'
value_template: '{{ value_json.relay2.on }}'
state_on: 1
state_off: 0