01-25-2024, 10:36 PM
switch:
- platform: mqtt
name: 'output-1'
unique_id: output-1
state_topic: 'server/xxxxxxxxxxxxxxxxxxxxxxxx/state'
command_topic: 'server/xxxxxxxxxxxxxxxxxxxxxxxx/set'
payload_on: '{"relay1":{"on":1}}'
payload_off: '{"relay1":{"on":0}}'
value_template: '{{ value_json.relay1.on }}'
state_on: 1
state_off: 0
compare with these code, your config code have some SPACE, you need to delete.
- platform: mqtt
name: 'output-1'
unique_id: output-1
state_topic: 'server/xxxxxxxxxxxxxxxxxxxxxxxx/state'
command_topic: 'server/xxxxxxxxxxxxxxxxxxxxxxxx/set'
payload_on: '{"relay1":{"on":1}}'
payload_off: '{"relay1":{"on":0}}'
value_template: '{{ value_json.relay1.on }}'
state_on: 1
state_off: 0
compare with these code, your config code have some SPACE, you need to delete.
YouTube: https://www.youtube.com/c/KinCony
Online Store: https://shop.kincony.com
Alibaba Store: https://kincony.en.alibaba.com/
Online Store: https://shop.kincony.com
Alibaba Store: https://kincony.en.alibaba.com/

