Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save lucasreiners/59c456f0e05366ec7ce9b3f691ac3b2f to your computer and use it in GitHub Desktop.

Select an option

Save lucasreiners/59c456f0e05366ec7ce9b3f691ac3b2f to your computer and use it in GitHub Desktop.
blueprint:
name: ZHA - Philips Hue Dimmer Switch Config - v2024.12.09
description: |
Control lights with a Philips Hue Dimmer Switch
domain: automation
source_url: https://gist.github.com/lucasreiners/59c456f0e05366ec7ce9b3f691ac3b2f
# Define the inputs for the blueprint
input:
remote:
name: Philips Hue Dimmer Switch
description: Pick either RWL021 (old one) or RWL022 (new one)
selector:
device:
filter:
- integration: zha
manufacturer: Signify Netherlands B.V.
model: RWL022
- integration: zha
manufacturer: Philips
model: RWL021
# inputs for custom actions
button_on_short_press:
name: On button short press
description: Action to run on short on button press.
default: []
selector:
action:
button_on_long_press:
name: On button long press
description: Action to run on long on button press.
default: []
selector:
action:
button_on_double_press:
name: On button double press
description: Action to run on double on button press.
default: []
selector:
action:
button_up_short_press:
name: Up button short press
description: Action to run on short up button press.
default: []
selector:
action:
button_up_long_press:
name: Up button long press
description: Action to run on long up button press.
default: []
selector:
action:
button_up_double_press:
name: Up button double press
description: Action to run on double up button press.
default: []
selector:
action:
button_down_short_press:
name: Down button short press
description: Action to run on short down button press.
default: []
selector:
action:
button_down_long_press:
name: Down button long press
description: Action to run on long down button press.
default: []
selector:
action:
button_down_double_press:
name: Down button double press
description: Action to run on double down button press.
default: []
selector:
action:
button_off_short_press:
name: Off button short press
description: Action to run on short off button press.
default: []
selector:
action:
button_off_long_press:
name: Off button long press
description: Action to run on long off button press.
default: []
selector:
action:
button_off_double_press:
name: Off button double press
description: Action to run on double off button press.
default: []
selector:
action:
mode: parallel
max_exceeded: silent
# Trigger the automation when the selected dimmer remote sends an event
# Also only trigger on cluster_id 64512. This ignores the 'old' events with cluster_id 8.
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input 'remote'
cluster_id: 64512
action:
- variables:
command : '{{ trigger.event.data.command }}'
- choose:
- conditions: '{{ command == ''on_press'' }}'
sequence: !input button_on_short_press
- conditions: '{{ command == ''on_hold'' }}'
sequence: !input button_on_long_press
- conditions: '{{ command == ''on_double_press'' }}'
sequence: !input button_on_double_press
- conditions: '{{ command == ''off_press'' }}'
sequence: !input button_off_short_press
- conditions: '{{ command == ''off_hold'' }}'
sequence: !input button_off_long_press
- conditions: '{{ command == ''off_double_press'' }}'
sequence: !input button_off_double_press
- conditions: '{{ command == ''up_press'' }}'
sequence: !input button_up_short_press
- conditions: '{{ command == ''up_hold'' }}'
sequence: !input button_up_long_press
- conditions: '{{ command == ''up_double_press'' }}'
sequence: !input button_up_double_press
- conditions: '{{ command == ''down_press'' }}'
sequence: !input button_down_short_press
- conditions: '{{ command == ''down_hold'' }}'
sequence: !input button_down_long_press
- conditions: '{{ command == ''down_double_press'' }}'
sequence: !input button_down_double_press
@JeanLescutMuller
Copy link
Copy Markdown

Thank you for adapting the code for the new RWL022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment