A simple ZHA blueprint for the Philips Hue dimmer switch where all four buttons are individually configurable for short, double and long presses. Personally I use the on button to turn on one of two scenes and use the dim buttons to control curtains
blueprint:
name: ZHA - Philips Hue Dimmer Switch (individual buttons)
description: |
All four buttons are individual buttons with short,
long and double press actions for scenes or automations
domain: automation
input:
remote:
name: Remote
description: The remote to use
selector:
device:
integration: zha
manufacturer: Philips
entity:
domain: sensor
device_class: battery
button_1_single_press:
name: Button 1 (ON) Single Press
description: Action to run on single press
default: []
selector:
action: {}
button_1_long_press:
name: Button 1 (ON) Long Press
description: Action to run on long press
default: []
selector:
action: {}
button_1_double_press:
name: Button 1 (ON) Double Press
description: Action to run on double press
default: []
selector:
action: {}
button_2_single_press:
name: Button 2 (UP) Single Press
description: Action to run on single press
default: []
selector:
action: {}
button_2_long_press:
name: Button 2 (UP) Long Press
description: Action to run on long press
default: []
selector:
action: {}
button_2_double_press:
name: Button 2 (UP) Double Press
description: Action to run on double press
default: []
selector:
action: {}
button_3_single_press:
name: Button 3 (DOWN) Single Press
description: Action to run on single press
default: []
selector:
action: {}
button_3_long_press:
name: Button 3 (DOWN) Long Press
description: Action to run on long press
default: []
selector:
action: {}
button_3_double_press:
name: Button 3 (DOWN) Double Press
description: Action to run on double press
default: []
selector:
action: {}
button_4_single_press:
name: Button 4 (OFF) Single Press
description: Action to run on single press
default: []
selector:
action: {}
button_4_long_press:
name: Button 4 (OFF) Long Press
description: Action to run on long press
default: []
selector:
action: {}
button_4_double_press:
name: Button 4 (OFF) 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"
Edits:
2021-01-03 :
- Added double press actions, note that these can interfere with the single press actions, but could be valuable in some specific use cases
- More descriptive button names