Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
KC868-D16 home assistant configuration.yaml
#3
Actually, I am using the UID as I mentioned, but instead of it, I placed the XXXX symbol.

light:
- name: D16-1
unique_id: D16-1
schema: template
command_topic: "dimmer/41a2d806af7a99020d25f2ae12345/set"
state_topic: "dimmer/41a2d806af7a99020d25f2ae12345/state"
command_on_template: >
{%- if brightness is defined -%}
,{"dimmer1":{"value":{{(brightness / 255 * 100) | int - 1}}}
{%- else -%}
,'{"dimmer1":{"value":99}}'
{%- endif -%}

command_off_template: '{"dimmer1":{"value":0}}'

state_template: >
{%- if value_json.dimmer1.value == 0 -%}
off
{%- else -%}
on
{%- endif -%}
brightness_template: '{{(value_json.dimmer1.value / 99 * 255)| int}}'

- name: D16-2
unique_id: D16-2
schema: template
command_topic: "dimmer/41a2d806af7a99020d25f2ae12345/set"
state_topic: "dimmer/41a2d806af7a99020d25f2ae12345/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}}'
Reply


Messages In This Thread
RE: KC868-D16 home assistant configuration.yaml - by engmohades - 08-26-2023, 06:24 AM

Forum Jump:


Users browsing this thread:
1 Guest(s)