-
Notifications
You must be signed in to change notification settings - Fork 0
/
SonoffWB-01.yaml
59 lines (55 loc) · 1.25 KB
/
SonoffWB-01.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
blueprint:
name: Sonoff Zigbee Switch
description: Automate the Sonoff Zigbee WB01
domain: automation
input:
sonoff_button:
name: Sonoff Switch
selector:
device:
integration: zha
manufacturer: eWeLink
model: WB-01
toggle_action:
name: Single Press
description: Action to run on single press
default: []
selector:
action: {}
on_action:
name: Double Press
description: Action to run on double press
default: []
selector:
action: {}
off_action:
name: Long Press
description: Action to run on long press
default: []
selector:
action: {}
mode: single
max_exceeded: silent
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input sonoff_button
variables:
toggle_action: !input toggle_action
on_action: !input on_action
off_action: !input off_action
action:
- variables:
command: '{{ trigger.event.data.command }}'
- choose:
- conditions:
- '{{ command == "toggle" }}'
sequence: !input toggle_action
- conditions:
- '{{ command == "on" }}'
sequence: !input on_action
- conditions:
- '{{ command == "off" }}'
sequence: !input off_action