Last active
May 31, 2022 01:58
-
-
Save S-Collison/3ad8c20e1e8346af3083de3ab5bf2fcd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Blueprint metadata | |
| blueprint: | |
| name: Hook - Light | |
| description: | | |
| # Hook - Light | |
| Hook automation which allows to control a light. Supports brightness and color control both for white temperature and rgb lights. Features may vary depending on the selected Controller. | |
| An automation created with this blueprint must be linked to a [Controller](https://epmatt.github.io/awesome-ha-blueprints/blueprints/controllers) automation. | |
| Controllers are blueprints which allow to easily integrate a wide range of controllers (wall switches, remotes, dimmers, etc.) and use them to run a set of actions when interacting with them. | |
| They expose an abstract interface used by Hooks to create controller-based automations. | |
| A list of controllers supported by this hook is available [here](https://epmatt.github.io/awesome-ha-blueprints/docs/blueprints/hooks/light#supported-controllers). | |
| 📕 Full documentation regarding this blueprint is available [here](https://epmatt.github.io/awesome-ha-blueprints/docs/blueprints/hooks/light). | |
| 🚀 This blueprint is part of the **[Awesome HA Blueprints](https://epmatt.github.io/awesome-ha-blueprints) project**. | |
| ℹ️ Version 2021.12.05 | |
| source_url: https://github.com/EPMatt/awesome-ha-blueprints/blob/main/blueprints/hooks/light/light.yaml | |
| domain: automation | |
| input: | |
| controller_device: | |
| name: (Required) Controller Device | |
| description: The controller device which will control the Light. Choose a value only if the integration used to connect the controller to Home Assistant exposes it as a Device. This value should match the one specified in the corresponding Controller automation. | |
| default: '' | |
| selector: | |
| device: | |
| controller_entity: | |
| name: (Required) Controller Entity | |
| description: The controller entity which will control the Light. Choose a value only if the integration used to connect the controller to Home Assistant exposes it as an Entity. This value should match the one specified in the corresponding Controller automation. | |
| default: '' | |
| selector: | |
| entity: | |
| domain: sensor | |
| controller_model: | |
| name: (Required) Controller model | |
| description: The model for the controller used in this automation. Choose a value from the list of supported controllers. | |
| selector: | |
| select: | |
| options: | |
| - IKEA E1524/E1810 TRÅDFRI Wireless 5-Button Remote | |
| - IKEA E1743 TRÅDFRI On/Off Switch & Dimmer | |
| - IKEA E1743 TRÅDFRI On/Off Switch & Dimmer (#2) | |
| - IKEA E1744 SYMFONISK Rotary Remote | |
| - IKEA E1766 TRÅDFRI Open/Close Remote | |
| - IKEA E1766 TRÅDFRI Open/Close Remote (#2) | |
| - IKEA E1812 TRÅDFRI Shortcut button | |
| - IKEA E2001/E2002 STYRBAR Remote control | |
| - IKEA E2001/E2002 STYRBAR Remote control (#2) | |
| - IKEA ICTC-G-1 TRÅDFRI wireless dimmer | |
| - OSRAM AC025XX00NJ SMART+ Switch Mini | |
| - Philips 324131092621 Hue Dimmer switch | |
| - Philips 8718699693985 Hue Smart Button | |
| - Philips 929002398602 Hue Dimmer switch v2 | |
| - Xiaomi WXCJKG11LM Aqara Opple 2 button remote | |
| - Xiaomi WXCJKG12LM Aqara Opple 4 button remote | |
| - Xiaomi WXCJKG12LM Aqara Opple 4 button remote (#2) | |
| - Xiaomi WXCJKG13LM Aqara Opple 6 button remote | |
| - Xiaomi WXCJKG13LM Aqara Opple 6 button remote (#2) | |
| - Xiaomi WXCJKG13LM Aqara Opple 6 button remote (#3) | |
| light: | |
| name: (Required) Light | |
| description: Light which will be controlled with this automation. | |
| selector: | |
| target: | |
| entity: | |
| domain: light | |
| light_color_mode: | |
| name: (Optional) Light color mode | |
| description: Specify how the controller will set the light color. Choose "Color Temperature" and "Hue - Saturation" depending on the features supported by your light. If you are not sure you can select "Auto". "None" will disable color control features. | |
| default: Auto | |
| selector: | |
| select: | |
| options: | |
| - Auto | |
| - Color Temperature | |
| - Hue - Saturation | |
| - None | |
| light_transition: | |
| name: (Optional) Light Transition | |
| description: Number that represents the time (in milliseconds) the light should take turn on or off, if the light supports it. | |
| default: 250 | |
| selector: | |
| number: | |
| min: 0 | |
| max: 60000 | |
| step: 1 | |
| unit_of_measurement: milliseconds | |
| mode: box | |
| min_brightness: | |
| name: (Optional) Light minimum brightness | |
| description: The minimum brightness the light can be set with this automation. | |
| default: 1 | |
| selector: | |
| number: | |
| min: 1 | |
| max: 255 | |
| step: 1 | |
| unit_of_measurement: brightness | |
| mode: slider | |
| max_brightness: | |
| name: (Optional) Light maximum brightness | |
| description: The maximum brightness the light can be set with this automation. | |
| default: 255 | |
| selector: | |
| number: | |
| min: 0 | |
| max: 255 | |
| step: 1 | |
| unit_of_measurement: brightness | |
| mode: slider | |
| brightness_steps_short: | |
| name: (Optional) Light brightness steps - short actions | |
| description: Number of steps from min to max brightness when controlling brightness with short actions (eg. button press). | |
| default: 10 | |
| selector: | |
| number: | |
| min: 1 | |
| max: 255 | |
| step: 1 | |
| unit_of_measurement: steps | |
| mode: box | |
| brightness_steps_long: | |
| name: (Optional) Light brightness steps - long actions | |
| description: Number of steps from min to max brightness when controlling brightness with long actions (eg. button hold or controller rotation). | |
| default: 10 | |
| selector: | |
| number: | |
| min: 1 | |
| max: 255 | |
| step: 1 | |
| unit_of_measurement: steps | |
| mode: box | |
| force_brightness: | |
| name: (Optional) Force brightness value at turn on | |
| description: Force brightness to the "On brightness" input value, when the light is being turned on. | |
| default: false | |
| selector: | |
| boolean: | |
| on_brightness: | |
| name: (Optional) On brightness | |
| description: Brightness value to force when turning on the light | |
| default: 1 | |
| selector: | |
| number: | |
| min: 0 | |
| max: 255 | |
| step: 1 | |
| unit_of_measurement: brightness | |
| mode: slider | |
| smooth_power_on: | |
| name: (Optional) Smooth power on | |
| description: Force the light to turn on at minimum brightness when a brightness up command (single or continuous) is triggered and light is off. | |
| default: true | |
| selector: | |
| boolean: | |
| smooth_power_off: | |
| name: (Optional) Smooth power off | |
| description: Allow a brightness down command (single or continuous) to turn off the light when at minimum brightness. Disabling this will prevent the light from being turned off by brightness down commands. | |
| default: true | |
| selector: | |
| boolean: | |
| # Automation schema | |
| variables: | |
| # convert blueprint inputs into variables to be used in templates | |
| controller_model: !input controller_model | |
| # supported controllers and mappings | |
| controller_mapping: | |
| IKEA E1524/E1810 TRÅDFRI Wireless 5-Button Remote: | |
| brightness_up: button_up_short | |
| brightness_up_repeat: button_up_long | |
| brightness_down: button_down_short | |
| brightness_down_repeat: button_down_long | |
| color_down: button_left_short | |
| color_down_repeat: button_left_long | |
| color_up: button_right_short | |
| color_up_repeat: button_right_long | |
| toggle: button_center_short | |
| IKEA E1743 TRÅDFRI On/Off Switch & Dimmer: | |
| turn_on: button_up_short | |
| brightness_up_repeat: button_up_long | |
| color_up: button_up_double | |
| turn_off: button_down_short | |
| brightness_down_repeat: button_down_long | |
| color_down: button_down_double | |
| IKEA E1743 TRÅDFRI On/Off Switch & Dimmer (#2): | |
| brightness_up: button_up_short | |
| brightness_up_repeat: button_up_long | |
| turn_on: button_up_double | |
| brightness_down: button_down_short | |
| brightness_down_repeat: button_down_long | |
| turn_off: button_down_double | |
| IKEA E1744 SYMFONISK Rotary Remote: | |
| brightness_down_repeat: rotate_left | |
| brightness_up_repeat: rotate_right | |
| toggle: click_short | |
| color_up: click_double | |
| color_down: click_triple | |
| IKEA E1766 TRÅDFRI Open/Close Remote: | |
| brightness_up: button_up_short | |
| turn_on: button_up_double | |
| brightness_down: button_down_short | |
| turn_off: button_down_double | |
| IKEA E1766 TRÅDFRI Open/Close Remote (#2): | |
| brightness_up: button_up_short | |
| color_up: button_up_double | |
| brightness_down: button_down_short | |
| color_down: button_down_double | |
| IKEA E1812 TRÅDFRI Shortcut button: | |
| toggle: button_short | |
| color_up: button_double | |
| IKEA E2001/E2002 STYRBAR Remote control: | |
| turn_on: button_up_short | |
| brightness_up_repeat: button_up_long | |
| turn_off: button_down_short | |
| brightness_down_repeat: button_down_long | |
| color_down: button_left_short | |
| color_down_repeat: button_left_long | |
| color_up: button_right_short | |
| color_up_repeat: button_right_long | |
| IKEA E2001/E2002 STYRBAR Remote control (#2): | |
| brightness_up: button_up_short | |
| brightness_up_repeat: button_up_long | |
| turn_on: button_up_double | |
| brightness_down: button_down_short | |
| brightness_down_repeat: button_down_long | |
| turn_off: button_down_double | |
| color_down: button_left_short | |
| color_down_repeat: button_left_long | |
| color_up: button_right_short | |
| color_up_repeat: button_right_long | |
| IKEA ICTC-G-1 TRÅDFRI wireless dimmer: | |
| brightness_down_repeat: rotate_left | |
| brightness_up_repeat: rotate_right | |
| OSRAM AC025XX00NJ SMART+ Switch Mini: | |
| brightness_up: button_up_short | |
| brightness_up_repeat: button_up_long | |
| color_up: button_up_double | |
| brightness_down: button_down_short | |
| brightness_down_repeat: button_down_long | |
| color_down: button_down_double | |
| toggle: button_center_short | |
| Philips 324131092621 Hue Dimmer switch: | |
| turn_on: button_on_short | |
| color_up_repeat: button_on_long | |
| turn_off: button_off_short | |
| color_down_repeat: button_off_long | |
| brightness_up: button_up_short | |
| brightness_up_repeat: button_up_long | |
| brightness_down: button_down_short | |
| brightness_down_repeat: button_down_long | |
| Philips 8718699693985 Hue Smart Button: | |
| toggle: button_short | |
| Philips 929002398602 Hue Dimmer switch v2: | |
| turn_on: button_on_short | |
| color_up_repeat: button_on_long | |
| turn_off: button_off_short | |
| color_down_repeat: button_off_long | |
| brightness_up: button_up_short | |
| brightness_up_repeat: button_up_long | |
| brightness_down: button_down_short | |
| brightness_down_repeat: button_down_long | |
| Xiaomi WXCJKG11LM Aqara Opple 2 button remote: | |
| turn_on: button_1_short | |
| brightness_up_repeat: button_1_long | |
| color_up: button_1_double | |
| turn_off: button_2_short | |
| brightness_down_repeat: button_2_long | |
| color_down: button_2_double | |
| Xiaomi WXCJKG12LM Aqara Opple 4 button remote: | |
| turn_on: button_1_short | |
| brightness_up_repeat: button_1_long | |
| color_up: button_1_double | |
| turn_off: button_2_short | |
| brightness_down_repeat: button_2_long | |
| color_down: button_2_double | |
| Xiaomi WXCJKG12LM Aqara Opple 4 button remote (#2): | |
| turn_on: button_3_short | |
| brightness_up_repeat: button_3_long | |
| color_up: button_3_double | |
| turn_off: button_4_short | |
| brightness_down_repeat: button_4_long | |
| color_down: button_4_double | |
| Xiaomi WXCJKG13LM Aqara Opple 6 button remote: | |
| turn_on: button_1_short | |
| brightness_up_repeat: button_1_long | |
| color_up: button_1_double | |
| turn_off: button_2_short | |
| brightness_down_repeat: button_2_long | |
| color_down: button_2_double | |
| Xiaomi WXCJKG13LM Aqara Opple 6 button remote (#2): | |
| turn_on: button_3_short | |
| brightness_up_repeat: button_3_long | |
| color_up: button_3_double | |
| turn_off: button_4_short | |
| brightness_down_repeat: button_4_long | |
| color_down: button_4_double | |
| Xiaomi WXCJKG13LM Aqara Opple 6 button remote (#3): | |
| turn_on: button_5_short | |
| brightness_up_repeat: button_5_long | |
| color_up: button_5_double | |
| turn_off: button_6_short | |
| brightness_down_repeat: button_6_long | |
| color_down: button_6_double | |
| # pre-choose actions for buttons based on configured controller | |
| # no need to perform this task at automation runtime | |
| brightness_up: '{{ controller_mapping[controller_model]["brightness_up"] | default(None) }}' | |
| brightness_up_repeat: '{{ controller_mapping[controller_model]["brightness_up_repeat"] | default(None) }}' | |
| brightness_down: '{{ controller_mapping[controller_model]["brightness_down"] | default(None) }}' | |
| brightness_down_repeat: '{{ controller_mapping[controller_model]["brightness_down_repeat"] | default(None) }}' | |
| color_up: '{{ controller_mapping[controller_model]["color_up"] | default(None) }}' | |
| color_up_repeat: '{{ controller_mapping[controller_model]["color_up_repeat"] | default(None) }}' | |
| color_down: '{{ controller_mapping[controller_model]["color_down"] | default(None) }}' | |
| color_down_repeat: '{{ controller_mapping[controller_model]["color_down_repeat"] | default(None) }}' | |
| toggle: '{{ controller_mapping[controller_model]["toggle"] | default(None) }}' | |
| turn_on: '{{ controller_mapping[controller_model]["turn_on"] | default(None) }}' | |
| turn_off: '{{ controller_mapping[controller_model]["turn_off"] | default(None) }}' | |
| light_color_mode: !input light_color_mode | |
| light: !input light | |
| light_transition: !input light_transition | |
| min_brightness: !input min_brightness | |
| max_brightness: !input max_brightness | |
| brightness_steps_short: !input brightness_steps_short | |
| brightness_steps_long: !input brightness_steps_long | |
| force_brightness: !input force_brightness | |
| on_brightness: !input on_brightness | |
| smooth_power_on: !input smooth_power_on | |
| smooth_power_off: !input smooth_power_off | |
| color_modes: | |
| Auto: auto | |
| Color Temperature: color_temp | |
| Hue - Saturation: hs_color | |
| None: none | |
| # extract light color mode id | |
| light_color_mode_id: >- | |
| {%- if light_color_mode == "Auto" -%} {% set supported_color_modes = state_attr(light, "supported_color_modes") -%} {%- if "hs" in supported_color_modes or "xy" in supported_color_modes or "rgbw" in supported_color_modes or "rgbww" in supported_color_modes -%} {{ | |
| color_modes["Hue - Saturation"] }} {%- elif "color_temp" in supported_color_modes -%} {{ color_modes["Color Temperature"] }} {%- else -%} {{ color_modes["None"] }} {%- endif -%} {%- else -%} {{ color_modes[light_color_mode] }} {%- endif -%} | |
| step_short: '{{ (max_brightness-min_brightness)/brightness_steps_short }}' | |
| step_long: '{{ (max_brightness-min_brightness)/brightness_steps_long }}' | |
| mode: restart | |
| max_exceeded: silent | |
| trigger: | |
| - platform: event | |
| event_type: ahb_controller_event | |
| event_data: | |
| controller: !input controller_device | |
| - platform: event | |
| event_type: ahb_controller_event | |
| event_data: | |
| controller: !input controller_entity | |
| condition: [] | |
| action: | |
| - variables: | |
| action: '{{ trigger.event.data.action }}' | |
| - choose: | |
| - conditions: '{{ action == toggle }}' | |
| sequence: | |
| - choose: | |
| - conditions: '{{ force_brightness }}' | |
| sequence: | |
| - service: light.toggle | |
| entity_id: !input light | |
| data: | |
| brightness: !input on_brightness | |
| transition: '{{ light_transition / 1000 }}' | |
| default: | |
| - service: light.toggle | |
| entity_id: !input light | |
| data: | |
| transition: '{{ light_transition / 1000 }}' | |
| - conditions: '{{ action == turn_on }}' | |
| sequence: | |
| - choose: | |
| - conditions: '{{ force_brightness }}' | |
| sequence: | |
| - service: light.turn_on | |
| entity_id: !input light | |
| data: | |
| brightness: !input on_brightness | |
| transition: '{{ light_transition / 1000 }}' | |
| default: | |
| - service: light.turn_on | |
| entity_id: !input light | |
| data: | |
| transition: '{{ light_transition / 1000 }}' | |
| - conditions: '{{ action == turn_off }}' | |
| sequence: | |
| - service: light.turn_off | |
| entity_id: !input light | |
| data: | |
| transition: '{{ light_transition / 1000 }}' | |
| - conditions: '{{ action == brightness_up }}' | |
| sequence: | |
| - choose: | |
| # if light is off and smooth power on is disabled, turn it on at the previously saved brightness | |
| - conditions: '{{ states(light) == "off" and not smooth_power_on}}' | |
| sequence: | |
| - service: light.turn_on | |
| data: | |
| transition: '{{ light_transition / 1000 }}' | |
| entity_id: !input light | |
| # if light is off and smooth power on is enabled, turn it on at minimum brightness | |
| - conditions: '{{ states(light) == "off" and smooth_power_on}}' | |
| sequence: | |
| - service: light.turn_on | |
| data: | |
| brightness: '{{ min_brightness }}' | |
| transition: '{{ light_transition / 1000 }}' | |
| entity_id: !input light | |
| # else the light is on, hence increase its brightness | |
| default: | |
| - service: light.turn_on | |
| data: | |
| brightness: '{{ [ [state_attr(light,"brightness")+step_short, min_brightness] | max, max_brightness] | min }}' | |
| transition: 0.25 | |
| entity_id: !input light | |
| - conditions: '{{ action == brightness_down and states(light) == "on" }}' | |
| sequence: | |
| - choose: | |
| - conditions: '{{ smooth_power_off and state_attr(light,"brightness") == min_brightness }}' | |
| sequence: | |
| - service: light.turn_off | |
| data: | |
| transition: '{{ light_transition / 1000 }}' | |
| entity_id: !input light | |
| default: | |
| - service: light.turn_on | |
| data: | |
| brightness: '{{ [ [state_attr(light,"brightness")-step_short, min_brightness] | max, max_brightness] | min }}' | |
| transition: 0.25 | |
| entity_id: !input light | |
| - conditions: '{{ action == brightness_up_repeat }}' | |
| sequence: | |
| # first step for the smooth power on feature: subsequent steps can skip this check since light will be already on | |
| - choose: | |
| # if light is off and smooth power on is disabled, turn it on at the previously saved brightness | |
| - conditions: '{{ states(light) == "off" and not smooth_power_on}}' | |
| sequence: | |
| - service: light.turn_on | |
| data: | |
| transition: '{{ light_transition / 1000 }}' | |
| entity_id: !input light | |
| - delay: | |
| milliseconds: !input light_transition | |
| # if light is off and smooth power on is enabled, turn it on at minimum brightness | |
| - conditions: '{{ states(light) == "off" and smooth_power_on}}' | |
| sequence: | |
| - service: light.turn_on | |
| data: | |
| brightness: '{{ min_brightness }}' | |
| transition: '{{ light_transition / 1000 }}' | |
| entity_id: !input light | |
| - delay: | |
| milliseconds: !input light_transition | |
| # else move on to the loop for increasing the light brightness | |
| - repeat: | |
| while: '{{ true }}' | |
| sequence: | |
| - service: light.turn_on | |
| data: | |
| brightness: '{{ [ [state_attr(light,"brightness")+step_long, min_brightness] | max, max_brightness] | min }}' | |
| transition: 0.25 | |
| entity_id: !input light | |
| - delay: | |
| milliseconds: 250 | |
| - conditions: '{{ action == brightness_down_repeat and states(light) == "on" }}' | |
| sequence: | |
| - choose: | |
| # using a separate sequence for the smooth power off feature to not perform unnecessary checks at every iteration when the feature is disabled | |
| - conditions: '{{ smooth_power_off }}' | |
| sequence: | |
| - repeat: | |
| # continue lowering brightness until the light turns off | |
| while: '{{ states(light) != "off" }}' | |
| sequence: | |
| - choose: | |
| # if the light is at minimum brightness, turn it off | |
| - conditions: '{{ state_attr(light,"brightness") == min_brightness }}' | |
| sequence: | |
| - service: light.turn_off | |
| data: | |
| transition: '{{ light_transition / 1000 }}' | |
| entity_id: !input light | |
| - delay: | |
| milliseconds: !input light_transition | |
| # else lower the light's brightness | |
| default: | |
| - service: light.turn_on | |
| data: | |
| brightness: '{{ [ [state_attr(light,"brightness")-step_long, min_brightness] | max, max_brightness] | min }}' | |
| transition: 0.25 | |
| entity_id: !input light | |
| - delay: | |
| milliseconds: 250 | |
| default: | |
| - repeat: | |
| # continue lowering brightness until the light turns off | |
| while: '{{ states(light) != "off" }}' | |
| sequence: | |
| # lower the light's brightness. since smooth power off is disabled, never let the brightness move below the user-provided minimum | |
| - service: light.turn_on | |
| data: | |
| brightness: '{{ [ [state_attr(light,"brightness")-step_long, min_brightness] | max, max_brightness] | min }}' | |
| transition: 0.25 | |
| entity_id: !input light | |
| - delay: | |
| milliseconds: 250 | |
| - conditions: '{{ action == color_up and light_color_mode_id != "none" }}' | |
| sequence: | |
| choose: | |
| - conditions: '{{ light_color_mode_id == "color_temp" }}' | |
| sequence: | |
| - service: light.turn_on | |
| data: | |
| color_temp: '{{ state_attr(light,"color_temp")|int + 50 }}' | |
| transition: 0.25 | |
| entity_id: !input light | |
| - conditions: '{{ light_color_mode_id == "hs_color" }}' | |
| sequence: | |
| - service: light.turn_on | |
| data: | |
| hs_color: '{{ [((state_attr(light,"hs_color")[0] or 0) + 15) % 360, 100] }}' | |
| transition: 0.25 | |
| entity_id: !input light | |
| - conditions: '{{ action == color_down and light_color_mode_id != "none" }}' | |
| sequence: | |
| choose: | |
| - conditions: '{{ light_color_mode_id == "color_temp" }}' | |
| sequence: | |
| - service: light.turn_on | |
| data: | |
| color_temp: '{{ [state_attr(light,"color_temp")|int - 50, 1]|max }}' | |
| transition: 0.25 | |
| entity_id: !input light | |
| - conditions: '{{ light_color_mode_id == "hs_color" }}' | |
| sequence: | |
| - service: light.turn_on | |
| data: | |
| hs_color: '{{ [((state_attr(light,"hs_color")[0] or 0) - 15) % 360, 100] }}' | |
| transition: 0.25 | |
| entity_id: !input light | |
| - conditions: '{{ action == color_up_repeat and light_color_mode_id != "none" }}' | |
| sequence: | |
| choose: | |
| - conditions: '{{ light_color_mode_id == "color_temp" }}' | |
| sequence: | |
| - repeat: | |
| while: '{{ true }}' | |
| sequence: | |
| - service: light.turn_on | |
| data: | |
| color_temp: '{{ state_attr(light,"color_temp")|int + 50 }}' | |
| transition: 0.25 | |
| entity_id: !input light | |
| - delay: | |
| milliseconds: 250 | |
| - conditions: '{{ light_color_mode_id == "hs_color" }}' | |
| sequence: | |
| - repeat: | |
| while: '{{ true }}' | |
| sequence: | |
| - service: light.turn_on | |
| data: | |
| hs_color: '{{ [((state_attr(light,"hs_color")[0] or 0) + 15) % 360, 100] }}' | |
| transition: 0.25 | |
| entity_id: !input light | |
| - delay: | |
| milliseconds: 250 | |
| - conditions: '{{ action == color_down_repeat and light_color_mode_id != "none" }}' | |
| sequence: | |
| choose: | |
| - conditions: '{{ light_color_mode_id == "color_temp" }}' | |
| sequence: | |
| - repeat: | |
| while: '{{ true }}' | |
| sequence: | |
| - service: light.turn_on | |
| data: | |
| color_temp: '{{ [state_attr(light,"color_temp")|int - 50, 1]|max }}' | |
| transition: 0.25 | |
| entity_id: !input light | |
| - delay: | |
| milliseconds: 250 | |
| - conditions: '{{ light_color_mode_id == "hs_color" }}' | |
| sequence: | |
| - repeat: | |
| while: '{{ true }}' | |
| sequence: | |
| - service: light.turn_on | |
| data: | |
| hs_color: '{{ [((state_attr(light,"hs_color")[0] or 0) - 15) % 360, 100] }}' | |
| transition: 0.25 | |
| entity_id: !input light | |
| - delay: | |
| milliseconds: 250 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment