forked from golles/Home-Assistant-Blueprints
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzigbee2mqtt_xiaomi_switch.yaml
87 lines (78 loc) · 2.15 KB
/
zigbee2mqtt_xiaomi_switch.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
blueprint:
name: Zigbee2MQTT - Xiaomi switch (WXKG01LM and WXKG11LM))
description: |
This blueprint allows you to make automations for the Xiaomi Aqara switch and Xiaomi MiJia wireless switch, connected to Zigbee2MQTT.
domain: automation
source_url: https://raw.githubusercontent.com/golles/Home-Assistant-Blueprints/main/zigbee2mqtt_xiaomi_switch.yaml
input:
switch:
name: Switch
description: Switch to use (pick the sensor that ends with _action).
selector:
entity:
integration: mqtt
domain: sensor
single:
name: Single press action(s)
description: Action to run on single press
default: []
selector:
action: {}
double:
name: Double press action(s)
description: Action to run on double press
default: []
selector:
action: {}
triple:
name: Triple press action(s)
description: Action to run on triple press
default: []
selector:
action: {}
quadruple:
name: Quadruple press action(s)
description: Action to run on quadruple press
default: []
selector:
action: {}
hold:
name: Hold action(s)
description: Action to run on hold
default: []
selector:
action: {}
release:
name: Release action(s)
description: Action to run on release
default: []
selector:
action: {}
mode: single
max_exceeded: silent
trigger:
- platform: state
entity_id: !input switch
to:
- "single"
- "double"
- "triple"
- "quadruple"
- "hold"
- "release"
action:
- variables:
to_state: "{{ trigger.to_state.state }}"
- choose:
- conditions: "{{ to_state == 'single' }}"
sequence: !input single
- conditions: "{{ to_state == 'double' }}"
sequence: !input double
- conditions: "{{ to_state == 'triple' }}"
sequence: !input triple
- conditions: "{{ to_state == 'quadruple' }}"
sequence: !input quadruple
- conditions: "{{ to_state == 'hold' }}"
sequence: !input hold
- conditions: "{{ to_state == 'release' }}"
sequence: !input release