Skip to content

Instantly share code, notes, and snippets.

@andrew-codechimp
Last active November 16, 2022 09:57
Show Gist options
  • Save andrew-codechimp/7613baa3893af6d25b66c2c62ecf3b11 to your computer and use it in GitHub Desktop.
Save andrew-codechimp/7613baa3893af6d25b66c2c62ecf3b11 to your computer and use it in GitHub Desktop.
Home Assistant Blueprint - Zigbee2MQTT Hue Wall Switch Module
blueprint:
name: Zigbee2MQTT Hue Wall Switch Module
description: 'Controller automation for executing any kind of action triggered by a Philips Hue Wall Switch Module.'
domain: automation
input:
switch:
name: Switch
description: The action sensor of the controller to use for the automation.
default: ''
selector:
entity:
domain: sensor
press_left:
name: Press (toggle) left button
description: Action to run on left button pressed or toggled
default: []
selector:
action: {}
hold_left:
name: Hold left button
description: Action to run on holding left button
default: []
selector:
action: {}
release_left:
name: Release left button
description: Action to run on releasing left button
default: []
selector:
action: {}
press_right:
name: Press (toggle) right button
description: Action to run on right button pressed or toggled
default: []
selector:
action: {}
hold_right:
name: Hold right button
description: Action to run on holding right button
default: []
selector:
action: {}
release_right:
name: Release right button
description: Action to run on releasing right button
default: []
selector:
action: {}
mode: single
max_exceeded: silent
trigger:
- platform: state
entity_id: !input switch
to:
- "left_press"
- "left_hold"
- "left_hold_release"
- "right_press"
- "right_hold"
- "right_hold_release"
action:
- variables:
command: "{{ trigger.to_state.attributes.action }}"
- choose:
- conditions: '{{ command == ''left_press'' }}'
sequence: !input press_left
- conditions: '{{ command == ''left_hold'' }}'
sequence: !input hold_left
- conditions: '{{ command == ''left_hold_release'' }}'
sequence: !input release_left
- conditions: '{{ command == ''right_press'' }}'
sequence: !input press_right
- conditions: '{{ command == ''right_hold'' }}'
sequence: !input hold_right
- conditions: '{{ command == ''right_hold_release'' }}'
sequence: !input release_right
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment