Skip to content

Instantly share code, notes, and snippets.

@EmilZackrisson
Created November 12, 2021 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save EmilZackrisson/5ac3bb980783af92595ef24a75ead612 to your computer and use it in GitHub Desktop.
Save EmilZackrisson/5ac3bb980783af92595ef24a75ead612 to your computer and use it in GitHub Desktop.
Home Assistant Blueprint for Philips Hue Switch RWL022
blueprint:
name: ZHA - Philips Hue Dimmer Switch RWL022
description: |
Choose what all four buttons will do.
domain: automation
input:
remote:
name: Remote
description: Choose the remote
selector:
device:
integration: zha
manufacturer: Signify Netherlands B.V.
entity:
domain: sensor
device_class: battery
button_1_single_press:
name: Button 1 (POWER) Single Press
description: Action to run on single press
default: []
selector:
action: {}
button_1_long_press:
name: Button 1 (POWER) Long Press
description: Action to run on long press
default: []
selector:
action: {}
button_1_double_press:
name: Button 1 (POWER) Double Press
description: Action to run on double press
default: []
selector:
action: {}
button_2_single_press:
name: Button 2 (BRIGHTNESS_UP) Single Press
description: Action to run on single press
default: []
selector:
action: {}
button_2_long_press:
name: Button 2 (BRIGHTNESS_UP) Long Press
description: Action to run on long press
default: []
selector:
action: {}
button_2_double_press:
name: Button 2 (BRIGHTNESS_UP) Double Press
description: Action to run on double press
default: []
selector:
action: {}
button_3_single_press:
name: Button 3 (BRIGHTNESS_DOWN) Single Press
description: Action to run on single press
default: []
selector:
action: {}
button_3_long_press:
name: Button 3 (BRIGHTNESS_DOWN) Long Press
description: Action to run on long press
default: []
selector:
action: {}
button_3_double_press:
name: Button 3 (BRIGHTNESS_DOWN) Double Press
description: Action to run on double press
default: []
selector:
action: {}
button_4_single_press:
name: Button 4 (HUE) Single Press
description: Action to run on single press
default: []
selector:
action: {}
button_4_long_press:
name: Button 4 (HUE) Long Press
description: Action to run on long press
default: []
selector:
action: {}
button_4_double_press:
name: Button 4 (HUE) Double Press
description: Action to run on double press
default: []
selector:
action: {}
mode: restart
max_exceeded: silent
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input "remote"
action:
- variables:
command: "{{ trigger.event.data.command }}"
- choose:
- conditions:
- "{{ command == 'on_short_release' }}"
sequence: !input "button_1_single_press"
- conditions:
- "{{ command == 'on_hold' }}"
sequence: !input "button_1_long_press"
- conditions:
- "{{ command == 'on_double_press' }}"
sequence: !input "button_1_double_press"
- conditions:
- "{{ command == 'up_short_release' }}"
sequence: !input "button_2_single_press"
- conditions:
- "{{ command == 'up_hold' }}"
sequence: !input "button_2_long_press"
- conditions:
- "{{ command == 'up_double_press' }}"
sequence: !input "button_2_double_press"
- conditions:
- "{{ command == 'down_short_release' }}"
sequence: !input "button_3_single_press"
- conditions:
- "{{ command == 'down_hold' }}"
sequence: !input "button_3_long_press"
- conditions:
- "{{ command == 'down_double_press' }}"
sequence: !input "button_3_double_press"
- conditions:
- "{{ command == 'off_short_release' }}"
sequence: !input "button_4_single_press"
- conditions:
- "{{ command == 'off_hold' }}"
sequence: !input "button_4_long_press"
- conditions:
- "{{ command == 'off_double_press' }}"
sequence: !input "button_4_double_press"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment