Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
KC868-D8 home assistant configuration.yaml update
#1
follows support turn ON/OFF lamp by click "lamp" ico in home assistant.
   

light:
  - platform: mqtt
    name: dimmer1
    unique_id: dimmer1
    schema: template
    command_topic: "dimmer/xxxxxxxxxxxxxxxxxxxxxxxxxxxx/set"
    state_topic: "dimmer/xxxxxxxxxxxxxxxxxxxxxxxxxxxx/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}}'
Reply


Messages In This Thread
KC868-D8 home assistant configuration.yaml update - by admin - 11-17-2021, 01:12 AM

Forum Jump:


Users browsing this thread:
1 Guest(s)