Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dskindell/ba0269bfad625538b9db54cfe038992a to your computer and use it in GitHub Desktop.
Save dskindell/ba0269bfad625538b9db54cfe038992a to your computer and use it in GitHub Desktop.
philips-hue-dimmer-remote-with-phillips-hue-bridge.yaml
blueprint:
name: Philips Hue Dimmer Remote with Phillips Hue Bridge
description:
'Control lights with a Philips Hue Dimmer Switch via Phillips Hue Bridge.
The top "on" button will turn the lights on to the last set brightness
Dim up/down buttons will change the brightness smoothly and can be pressed
and hold until the brightness is satisfactory.
The bottom "off" button will turn the lights off.
If defined it will optionally control up to 5 different sets of lights using the
double through quintuple press options. Whichever light was turned on last will
be controlled by the dimmer buttons.
'
domain: automation
input:
remote:
name: Philips Hue Dimmer Switch
description: Pick a RWL020 device
selector:
device:
model: Hue dimmer switch (RWL020)
multiple: false
target_light:
name: Single Press Light
description: The light(s) to control with single press
default: {}
selector:
target:
entity:
- {}
hold_on_switch_light:
name: Hold On Light
description: The additional light(s) to turn on holding on switch
default: {}
selector:
target:
entity:
- {}
hold_off_switch_light:
name: Hold Off Light
description: The additional light(s) to turn off holding off switch
default: {}
selector:
target:
entity:
- {}
source_url: https://github.com/apollo1220/blueprints/blob/main/philips_zigbee_remote.yaml
mode: restart
max_exceeded: silent
variables:
target_light: !input target_light
hold_on_switch_light: !input hold_on_switch_light
hold_off_switch_light: !input hold_off_switch_light
lights:
target_light: !input target_light
hold_on_switch_light: !input hold_on_switch_light
hold_off_switch_light: !input hold_off_switch_light
trigger:
- platform: event
event_type: hue_event
event_data:
device_id: !input remote
action:
- variables:
type: "{{ trigger.event.data.type }}"
subtype: "{{ trigger.event.data.subtype }}"
- choose:
- conditions:
- "{{ target_light != null }}"
- "{{ type == 'short_release' }}"
- "{{ subtype == 1 }}"
sequence:
- service: homeassistant.turn_on
target: !input target_light
data:
transition: 1
- conditions:
- "{{ hold_on_switch_light != null }}"
- "{{ type == 'long_release' or type == 'repeat' }}"
- "{{ subtype == 1 }}"
sequence:
- service: homeassistant.turn_on
target: !input hold_on_switch_light
data:
transition: 1
- conditions:
- "{{ target_light != null }}"
- "{{ type == 'short_release' }}"
- "{{ subtype == 4 }}"
sequence:
- service: homeassistant.turn_off
target: !input target_light
data:
transition: 1
- conditions:
- "{{ hold_off_switch_light != null }}"
- "{{ type == 'long_release' or type == 'repeat' }}"
- "{{ subtype == 4 }}"
sequence:
- service: homeassistant.turn_off
target: !input hold_off_switch_light
data:
transition: 1
- conditions:
- "{{ target_light != null }}"
- "{{ type == 'short_release' or type == 'repeat' }}"
- "{{ subtype == 2 }}"
sequence:
- service: light.turn_on
target: !input target_light
data:
brightness_step_pct: 12
transition: 1
- conditions:
- "{{ target_light != null }}"
- "{{ type == 'short_release' or type == 'repeat' }}"
- "{{ subtype == 3 }}"
sequence:
- service: light.turn_on
target: !input target_light
data:
brightness_step_pct: -12
transition: 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment