09-20-2023, 05:43 PM
If I create a switch, it works ok,
switch:
- name: 'a16-kcs-output-1'
unique_id: a16-kcs-output-1
state_topic: 'KC868_A16/B0B21CCF0978/STATE'
command_topic: 'KC868_A16/B0B21CCF0978/SET'
payload_on: '{"output1":{"value":true}}'
payload_off: '{"output1":{"value":false}}'
value_template: '{{ value_json.output1.value }}'
state_on: true
state_off: false
But if I create a "light",
light:
- name: 'my_led'
unique_id: a16-kcs-output-led-wc-1
state_topic: 'KC868_A16/B0B21CCF0978/STATE'
command_topic: 'KC868_A16/B0B21CCF0978/SET'
payload_on: '{"output1":{"value":true}}'
payload_off: '{"output1":{"value":false}}'
state_value_template: '{{ value_json.output1.value }}'
the UI in home assistant showed "Unknown" status. [attachment=3105]
Please help!
switch:
- name: 'a16-kcs-output-1'
unique_id: a16-kcs-output-1
state_topic: 'KC868_A16/B0B21CCF0978/STATE'
command_topic: 'KC868_A16/B0B21CCF0978/SET'
payload_on: '{"output1":{"value":true}}'
payload_off: '{"output1":{"value":false}}'
value_template: '{{ value_json.output1.value }}'
state_on: true
state_off: false
But if I create a "light",
light:
- name: 'my_led'
unique_id: a16-kcs-output-led-wc-1
state_topic: 'KC868_A16/B0B21CCF0978/STATE'
command_topic: 'KC868_A16/B0B21CCF0978/SET'
payload_on: '{"output1":{"value":true}}'
payload_off: '{"output1":{"value":false}}'
state_value_template: '{{ value_json.output1.value }}'
the UI in home assistant showed "Unknown" status. [attachment=3105]
Please help!