Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
home assistant RC 2022.6 mqtt config update for configuration.yaml
#1
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


Attached Files Image(s)
       

.txt   before.txt (Size: 354 bytes / Downloads: 258)
.txt   now-2-switches.txt (Size: 695 bytes / Downloads: 317)
.txt   now.txt (Size: 352 bytes / Downloads: 323)
Reply
#2
Please Let me know why mqtt config update like this? 

1. What is difference? before and after?

2. If not. It has any problem?

I have already updated V.4.44 and attached RC snubber. But Sometimes mqtt in KC868-h32b has no response until reboot.

Thank you.
Reply
#3
home assistant RC 2022.6 version need this, at 2022.9 version will stop use old mqtt format. details see: https://www.home-assistant.io/blog/2022/...ase-20226/
Reply
#4
(06-29-2022, 08:06 AM)heyheyhey Wrote: Please Let me know why mqtt config update like this? 

1. What is difference? before and after?

2. If not. It has any problem?

I have already updated V.4.44 and attached RC snubber. But Sometimes mqtt in KC868-h32b has no response until reboot.

Thank you.

maybe your home assistant have automatic updated new version?
Reply
#5
(06-29-2022, 11:43 AM)admin Wrote: home assistant RC 2022.6 version need this, at 2022.9 version will stop use old mqtt format. details see: https://www.home-assistant.io/blog/2022/...ase-20226/

Thanks for your very fast feedback! It was very helpful!
Reply
#6
you are welcome.
Reply
#7
Is there a change in binary_sensorsyntax?


binary_sensor:
- platform: mqtt
name: 'H32B-input1'
unique_id: H32B-input1
state_topic: 'relay32/3dfd899b71b9d0bbad4f5a9d12345/state'
value_template: '{{ value_json.input1.on }}'
payload_on: 1
payload_off: 0
Reply
#8
yes, also is changed syntax.
Reply
#9
(09-09-2022, 12:21 PM)admin Wrote: yes, also is changed syntax.

If like thses ? 

mqtt:
  binary_sensor:
  - name: 'H32B-input1'
    unique_id: H32B-input1
    state_topic: 'relay32/xxxxxxxxxxxxxxxxxxxxxx/state'
    value_template: '{{ value_json.input6.on }}'
    payload_on: 1
    payload_off: 0


Please review the formula in the attachment, and if there is an error, please correct it


Attached Files
.txt   config h32b mqtt .yaml.txt (Size: 12.01 KB / Downloads: 303)
Reply
#10
do you have tested output with new config file, work well?
now you only have problem with input mqtt syntax?
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)