-
-
Save eliroca/31640ac244baed0b8239ee84c9465f8e to your computer and use it in GitHub Desktop.
ZHA - Philips Hue Dimmer V2 Dual
This file contains 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: | |
name: ZHA - Philips Hue Dimmer V2 Dual | |
description: | |
"Control two lights with a Philips Hue Dimmer V2 (RWL022)" | |
domain: automation | |
input: | |
remote: | |
name: Philips Hue Dimmer | |
description: Pick a V2 Dimmer (RWL022) | |
selector: | |
device: | |
integration: zha | |
entity: | |
domain: sensor | |
device_class: battery | |
power_light: | |
name: The main light entity to control. | |
description: The light entity which the top button will control. (Power button). | |
selector: | |
entity: | |
domain: light | |
hue_light: | |
name: The secondary light entity to control. | |
description: The light entity which the bottom button will control. (hue button). | |
selector: | |
entity: | |
domain: light | |
brightness_steps: | |
name: Percentage to increase or decrease brightness. | |
description: The percentage to increase or decrease brightness when the button is pressed or hold. | |
selector: | |
number: | |
min: 1 | |
max: 25 | |
unit_of_measurement: "%" | |
source_url: https://gist.github.com/eliroca/31640ac244baed0b8239ee84c9465f8e | |
mode: restart | |
max_exceeded: silent | |
variables: | |
power_light: !input "power_light" | |
hue_light: !input "hue_light" | |
brightness_steps: !input "brightness_steps" | |
trigger: | |
- platform: event | |
event_type: zha_event | |
event_data: | |
device_id: !input "remote" | |
cluster_id: 64512 | |
action: | |
- variables: | |
command: "{{ trigger.event.data.command }}" | |
power_light_on: "{{ states(power_light) == 'on' }}" | |
hue_light_on: "{{ states(hue_light) == 'on' }}" | |
- choose: | |
- conditions: "{{ command == 'on_press' }}" | |
sequence: | |
service: light.toggle | |
data: | |
entity_id: !input "power_light" | |
transition: 0.5 | |
- conditions: "{{ command == 'off_press' }}" | |
sequence: | |
service: light.toggle | |
data: | |
entity_id: !input "hue_light" | |
transition: 0.5 | |
- conditions: | |
- condition: or | |
conditions: | |
- "{{ command == 'up_press' }}" | |
- "{{ command == 'up_hold' }}" | |
sequence: | |
- choose: | |
- conditions: | |
- "{{ power_light_on == false }}" | |
- "{{ hue_light_on == false }}" | |
sequence: | |
service: light.turn_on | |
data: | |
entity_id: | |
- !input "power_light" | |
- !input "hue_light" | |
transition: 0.5 | |
brightness_pct: "{{ brightness_steps }}" | |
- conditions: | |
- "{{ power_light_on == true }}" | |
- "{{ hue_light_on == true }}" | |
sequence: | |
service: light.turn_on | |
data: | |
entity_id: | |
- !input "power_light" | |
- !input "hue_light" | |
transition: 0.5 | |
brightness_step_pct: "{{ brightness_steps }}" | |
- conditions: | |
- "{{ power_light_on == true }}" | |
sequence: | |
service: light.turn_on | |
data: | |
entity_id: | |
- !input "power_light" | |
transition: 0.5 | |
brightness_step_pct: "{{ brightness_steps }}" | |
- conditions: | |
- "{{ hue_light_on == true }}" | |
sequence: | |
service: light.turn_on | |
data: | |
entity_id: | |
- !input "hue_light" | |
transition: 0.5 | |
brightness_step_pct: "{{ brightness_steps }}" | |
- conditions: | |
- condition: or | |
conditions: | |
- "{{ command == 'down_press' }}" | |
- "{{ command == 'down_hold' }}" | |
sequence: | |
- choose: | |
- conditions: | |
- "{{ power_light_on == true }}" | |
- "{{ hue_light_on == true }}" | |
sequence: | |
service: light.turn_on | |
data: | |
entity_id: | |
- !input "power_light" | |
- !input "hue_light" | |
transition: 0.5 | |
brightness_step_pct: "{{ brightness_steps*-1 }}" | |
- conditions: | |
- "{{ power_light_on == true }}" | |
sequence: | |
service: light.turn_on | |
data: | |
entity_id: | |
- !input "power_light" | |
transition: 0.5 | |
brightness_step_pct: "{{ brightness_steps*-1 }}" | |
- conditions: | |
- "{{ hue_light_on == true }}" | |
sequence: | |
service: light.turn_on | |
data: | |
entity_id: | |
- !input "hue_light" | |
transition: 0.5 | |
brightness_step_pct: "{{ brightness_steps*-1 }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment