Last active
November 24, 2023 16:37
-
-
Save Rantaki/33c9e74821e08c4419539e7a8e46007c to your computer and use it in GitHub Desktop.
ZHA Blueprint for fast setup of Philips Hue Dimmer Switch (RWL021)
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: | |
domain: automation | |
name: Controlling lights using Philips Hue Dimmer Switch (RWL021) | |
description: Take the swith fast into use with pre-set configuration. | |
input: | |
zha_device: | |
name: Philips Hue Dimmer Switch (RWL021 only) | |
description: The swith to be taken into use. | |
selector: | |
device: | |
integration: zha | |
model: RWL021 | |
multiple: false | |
zha_entity_light: | |
name: Light or a light group | |
description: Light or a light group to be controlled. | |
selector: | |
entity: | |
multiple: true | |
integration: zha | |
domain: light | |
source_url: https://gist.github.com/Rantaki/33c9e74821e08c4419539e7a8e46007c | |
mode: queued | |
max_exceeded: silent | |
variables: | |
device_id: !input zha_device | |
trigger: | |
- platform: event | |
event_type: zha_event | |
condition: '{{ trigger.event.data.device_id == device_id }}' | |
action: | |
- variables: | |
command_type: '{{ trigger.event.data.command }}' | |
- service: logbook.log | |
data: | |
name: Device | |
message: '{{ device_id }}' | |
- service: logbook.log | |
data: | |
name: Command | |
message: '{{ command_type }}' | |
- service: logbook.log | |
data: | |
name: device_id | |
message: '{{ trigger.event.data.device_id }}' | |
- choose: | |
- conditions: '{{ command_type == "on_press" }}' | |
sequence: | |
- service: light.turn_on | |
data: | |
brightness_pct: 100 | |
transition: 0.3 | |
target: | |
entity_id: !input zha_entity_light | |
- conditions: '{{ command_type == "off_press" }}' | |
sequence: | |
- service: light.turn_off | |
target: | |
entity_id: !input zha_entity_light | |
data: | |
transition: 0.3 | |
- conditions: '{{ command_type == "down_hold" }}' | |
sequence: | |
- service: light.turn_on | |
data: | |
brightness_step_pct: -15 | |
transition: 0.4 | |
target: | |
entity_id: !input zha_entity_light | |
- conditions: '{{ command_type == "up_hold" }}' | |
sequence: | |
- service: light.turn_on | |
data: | |
brightness_step_pct: 15 | |
transition: 0.4 | |
target: | |
entity_id: !input zha_entity_light | |
- conditions: '{{ command_type == "up_short_release" }}' | |
sequence: | |
- service: light.turn_on | |
data: | |
brightness_pct: 70 | |
transition: 0.3 | |
target: | |
entity_id: !input zha_entity_light | |
- conditions: '{{ command_type == "down_short_release" }}' | |
sequence: | |
- service: light.turn_on | |
data: | |
brightness_pct: 40 | |
transition: 0.3 | |
target: | |
entity_id: !input zha_entity_light | |
- choose: | |
- conditions: '{{ command_type == "on_press" or command_type == "up_short_release" }}' | |
sequence: | |
- delay: 0.4 | |
- service: light.turn_on | |
data: | |
kelvin: 3400 | |
transition: 0.5 | |
target: | |
entity_id: !input zha_entity_light | |
- conditions: '{{ command_type == "down_short_release" }}' | |
sequence: | |
- delay: 0.4 | |
- service: light.turn_on | |
data: | |
kelvin: 2300 | |
transition: 0.5 | |
target: | |
entity_id: !input zha_entity_light |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment