09-01-2024, 06:21 AM
(08-13-2024, 05:48 AM)admin Wrote: here is ADR KCS firmware:
Hi, do you have a newer firmware ? this is not working well in mqtt,
when is connected, in the mqttExplorer the sent values are
{"input1":{"value":false},"input2":{"value":false},"adc1":{"value":0}"dimmer1":{"value":1}}
but after i set up the dimming function in yaml file, the dimmer 1 is automatically changing to : " dimmer2" after the config yaml corection the switch and the dimming is not working, just showed in Home Assistant. is also connected in Tuya, there is pretty functional
this is my light mqtt code
#KC868-ADR1
- name: ADR1
unique_id: ADR1
schema: template
command_topic: "ADR/A0A3B3FE45D0/SET"
state_topic: "ADR/A0A3B3FE45D0/STATE"
command_on_template: >
{%- if brightness is defined -%}
,{"dimmer2":{"value":{{(brightness / 255 * 100) | int - 1}}}
{%- else -%}
,'{"dimmer2":{"value":99}}'
{%- endif -%}
command_off_template: '{"dimmer2":{"value":0}}'
state_template: >
{%- if value_json.dimmer2.value == 0 -%}
off
{%- else -%}
on
{%- endif -%}
brightness_template: '{{(value_json.dimmer2.value / 99 * 255)| int}}'
binary_sensors:
#KC868-ADR1
- name: 'KC868_ADR1-input-1'
unique_id: KC868_ADR1-input-1
state_topic: 'ADR/A0A3B3FE45D0/STATE'
value_template: '{{ value_json.input1.value }}'
payload_on: true
payload_off: false
- name: 'KC868_ADR1-input-2'
unique_id: KC868_ADR1-input-2
state_topic: 'ADR/A0A3B3FE45D0/STATE'
value_template: '{{ value_json.input2.value }}'
payload_on: true
payload_off: false
sensors:
#KC868-ADR1
- name: 'KC868_ADR1-1'
unique_id: KC868_ADR1-1
state_topic: 'ADR/A0A3B3FE45D0/STATE'
unit_of_measurement: '%'
value_template: '{{ value_json.adc1.value }}'
#payload_on: true
#payload_off: false
but unfortunately not working