Skip to content

Instantly share code, notes, and snippets.

@EmilZackrisson
Last active March 23, 2025 10:27
Show Gist options
  • Save EmilZackrisson/3f2820c9872791cfa2894f8ce7d1619a to your computer and use it in GitHub Desktop.
Save EmilZackrisson/3f2820c9872791cfa2894f8ce7d1619a to your computer and use it in GitHub Desktop.
Z2M Philips Hue Switch RWL022
blueprint:
name: Z2M - Philips Hue Dimmer Switch RWL022
description: Choose what all four buttons will do.
domain: automation
input:
remote:
name: Hue Dimmer switch
description: Hue Dimmer switch to use (Zigbee2mqtt Action Sensor)
selector:
entity:
domain: sensor
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_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_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_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: {}
source_url: https://gist.github.com/EmilZackrisson/3f2820c9872791cfa2894f8ce7d1619a
mode: restart
max_exceeded: silent
trigger:
- platform: state
entity_id: !input "remote"
attribute: action
action:
- variables:
command: "{{ trigger.to_state.state }}"
- choose:
- conditions:
- '{{ command == "on_press_release" }}'
sequence: !input "button_1_single_press"
- conditions:
- '{{ command == "up_press_release" }}'
sequence: !input "button_2_single_press"
- conditions:
- '{{ command == "down_press_release" }}'
sequence: !input "button_3_single_press"
- conditions:
- '{{ command == "off_press_release" }}'
sequence: !input "button_4_single_press"
- conditions:
- '{{ command == "on_hold" }}'
sequence: !input "button_1_long_press"
- conditions:
- '{{ command == "up_hold" }}'
sequence: !input "button_2_long_press"
- conditions:
- '{{ command == "down_hold" }}'
sequence: !input "button_3_long_press"
- conditions:
- '{{ command == "off_hold" }}'
sequence: !input "button_4_long_press"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment