Created
September 17, 2022 20:42
-
-
Save benoitc/5d2f5fb8f2fa815f3179b38cfbfbb6e5 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: | |
domain: automation | |
name: Controlling lights using Philips Hue Dimmer Switch (RWL022) | |
description: Take the swith fast into use with pre-set configuration. | |
input: | |
zha_device: | |
name: Philips Hue Dimmer Switch (RWL022 only) | |
description: The swith to be taken into use. | |
selector: | |
device: | |
integration: zha | |
model: RWL022 | |
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 | |
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