-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvesternet-12-button-remote-control.yaml
216 lines (214 loc) · 5.78 KB
/
vesternet-12-button-remote-control.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
206
207
208
209
210
211
212
213
214
215
216
blueprint:
name: Vesternet 12 Button Remote Control
description: 'All oval buttons (1-4, S1 and S2) can be connected to any action. The main on (1) and off (0) buttons will activate all on/off buttons 1-4 together.
Supports: short button clicks and long button presses (over 4 seconds).
Very minor tweak of the original Blueprint by Bart Eversdijk: https://github.com/Bekkie/ha-blueprints/blob/main/automation/robb-smarrt-4-ch-remote-ROB_200-024-0.yaml
Only change is model: ZGRC-KEY-013
'
domain: automation
author: Mike Sheppard (Original by Bart Eversdijk)
source_url: https://github.com/mike-sheppard/home-assistant-blueprints/blob/main/vesternet-12-button-remote-control.yml
input:
remote:
name: Remote
description: Switch remote to use
selector:
device:
integration: zha
model: ZGRC-KEY-013
on_button_1_short:
name: On button 1 - short
default: []
selector:
action: {}
off_button_1_short:
name: Off button 1 - short
default: []
selector:
action: {}
on_button_1_long:
name: On button 1 - long press
default: []
selector:
action: {}
off_button_1_long:
name: Off button 1 - long press
default: []
selector:
action: {}
on_button_2_short:
name: On button 2 - short
default: []
selector:
action: {}
off_button_2_short:
name: Off button 2 - short
default: []
selector:
action: {}
on_button_2_long:
name: On button 2 - long press
default: []
selector:
action: {}
off_button_2_long:
name: Off button 2 - long press
default: []
selector:
action: {}
on_button_3_short:
name: On button 3 - short
default: []
selector:
action: {}
off_button_3_short:
name: Off button 3 - short
default: []
selector:
action: {}
on_button_3_long:
name: On button 3 - long press
default: []
selector:
action: {}
off_button_3_long:
name: Off button 3 - long press
default: []
selector:
action: {}
on_button_4_short:
name: On button 4 - short
default: []
selector:
action: {}
off_button_4_short:
name: Off button 4 - short
default: []
selector:
action: {}
on_button_4_long:
name: On button 4 - long press
default: []
selector:
action: {}
off_button_4_long:
name: Off button 4 - long press
default: []
selector:
action: {}
s1_button_short:
name: S1 button - short
default: []
selector:
action: {}
s2_button_short:
name: S2 button - short
default: []
selector:
action: {}
s1_button_long:
name: S1 button - long press
default: []
selector:
action: {}
s2_button_long:
name: S2 button - long press
default: []
selector:
action: {}
mode: parallel
max_exceeded: silent
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input remote
action:
- variables:
button: '{{ trigger.event.data.endpoint_id }}'
cmd: '{{ trigger.event.data.command }}'
- choose:
- conditions:
- '{{ button == 1 and cmd == ''on'' }}'
sequence: !input on_button_1_short
- conditions:
- '{{ button == 1 and cmd == ''off'' }}'
sequence: !input off_button_1_short
- conditions:
- '{{ button == 1 and cmd == ''move_with_on_off'' }}'
sequence:
- variables:
mode: '{{ trigger.event.data.params.move_mode }}'
- if:
- condition:
- '{{ mode == "MoveMode.Up" }}'
then: !input on_button_1_long
else: !input off_button_1_long
- conditions:
- '{{ button == 2 and cmd == ''on'' }}'
sequence: !input on_button_2_short
- conditions:
- '{{ button == 2 and cmd == ''off'' }}'
sequence: !input off_button_2_short
- conditions:
- '{{ button == 2 and cmd == ''move_with_on_off'' }}'
sequence:
- variables:
mode: '{{ trigger.event.data.params.move_mode }}'
- if:
- condition:
- '{{ mode == "MoveMode.Up" }}'
then: !input on_button_2_long
else: !input off_button_2_long
- conditions:
- '{{ button == 3 and cmd == ''on'' }}'
sequence: !input on_button_3_short
- conditions:
- '{{ button == 3 and cmd == ''off'' }}'
sequence: !input off_button_3_short
- conditions:
- '{{ button == 3 and cmd == ''move_with_on_off'' }}'
sequence:
- variables:
mode: '{{ trigger.event.data.params.move_mode }}'
- if:
- condition:
- '{{ mode == "MoveMode.Up" }}'
then: !input on_button_3_long
else: !input off_button_3_long
- conditions:
- '{{ button == 4 and cmd == ''on'' }}'
sequence: !input on_button_4_short
- conditions:
- '{{ button == 4 and cmd == ''off'' }}'
sequence: !input off_button_4_short
- conditions:
- '{{ button == 4 and cmd == ''move_with_on_off'' }}'
sequence:
- variables:
mode: '{{ trigger.event.data.params.move_mode }}'
- if:
- condition:
- '{{ mode == "MoveMode.Up" }}'
then: !input on_button_4_long
else: !input off_button_4_long
- conditions:
- '{{ button == 1 and cmd == "recall" }}'
sequence:
- variables:
sbutton: '{{ trigger.event.data.params.scene_id }}'
- if:
- condition:
- '{{ sbutton == 1 }}'
then: !input s1_button_short
else: !input s2_button_short
- conditions:
- '{{ button == 1 and cmd == "store" }}'
sequence:
- variables:
sbutton: '{{ trigger.event.data.params.scene_id }}'
- if:
- condition:
- '{{ sbutton == 1 }}'
then: !input s1_button_long
else: !input s2_button_long