-
-
Save dcramer/26d11847e3a4773d0f64d94b17f7609a to your computer and use it in GitHub Desktop.
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: ZHA - Sonoff SNZB-01 | |
description: 'Perform actions with the Sonoff SNZB-01 Button. | |
You can set functions for single press, double press and hold. This allows you to assign, | |
e.g., a scene or anything else.' | |
domain: automation | |
input: | |
remote: | |
name: Remote | |
description: Sonoff Button to use | |
selector: | |
device: | |
integration: zha | |
manufacturer: eWeLink | |
model: WB01 | |
single_press: | |
name: Single press | |
description: Action to run on single press | |
default: [] | |
selector: | |
action: {} | |
double_press: | |
name: Double press | |
description: Action to run on double press | |
default: [] | |
selector: | |
action: {} | |
hold: | |
name: Hold | |
description: Action to run on hold | |
default: [] | |
selector: | |
action: {} | |
source_url: https://gist.github.com/seamus65/2be0f8c665ac8c1e011fbd1a0937f9e1 | |
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 }}' | |
cluster_id: '{{ trigger.event.data.cluster_id }}' | |
endpoint_id: '{{ trigger.event.data.endpoint_id }}' | |
- choose: | |
- conditions: | |
- '{{ command == "toggle" }}' | |
- '{{ cluster_id == 6 }}' | |
- '{{ endpoint_id == 1 }}' | |
sequence: !input 'single_press' | |
- conditions: | |
- '{{ command == "on" }}' | |
- '{{ cluster_id == 6 }}' | |
- '{{ endpoint_id == 1 }}' | |
sequence: !input 'double_press' | |
- conditions: | |
- '{{ command == "off" }}' | |
- '{{ cluster_id == 6 }}' | |
- '{{ endpoint_id == 1 }}' | |
sequence: !input 'hold' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment