-
Notifications
You must be signed in to change notification settings - Fork 0
/
PTM_215Z.yaml
205 lines (204 loc) · 7 KB
/
PTM_215Z.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
blueprint:
name: Controller - EnOcean PTM 215Z (Friends of Hue) switch
description: |
Controller automation for executing **press/hold/release** actions triggered by EnOcean PTM 215Z/ZE switch.
ℹ️ Version 2024.11.13
domain: automation
input:
controller_entity:
name: (Zigbee2MQTT) Controller Entity
description: The action sensor of the controller to use for the automation.
default: ''
selector:
entity:
integration: mqtt
domain: sensor
hold_delay:
name: Hold delay
description: If the button has been held more than the configured Hold delay, the corresponding held action is triggered.
default: 500
selector:
number:
min: 100.0
max: 1000.0
unit_of_measurement: milliseconds
mode: box
step: 10.0
button_1_pressed:
name: Button 1 Pressed
description: Action to run, when button 1 is pressed.
default: []
selector:
action: {}
button_1_held:
name: Button 1 Held
description: Action to run, when the button 1 is held.
default: []
selector:
action: {}
button_1_released:
name: Button 1 released
description: Action to run, when the button 1 is released.
default: []
selector:
action: {}
button_2_pressed:
name: Button 2 Pressed
description: Action to run, when the button 2 pressed.
default: []
selector:
action: {}
button_2_held:
name: Button 2 Held
description: Action to run, when the button 2 is held.
default: []
selector:
action: {}
button_2_released:
name: Button 2 released
description: Action to run, when the button 2 is released.
default: []
selector:
action: {}
button_3_pressed:
name: Button 3 Pressed
description: Action to run, when the button 3 is pressed.
default: []
selector:
action: {}
button_3_held:
name: Button 3 Held
description: Action to run, when the button 3 is held.
default: []
selector:
action: {}
button_3_released:
name: Button 3 released
description: Action to run, when the button 3 is released.
default: []
selector:
action: {}
button_4_pressed:
name: Button 4 Pressed
description: Action to run, when the button 4 is pressed.
default: []
selector:
action: {}
button_4_held:
name: Button 4 Held
description: Action to run, when the button 4 is held.
default: []
selector:
action: {}
button_4_released:
name: Button 4 released
description: Action to run, when the button 4 is released.
default: []
selector:
action: {}
button_1_and_3_pressed:
name: Button 1 and 3 Pressed
description: Action to run, when buttons 1 and 3 are pressed.
default: []
selector:
action: {}
button_1_and_3_held:
name: Button 1 and 3 Held
description: Action to run, when buttons 1 and 3 are held.
default: []
selector:
action: {}
button_1_and_3_released:
name: Button 1 and 3 released
description: Action to run, when buttons 1 and 3 are released after long press.
default: []
selector:
action: {}
button_2_and_4_pressed:
name: Button 2 and 4 Pressed
description: Action to run, when buttons 2 and 4 are pressed.
default: []
selector:
action: {}
button_2_and_4_held:
name: Button 2 and 4 Held
description: Action to run, when buttons 2 and 4 are held.
default: []
selector:
action: {}
button_2_and_4_released:
name: Button 2 and 4 released
description: Action to run, when buttons 2 and 4 are released after long press.
default: []
selector:
action: {}
mode: single
max_exceeded: silent
triggers:
- trigger: event
event_type: state_changed
event_data:
entity_id: !input controller_entity
conditions: '{{ trigger.event.data.new_state.state not in ("", "unknown", "unavailable", "None") }}'
actions:
- variables:
command: '{{ trigger.event.data.new_state.state }}'
- choose:
- conditions: '{{ "press_" | string in command }}'
sequence:
- wait_for_trigger:
- trigger: state
entity_id: !input controller_entity
to:
- "release_1"
- "release_2"
- "release_3"
- "release_4"
- "release_1_and_3"
- "release_2_and_4"
timeout:
milliseconds: !input hold_delay
- if: '{{ wait.trigger != None }}'
then:
- choose:
- conditions: '{{ command == "press_1" }}'
sequence: !input button_1_pressed
- conditions: '{{ command == "press_2" }}'
sequence: !input button_2_pressed
- conditions: '{{ command == "press_3" }}'
sequence: !input button_3_pressed
- conditions: '{{ command == "press_4" }}'
sequence: !input button_4_pressed
- conditions: '{{ command == "press_1_and_3" }}'
sequence: !input button_1_and_3_pressed
- conditions: '{{ command == "press_2_and_4" }}'
sequence: !input button_2_and_4_pressed
else:
- choose:
- conditions: '{{ command == "press_1" }}'
sequence: !input button_1_held
- conditions: '{{ command == "press_2" }}'
sequence: !input button_2_held
- conditions: '{{ command == "press_3" }}'
sequence: !input button_3_held
- conditions: '{{ command == "press_4" }}'
sequence: !input button_4_held
- conditions: '{{ command == "press_1_and_3" }}'
sequence: !input button_1_and_3_held
- conditions: '{{ command == "press_2_and_4" }}'
sequence: !input button_2_and_4_held
- conditions: '{{ "release_" | string in command }}'
sequence:
- choose:
- conditions: '{{ command == "release_1" }}'
sequence: !input button_1_released
- conditions: '{{ command == "release_2" }}'
sequence: !input button_2_released
- conditions: '{{ command == "release_3" }}'
sequence: !input button_3_released
- conditions: '{{ command == "release_4" }}'
sequence: !input button_4_released
- conditions: '{{ command == "release_1_and_3" }}'
sequence: !input button_1_and_3_released
- conditions: '{{ command == "release_2_and_4" }}'
sequence: !input button_2_and_4_released