Forked from Rantaki/zha_blueprint_philips_hue_dimmer_swith_rwl021_fast_setup.yaml
Last active
September 22, 2023 19:53
-
-
Save hobbe/ddce499e3271a236f5ac2fddb5786349 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. | |
source_url: https://gist.github.com/hobbe/ddce499e3271a236f5ac2fddb5786349 | |
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 | |
domain: light | |
mode: single | |
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 }}' | |
step_mode: '{{ trigger.event.data.params.step_mode }}' | |
- service: logbook.log | |
data: | |
name: Device | |
message: '{{ device_id }}' | |
- service: logbook.log | |
data: | |
name: Command | |
message: '{{ command_type }}' | |
- service: logbook.log | |
data: | |
name: StepMode | |
message: '{{ step_mode }}' | |
- choose: | |
- conditions: '{{ command_type == "on_press" }}' | |
sequence: | |
- service: light.turn_on | |
data: | |
brightness_pct: 100 | |
kelvin: 3400 | |
target: | |
entity_id: !input zha_entity_light | |
- conditions: '{{ command_type == "up_short_release" }}' | |
sequence: | |
- service: light.turn_on | |
data: | |
brightness_pct: 70 | |
kelvin: 3400 | |
target: | |
entity_id: !input zha_entity_light | |
- conditions: '{{ command_type == "step" and step_mode == "StepMode.Up" }}' | |
sequence: | |
- service: light.turn_on | |
data: | |
brightness_step_pct: 15 | |
transition: 0.5 | |
target: | |
entity_id: !input zha_entity_light | |
- conditions: '{{ command_type == "step" and step_mode == "StepMode.Down" }}' | |
sequence: | |
- service: light.turn_on | |
data: | |
brightness_step_pct: -15 | |
transition: 0.5 | |
target: | |
entity_id: !input zha_entity_light | |
- conditions: '{{ command_type == "down_short_release" }}' | |
sequence: | |
- service: light.turn_on | |
data: | |
brightness_pct: 20 | |
kelvin: 2300 | |
target: | |
entity_id: !input zha_entity_light | |
- conditions: '{{ command_type == "off_press" }}' | |
sequence: | |
- service: light.turn_off | |
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