-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathexample_4x_adj_vbar_pak.yaml
455 lines (440 loc) · 13.1 KB
/
example_4x_adj_vbar_pak.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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
# Example configuration for four ADJ VBar Pak fixtures daisy chained with XLR cables
# DMX description: https://d295jznhem2tn9.cloudfront.net/ItemRelatedFiles/8659/vbar_pak.pdf
# Fixture configuration set for DMX 8 channel mode
# Note: for ESP8266 don't forget to also set "esp8266_restore_from_flash: true" in "esphome:" section
uart:
id: uart_bus
baud_rate: 250000
tx_pin:
number: GPIO2 #ESP8266
allow_other_uses: true # for ESPHome >= 2023.12.0
stop_bits: 2
dmx512:
id: dmx
uart_id: uart_bus
tx_pin:
number: GPIO2 #ESP8266
allow_other_uses: true # for ESPHome >= 2023.12.0
uart_num: 1
output:
- platform: dmx512
channel: 1
universe: dmx
id: vbar1_red
- platform: dmx512
channel: 2
universe: dmx
id: vbar1_green
- platform: dmx512
channel: 3
universe: dmx
id: vbar1_blue
- platform: dmx512
channel: 4
universe: dmx
id: vbar1_amber
- platform: dmx512
channel: 5
universe: dmx
id: vbar1_master
- platform: dmx512
channel: 6
universe: dmx
id: vbar1_effect_level
- platform: dmx512
channel: 7
universe: dmx
id: vbar1_effect_select
- platform: dmx512
channel: 8
universe: dmx
id: vbar1_effect_mode
- platform: dmx512
channel: 9
universe: dmx
id: vbar2_red
- platform: dmx512
channel: 10
universe: dmx
id: vbar2_green
- platform: dmx512
channel: 11
universe: dmx
id: vbar2_blue
- platform: dmx512
channel: 12
universe: dmx
id: vbar2_amber
- platform: dmx512
channel: 13
universe: dmx
id: vbar2_master
- platform: dmx512
channel: 14
universe: dmx
id: vbar2_effect_level
- platform: dmx512
channel: 15
universe: dmx
id: vbar2_effect_select
- platform: dmx512
channel: 16
universe: dmx
id: vbar2_effect_mode
- platform: dmx512
channel: 17
universe: dmx
id: vbar3_red
- platform: dmx512
channel: 18
universe: dmx
id: vbar3_green
- platform: dmx512
channel: 19
universe: dmx
id: vbar3_blue
- platform: dmx512
channel: 20
universe: dmx
id: vbar3_amber
- platform: dmx512
channel: 21
universe: dmx
id: vbar3_master
- platform: dmx512
channel: 22
universe: dmx
id: vbar3_effect_level
- platform: dmx512
channel: 23
universe: dmx
id: vbar3_effect_select
- platform: dmx512
channel: 24
universe: dmx
id: vbar3_effect_mode
- platform: dmx512
channel: 25
universe: dmx
id: vbar4_red
- platform: dmx512
channel: 26
universe: dmx
id: vbar4_green
- platform: dmx512
channel: 27
universe: dmx
id: vbar4_blue
- platform: dmx512
channel: 28
universe: dmx
id: vbar4_amber
- platform: dmx512
channel: 29
universe: dmx
id: vbar4_master
- platform: dmx512
channel: 30
universe: dmx
id: vbar4_effect_level
- platform: dmx512
channel: 31
universe: dmx
id: vbar4_effect_select
- platform: dmx512
channel: 32
universe: dmx
id: vbar4_effect_mode
- platform: template
id: vbar_groupdim
type: float
write_action:
- lambda: |-
id(vbar1_master).set_level(state);
id(vbar2_master).set_level(state);
id(vbar3_master).set_level(state);
id(vbar4_master).set_level(state);
number:
- platform: template
name: ${friendly_name} Effect Level
icon: mdi:flower-pollen-outline
id: vbar_effect_level_num
optimistic: true
min_value: 0
max_value: 255
step: 1
restore_value: true
set_action:
- lambda: |-
id(vbar1_effect_level).set_level(x / 255);
id(vbar2_effect_level).set_level(x / 255);
id(vbar3_effect_level).set_level(x / 255);
id(vbar4_effect_level).set_level(x / 255);
select:
- platform: template
name: ${friendly_name} Effect
optimistic: true
restore_value: true
icon: mdi:pan
disabled_by_default: true
id: vbar1_effect_select_dropdown
options:
- "None"
- "Color Macro"
- "Color Change"
- "Color Fade"
- "Sound Active"
- "Strobing"
set_action:
- lambda: |-
if (x.compare(std::string{"None"}) == 0) {
id(vbar1_effect_select).set_level(0);
id(vbar2_effect_select).set_level(0);
id(vbar3_effect_select).set_level(0);
id(vbar4_effect_select).set_level(0);
auto call = id(vbar_effect_level_num).make_call();
call.set_value(0);
call.perform();
}
if (x.compare(std::string{"Strobing"}) == 0) {
id(vbar1_effect_select).set_level(0.04);
id(vbar2_effect_select).set_level(0.04);
id(vbar3_effect_select).set_level(0.04);
id(vbar4_effect_select).set_level(0.04);
}
if (x.compare(std::string{"Color Macro"}) == 0) {
id(vbar1_effect_select).set_level(0.3);
id(vbar2_effect_select).set_level(0.3);
id(vbar3_effect_select).set_level(0.3);
id(vbar4_effect_select).set_level(0.3);
}
if (x.compare(std::string{"Color Change"}) == 0) {
id(vbar1_effect_select).set_level(0.5);
id(vbar2_effect_select).set_level(0.5);
id(vbar3_effect_select).set_level(0.5);
id(vbar4_effect_select).set_level(0.5);
}
if (x.compare(std::string{"Color Fade"}) == 0) {
id(vbar1_effect_select).set_level(0.66);
id(vbar2_effect_select).set_level(0.66);
id(vbar3_effect_select).set_level(0.66);
id(vbar4_effect_select).set_level(0.66);
}
if (x.compare(std::string{"Sound Active"}) == 0) {
id(vbar1_effect_select).set_level(0.9);
id(vbar2_effect_select).set_level(0.9);
id(vbar3_effect_select).set_level(0.9);
id(vbar4_effect_select).set_level(0.9);
auto call = id(vbar_effect_level_num).make_call();
call.set_value(200);
call.perform();
}
- platform: template
name: ${friendly_name} Effect Mode
icon: mdi:dots-hexagon
optimistic: true
restore_value: true
id: vbar_effect_mode_dropdown
options:
- Change-Fade-Sound-1-Macro-OFF
- Change-Fade-Sound-2-Macro-R
- Change-Fade-Sound-3-Macro-G
- Change-Fade-Sound-4-Macro-B
- Change-Fade-Sound-5-Macro-A
- Change-Fade-Sound-6-Macro-RG
- Change-Fade-Sound-7-Macro-RB
- Change-Fade-Sound-8-Macro-RA
- Change-Fade-Sound-9-Macro-GB
- Change-Fade-Sound-10-Macro-GA
- Change-Fade-Sound-11-Macro-BA
- Change-Fade-Sound-12-Macro-RGB
- Change-Fade-Sound-13-Macro-RGA
- Change-Fade-Sound-14-Macro-RBA
- Change-Fade-Sound-15-Macro-GBA
- Change-Fade-Sound-16-Macro-RGBA
set_action:
- lambda: |-
if (x.compare(std::string{"Change-Fade-Sound-1-Macro-OFF"}) == 0) {
id(vbar1_effect_mode).set_level(0.03);
id(vbar2_effect_mode).set_level(0.03);
id(vbar3_effect_mode).set_level(0.03);
id(vbar4_effect_mode).set_level(0.03);
}
if (x.compare(std::string{"Change-Fade-Sound-2-Macro-R"}) == 0) {
id(vbar1_effect_mode).set_level(0.09);
id(vbar2_effect_mode).set_level(0.09);
id(vbar3_effect_mode).set_level(0.09);
id(vbar4_effect_mode).set_level(0.09);
}
if (x.compare(std::string{"Change-Fade-Sound-3-Macro-G"}) == 0) {
id(vbar1_effect_mode).set_level(0.16);
id(vbar2_effect_mode).set_level(0.16);
id(vbar3_effect_mode).set_level(0.16);
id(vbar4_effect_mode).set_level(0.16);
}
if (x.compare(std::string{"Change-Fade-Sound-4-Macro-B"}) == 0) {
id(vbar1_effect_mode).set_level(0.22);
id(vbar2_effect_mode).set_level(0.22);
id(vbar3_effect_mode).set_level(0.22);
id(vbar4_effect_mode).set_level(0.22);
}
if (x.compare(std::string{"Change-Fade-Sound-5-Macro-A"}) == 0) {
id(vbar1_effect_mode).set_level(0.28);
id(vbar2_effect_mode).set_level(0.28);
id(vbar3_effect_mode).set_level(0.28);
id(vbar4_effect_mode).set_level(0.28);
}
if (x.compare(std::string{"Change-Fade-Sound-6-Macro-RG"}) == 0) {
id(vbar1_effect_mode).set_level(0.35);
id(vbar2_effect_mode).set_level(0.35);
id(vbar3_effect_mode).set_level(0.35);
id(vbar4_effect_mode).set_level(0.35);
}
if (x.compare(std::string{"Change-Fade-Sound-7-Macro-RB"}) == 0) {
id(vbar1_effect_mode).set_level(0.41);
id(vbar2_effect_mode).set_level(0.41);
id(vbar3_effect_mode).set_level(0.41);
id(vbar4_effect_mode).set_level(0.41);
}
if (x.compare(std::string{"Change-Fade-Sound-8-Macro-RA"}) == 0) {
id(vbar1_effect_mode).set_level(0.47);
id(vbar2_effect_mode).set_level(0.47);
id(vbar3_effect_mode).set_level(0.47);
id(vbar4_effect_mode).set_level(0.47);
}
if (x.compare(std::string{"Change-Fade-Sound-9-Macro-GB"}) == 0) {
id(vbar1_effect_mode).set_level(0.53);
id(vbar2_effect_mode).set_level(0.53);
id(vbar3_effect_mode).set_level(0.53);
id(vbar4_effect_mode).set_level(0.53);
}
if (x.compare(std::string{"Change-Fade-Sound-10-Macro-GA"}) == 0) {
id(vbar1_effect_mode).set_level(0.6);
id(vbar2_effect_mode).set_level(0.6);
id(vbar3_effect_mode).set_level(0.6);
id(vbar4_effect_mode).set_level(0.6);
}
if (x.compare(std::string{"Change-Fade-Sound-11-Macro-BA"}) == 0) {
id(vbar1_effect_mode).set_level(0.66);
id(vbar2_effect_mode).set_level(0.66);
id(vbar3_effect_mode).set_level(0.66);
id(vbar4_effect_mode).set_level(0.66);
}
if (x.compare(std::string{"Change-Fade-Sound-12-Macro-RGB"}) == 0) {
id(vbar1_effect_mode).set_level(0.72);
id(vbar2_effect_mode).set_level(0.72);
id(vbar3_effect_mode).set_level(0.72);
id(vbar4_effect_mode).set_level(0.72);
}
if (x.compare(std::string{"Change-Fade-Sound-13-Macro-RGA"}) == 0) {
id(vbar1_effect_mode).set_level(0.78);
id(vbar2_effect_mode).set_level(0.78);
id(vbar3_effect_mode).set_level(0.78);
id(vbar4_effect_mode).set_level(0.78);
}
if (x.compare(std::string{"Change-Fade-Sound-14-Macro-RBA"}) == 0) {
id(vbar1_effect_mode).set_level(0.85);
id(vbar2_effect_mode).set_level(0.85);
id(vbar3_effect_mode).set_level(0.85);
id(vbar4_effect_mode).set_level(0.85);
}
if (x.compare(std::string{"Change-Fade-Sound-15-Macro-GBA"}) == 0) {
id(vbar1_effect_mode).set_level(0.91);
id(vbar2_effect_mode).set_level(0.91);
id(vbar3_effect_mode).set_level(0.91);
id(vbar4_effect_mode).set_level(0.91);
}
if (x.compare(std::string{"Change-Fade-Sound-16-Macro-RGBA"}) == 0) {
id(vbar1_effect_mode).set_level(0.97);
id(vbar2_effect_mode).set_level(0.97);
id(vbar3_effect_mode).set_level(0.97);
id(vbar4_effect_mode).set_level(0.97);
}
light:
- platform: monochromatic
name: ${friendly_name} Dimmer
output: vbar_groupdim
icon: mdi:blur
default_transition_length: 1s
gamma_correct: 0
restore_mode: RESTORE_DEFAULT_ON
- platform: rgbw
name: ${friendly_name} 1
id: dmx_bar_1
red: vbar1_red
green: vbar1_green
blue: vbar1_blue
white: vbar1_amber
icon: mdi:spotlight
default_transition_length: 0.3s
color_interlock: false
gamma_correct: 0
restore_mode: RESTORE_DEFAULT_ON
- platform: monochromatic
name: ${friendly_name} 1 Dimmer
output: vbar1_master
icon: mdi:blur
disabled_by_default: true
default_transition_length: 2s
gamma_correct: 0
restore_mode: RESTORE_DEFAULT_ON
- platform: rgbw
name: ${friendly_name} 2
id: dmx_bar_2
red: vbar2_red
green: vbar2_green
blue: vbar2_blue
white: vbar2_amber
icon: mdi:spotlight
default_transition_length: 0.3s
color_interlock: false
gamma_correct: 0
restore_mode: RESTORE_DEFAULT_ON
- platform: monochromatic
name: ${friendly_name} 2 Dimmer
output: vbar2_master
icon: mdi:blur
disabled_by_default: true
default_transition_length: 2s
gamma_correct: 0
restore_mode: RESTORE_DEFAULT_ON
- platform: rgbw
name: ${friendly_name} 3
id: dmx_bar_3
red: vbar3_red
green: vbar3_green
blue: vbar3_blue
white: vbar3_amber
icon: mdi:spotlight
default_transition_length: 0.3s
color_interlock: false
gamma_correct: 0
restore_mode: RESTORE_DEFAULT_ON
- platform: monochromatic
name: ${friendly_name} 3 Dimmer
output: vbar3_master
icon: mdi:blur
disabled_by_default: true
default_transition_length: 2s
gamma_correct: 0
restore_mode: RESTORE_DEFAULT_ON
- platform: rgbw
name: ${friendly_name} 4
id: dmx_bar_4
red: vbar4_red
green: vbar4_green
blue: vbar4_blue
white: vbar4_amber
icon: mdi:spotlight
default_transition_length: 0.3s
color_interlock: false
gamma_correct: 0
restore_mode: RESTORE_DEFAULT_ON
- platform: monochromatic
name: ${friendly_name} 4 Dimmer
output: vbar4_master
icon: mdi:blur
disabled_by_default: true
default_transition_length: 2s
gamma_correct: 0
restore_mode: RESTORE_DEFAULT_ON