Last active
July 31, 2024 17:56
-
-
Save MatzeKitt/078d090c8efce82ac85a99f732c1373c to your computer and use it in GitHub Desktop.
ZHA - Philips Hue Dimmer Switch (RWL020, RWL021) for FRITZ!Box
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
# source: https://community.home-assistant.io/t/zha-philips-hue-dimmer-switch-rwl021-the-fast-easy-way/461969 | |
# No device limitations | |
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 | |
multiple: false | |
entity: | |
domain: sensor | |
device_class: battery | |
zha_entity_light: | |
name: Light or a light group | |
description: Light or a light group to be controlled. | |
selector: | |
entity: | |
multiple: true | |
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