-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHA-Blueprint-Inovelli-Blue-Z2M.yaml
More file actions
213 lines (213 loc) · 7.08 KB
/
Copy pathHA-Blueprint-Inovelli-Blue-Z2M.yaml
File metadata and controls
213 lines (213 loc) · 7.08 KB
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
206
207
208
209
210
211
212
213
---
blueprint:
name: Inovelli Blue - Z2M
description: 'Home Assistant Blueprint for Inovelli Blue Switches Running in Z2M'
domain: automation
input:
inovelli_switch:
name: Inovelli Switch
description: List of available Inovelli VZM31-SN switch.
selector:
device:
integration: mqtt
manufacturer: Inovelli
multiple: true
command_path_base:
name: Default Command Path Base
description: Set the base path for the MQTT command path. This is `zigbee2mqtt` by default.
default: zigbee2mqtt
selector:
text:
config_button_held:
name: Config Press Held Down
description: Action to run, when the config button is pressed and held.
default: []
selector:
action: {}
config_button_released:
name: Config Press Hold Release
description: Action to run, when the config button is released after being held.
default: []
selector:
action: {}
config_button:
name: Config Press 1x
description: Action to run, when the config button is pressed one time.
default: []
selector:
action: {}
config_button2:
name: Config Press 2x
description: Action to run, when the config button is pressed two times.
default: []
selector:
action: {}
config_button3:
name: Config Press 3x
description: Action to run, when the config button is pressed three times.
default: []
selector:
action: {}
config_button4:
name: Config Press 4x
description: Action to run, when the config button is pressed four times.
default: []
selector:
action: {}
config_button5:
name: Config Press 5x
description: Action to run, when the config button is pressed five times.
default: []
selector:
action: {}
button_a_held:
name: Up/On Held
description: Action to run, when the Up button is pressed and held.
default: []
selector:
action: {}
button_a_released:
name: Up/On Released
description: Action to run, when the Up button is released after being held.
default: []
selector:
action: {}
button_a:
name: Up/On Press 1x
description: Action to run, when the Up button is pressed one time.
default: []
selector:
action: {}
button_a2:
name: Up/On Press 2x
description: Action to run, when the Up button is pressed two times.
default: []
selector:
action: {}
button_a3:
name: Up/On Press 3x
description: Action to run, when the up button is pressed three times.
default: []
selector:
action: {}
button_a4:
name: Up/On Press 4x
description: Action to run, when the Up button is pressed four times.
default: []
selector:
action: {}
button_a5:
name: Up/On Press 5x
description: Action to run, when the Up button is pressed five times.
default: []
selector:
action: {}
button_b_held:
name: Down/Off Held
description: Action to run, when the Down button is pressed and held.
default: []
selector:
action: {}
button_b_released:
name: Down/Off Released
description: Action to run, when the Down button is released after being held.
default: []
selector:
action: {}
button_b:
name: Down/Off Press 1x
description: Action to run, when the Down button is pressed one time.
default: []
selector:
action: {}
button_b2:
name: Down/Off Press 2x
description: Action to run, when the Down button is pressed two times.
default: []
selector:
action: {}
button_b3:
name: Down/Off Press 3x
description: Action to run, when the Down button is pressed three times.
default: []
selector:
action: {}
button_b4:
name: Down/Off Press 4x
description: Action to run, when the Down button is pressed four times.
default: []
selector:
action: {}
button_b5:
name: Down/Off Press 5x
description: Action to run, when the Down button is pressed five times.
default: []
selector:
action: {}
source_url: https://github.com/jkosharek/HA-Blueprint-Inovelli-Blue-Z2M/blob/main/HA-Blueprint-Inovelli-Blue-Z2M.yaml
mode: single
max_exceeded: silent
variables:
command_path_base: !input 'command_path_base'
device_id: !input 'inovelli_switch'
trigger_variables:
command_path_base: !input 'command_path_base'
triggers:
- trigger: mqtt
topic: "{{command_path_base}}/+"
conditions:
- condition: template
value_template: >
{% set ns = namespace(topics=[]) %}
{% for id in device_id %}
{% set ns.topics = ns.topics + [ command_path_base + "/" + device_attr(id, 'name') ] %}
{% endfor %}
{{ trigger.topic in ns.topics }}
- condition: template
value_template: '{{ trigger.payload_json.action is defined }}'
actions:
- variables:
button_id: '{{ trigger.payload_json.action }}'
- choose:
- conditions: '{{ button_id == "config_single" }}'
sequence: !input 'config_button'
- conditions: '{{ button_id == "up_single" }}'
sequence: !input 'button_a'
- conditions: '{{ button_id == "down_single" }}'
sequence: !input 'button_b'
- conditions: '{{ button_id == "config_held" }}'
sequence: !input 'config_button_held'
- conditions: '{{ button_id == "up_held" }}'
sequence: !input 'button_a_held'
- conditions: '{{ button_id == "down_held" }}'
sequence: !input 'button_b_held'
- conditions: '{{ button_id == "config_release" }}'
sequence: !input 'config_button_released'
- conditions: '{{ button_id == "up_release" }}'
sequence: !input 'button_a_released'
- conditions: '{{ button_id == "down_release" }}'
sequence: !input 'button_b_released'
- conditions: '{{ button_id == "config_double" }}'
sequence: !input 'config_button2'
- conditions: '{{ button_id == "up_double" }}'
sequence: !input 'button_a2'
- conditions: '{{ button_id == "down_double" }}'
sequence: !input 'button_b2'
- conditions: '{{ button_id == "config_triple" }}'
sequence: !input 'config_button3'
- conditions: '{{ button_id == "up_triple" }}'
sequence: !input 'button_a3'
- conditions: '{{ button_id == "down_triple" }}'
sequence: !input 'button_b3'
- conditions: '{{ button_id == "config_quadruple" }}'
sequence: !input 'config_button4'
- conditions: '{{ button_id == "up_quadruple" }}'
sequence: !input 'button_a4'
- conditions: '{{ button_id == "down_quadruple" }}'
sequence: !input 'button_b4'
- conditions: '{{ button_id == "config_quintuple" }}'
sequence: !input 'config_button5'
- conditions: '{{ button_id == "up_quintuple" }}'
sequence: !input 'button_a5'
- conditions: '{{ button_id == "down_quintuple" }}'
sequence: !input 'button_b5'