Instantly share code, notes, and snippets.
Created
June 7, 2025 07:38
-
Star
0
(0)
You must be signed in to star a gist -
Fork
0
(0)
You must be signed in to fork a gist
-
-
Save koying/b517ec520ce0b51dd4fbea33e2b26365 to your computer and use it in GitHub Desktop.
Zigbee button blueprint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| blueprint: | |
| name: Easy Customizable Controller Automation Blueprint for Hue Dimmer Switch in | |
| Zigbee2MQTT | |
| description: 'Controller automation for easy customizable Buttons with Philips Hue | |
| Dimmer Switch. | |
| ---------------------------------------------------------------------- | |
| __--------> !!!!!!!!! FRUSTRATION CAUTION !!!!!!!!! <--------__ | |
| ---------------------------------------------------------------------- | |
| _______________________________██████ | |
| _______________________________██████ | |
| _______________________________██████ | |
| ___________________________███████████ | |
| ______________________________███████ | |
| __________________________________██ | |
| __Only define the ''Pressed'' action when you need to!__ | |
| __Use the ''Released'' action instead!!!__ | |
| __The ''pressed'' action will also activate on ''Held''__' | |
| domain: automation | |
| input: | |
| controller: | |
| name: (Zigbee2MQTT) Controller Name | |
| description: The name of the controller/Dimmer-Switch in Zigbee2MQTT (Not the | |
| name of your Home-Assistent Entity) | |
| default: '' | |
| base_topic: | |
| name: Root/Base mqtt topic from Zigbee2MQTT | |
| description: The Root/base topic as configured in Zigbee2MQTT (If you dont configured | |
| it you can leave the default --> "zigbee2mqtt") | |
| default: zigbee2mqtt | |
| single_press: | |
| name: Single Button Pressed | |
| description: Action set to run, when the lone Button is pressed | |
| default: [] | |
| selector: | |
| action: {} | |
| single_hold: | |
| name: Single Button Held | |
| description: Action set to run, when the lone Button is pressed and held | |
| default: [] | |
| selector: | |
| action: {} | |
| on_press: | |
| name: Button On Pressed | |
| description: Action set to run, when the Button On is pressed even when hold. | |
| default: [] | |
| selector: | |
| action: {} | |
| on_held: | |
| name: Button On Held | |
| description: Action set to run, when the Button On is held. | |
| default: [] | |
| selector: | |
| action: {} | |
| on_released: | |
| name: Button On released | |
| description: Action set to run, when the Button On is released. | |
| default: [] | |
| selector: | |
| action: {} | |
| on_hold_released: | |
| name: Button On Hold released | |
| description: Action set to run, when the Button On is pressed and is released | |
| after long press. | |
| default: [] | |
| selector: | |
| action: {} | |
| up_pressed: | |
| name: Up Pressed | |
| description: Action set to run, when the Up pressed even when hold. | |
| default: [] | |
| selector: | |
| action: {} | |
| up_held: | |
| name: Up Held | |
| description: Action set to run, when the Up is held. | |
| default: [] | |
| selector: | |
| action: {} | |
| up_released: | |
| name: Up released | |
| description: Action set to run, when the Up is released. | |
| default: [] | |
| selector: | |
| action: {} | |
| up_hold_released: | |
| name: Button Up Hold released | |
| description: Action set to run, when the Button Up is pressed and is released | |
| after long press. | |
| default: [] | |
| selector: | |
| action: {} | |
| down_pressed: | |
| name: Down Pressed | |
| description: Action set to run, when the Down is pressed even when hold. | |
| default: [] | |
| selector: | |
| action: {} | |
| down_held: | |
| name: Down Held | |
| description: Action set to run, when the Down is held. | |
| default: [] | |
| selector: | |
| action: {} | |
| down_released: | |
| name: Down released | |
| description: Action set to run, when the Down is released. | |
| default: [] | |
| selector: | |
| action: {} | |
| down_hold_released: | |
| name: Button Down Hold released | |
| description: Action set to run, when the Button Down is pressed and is released | |
| after long press. | |
| default: [] | |
| selector: | |
| action: {} | |
| off_pressed: | |
| name: Off Pressed | |
| description: Action set to run, when the Off is pressed even when hold. (Off | |
| is also the "hue" button) | |
| default: [] | |
| selector: | |
| action: {} | |
| off_held: | |
| name: Off Held | |
| description: Action set to run, when the Off is held. (Off is also the "hue" | |
| button) | |
| default: [] | |
| selector: | |
| action: {} | |
| off_released: | |
| name: Off released | |
| description: Action set to run, when the Off is released. (Off is also the "hue" | |
| button) | |
| default: [] | |
| selector: | |
| action: {} | |
| off_hold_released: | |
| name: Button Off Hold released | |
| description: Action set to run, when the Button Off is pressed and is released | |
| after long press. (Off is also the "hue" button) | |
| default: [] | |
| selector: | |
| action: {} | |
| mode: parallel | |
| max: 6 | |
| trigger_variables: | |
| base_topic: !input base_topic | |
| controller: !input controller | |
| trigger: | |
| - platform: mqtt | |
| topic: '{{ base_topic ~ ''/'' ~ controller }}' | |
| condition: '{{''action'' in trigger.payload_json }}' | |
| action: | |
| - variables: | |
| controller: !input controller | |
| - choose: | |
| - conditions: '{{(''hold'' in trigger.payload_json.action) or (''release'' in trigger.payload_json.action) | |
| or (''press'' in trigger.payload_json.action) or (''single'' in trigger.payload_json.action) or (''on'' in trigger.payload_json.action) }}' | |
| sequence: | |
| - choose: | |
| - conditions: '{{ trigger.payload_json.action == "single" or trigger.payload_json.action == "on"}}' | |
| sequence: !input single_press | |
| - conditions: '{{ trigger.payload_json.action == "hold" }}' | |
| sequence: !input single_hold | |
| - conditions: '{{ trigger.payload_json.action == "on_press" or trigger.payload_json.action | |
| == "on-press" }}' | |
| sequence: !input on_press | |
| - conditions: '{{ trigger.payload_json.action == "up_press" or trigger.payload_json.action | |
| == "up-press" }}' | |
| sequence: !input up_pressed | |
| - conditions: '{{ trigger.payload_json.action == "down_press" or trigger.payload_json.action | |
| == "down-press" }}' | |
| sequence: !input down_pressed | |
| - conditions: '{{ trigger.payload_json.action == "off_press" or trigger.payload_json.action | |
| == "off-press" }}' | |
| sequence: !input off_pressed | |
| - conditions: '{{ trigger.payload_json.action == "on_hold" or trigger.payload_json.action | |
| == "on-hold" }}' | |
| sequence: !input on_held | |
| - conditions: '{{ trigger.payload_json.action == "up_hold" or trigger.payload_json.action | |
| == "up-hold" }}' | |
| sequence: !input up_held | |
| - conditions: '{{ trigger.payload_json.action == "down_hold" or trigger.payload_json.action | |
| == "down-hold" }}' | |
| sequence: !input down_held | |
| - conditions: '{{ trigger.payload_json.action == "off_hold" or trigger.payload_json.action | |
| == "off-hold" }}' | |
| sequence: !input off_held | |
| - conditions: '{{ trigger.payload_json.action == "on_press_release" or trigger.payload_json.action | |
| == "on-press-release" }}' | |
| sequence: !input on_released | |
| - conditions: '{{ trigger.payload_json.action == "up_press_release" or trigger.payload_json.action | |
| == "up-press-release" }}' | |
| sequence: !input up_released | |
| - conditions: '{{ trigger.payload_json.action == "down_press_release" or trigger.payload_json.action | |
| == "down-press-release" }}' | |
| sequence: !input down_released | |
| - conditions: '{{ trigger.payload_json.action == "off_press_release" or trigger.payload_json.action | |
| == "off-press-release" }}' | |
| sequence: !input off_released | |
| - conditions: '{{ trigger.payload_json.action == "on_hold_release" or trigger.payload_json.action | |
| == "on-hold-release" }}' | |
| sequence: !input on_hold_released | |
| - conditions: '{{ trigger.payload_json.action == "up_hold_release" or trigger.payload_json.action | |
| == "up-hold-release" }}' | |
| sequence: !input up_hold_released | |
| - conditions: '{{ trigger.payload_json.action == "down_hold_release" or trigger.payload_json.action | |
| == "down-hold-release" }}' | |
| sequence: !input down_hold_released | |
| - conditions: '{{ trigger.payload_json.action == "off_hold_release" or trigger.payload_json.action | |
| == "off-hold-release" }}' | |
| sequence: !input off_hold_released |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment