forked from Koenkk/zigbee-herdsman-converters
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinovelli.ts
2163 lines (2073 loc) · 86.7 KB
/
inovelli.ts
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
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import {Zcl} from 'zigbee-herdsman';
import fz from '../converters/fromZigbee';
import tz from '../converters/toZigbee';
import * as exposes from '../lib/exposes';
import * as m from '../lib/modernExtend';
import * as reporting from '../lib/reporting';
import * as globalStore from '../lib/store';
import {DefinitionWithExtend, Expose, Fz, Tz, Zh} from '../lib/types';
import * as utils from '../lib/utils';
const e = exposes.presets;
const ea = exposes.access;
const clickLookup: {[key: number]: string} = {
0: 'single',
1: 'release',
2: 'held',
3: 'double',
4: 'triple',
5: 'quadruple',
6: 'quintuple',
};
const buttonLookup: {[key: number]: string} = {
1: 'down',
2: 'up',
3: 'config',
4: 'aux_down',
5: 'aux_up',
6: 'aux_config',
};
const ledEffects: {[key: string]: number} = {
off: 0,
solid: 1,
fast_blink: 2,
slow_blink: 3,
pulse: 4,
chase: 5,
open_close: 6,
small_to_big: 7,
aurora: 8,
slow_falling: 9,
medium_falling: 10,
fast_falling: 11,
slow_rising: 12,
medium_rising: 13,
fast_rising: 14,
medium_blink: 15,
slow_chase: 16,
fast_chase: 17,
fast_siren: 18,
slow_siren: 19,
clear_effect: 255,
};
const individualLedEffects: {[key: string]: number} = {
off: 0,
solid: 1,
fast_blink: 2,
slow_blink: 3,
pulse: 4,
chase: 5,
falling: 6,
rising: 7,
aurora: 8,
clear_effect: 255,
};
const INOVELLI_CLUSTER_NAME: string = 'manuSpecificInovelli';
const inovelliExtend = {
addCustomClusterInovelli: () =>
m.deviceAddCustomCluster(INOVELLI_CLUSTER_NAME, {
ID: 64561,
manufacturerCode: 0x122f,
attributes: {
dimmingSpeedUpRemote: {ID: 0x0001, type: Zcl.DataType.UINT8},
dimmingSpeedUpLocal: {ID: 0x0002, type: Zcl.DataType.UINT8},
rampRateOffToOnRemote: {ID: 0x0003, type: Zcl.DataType.UINT8},
rampRateOffToOnLocal: {ID: 0x0004, type: Zcl.DataType.UINT8},
dimmingSpeedDownRemote: {ID: 0x0005, type: Zcl.DataType.UINT8},
dimmingSpeedDownLocal: {ID: 0x0006, type: Zcl.DataType.UINT8},
rampRateOnToOffRemote: {ID: 0x0007, type: Zcl.DataType.UINT8},
rampRateOnToOffLocal: {ID: 0x0008, type: Zcl.DataType.UINT8},
minimumLevel: {ID: 0x0009, type: Zcl.DataType.UINT8},
maximumLevel: {ID: 0x000a, type: Zcl.DataType.UINT8},
invertSwitch: {ID: 0x000b, type: Zcl.DataType.BOOLEAN},
autoTimerOff: {ID: 0x000c, type: Zcl.DataType.UINT16},
defaultLevelLocal: {ID: 0x000d, type: Zcl.DataType.UINT8},
defaultLevelRemote: {ID: 0x000e, type: Zcl.DataType.UINT8},
stateAfterPowerRestored: {ID: 0x000f, type: Zcl.DataType.UINT8},
loadLevelIndicatorTimeout: {ID: 0x0011, type: Zcl.DataType.UINT8},
activePowerReports: {ID: 0x0012, type: Zcl.DataType.UINT8},
periodicPowerAndEnergyReports: {ID: 0x0013, type: Zcl.DataType.UINT16},
activeEnergyReports: {ID: 0x0014, type: Zcl.DataType.UINT16},
powerType: {ID: 0x0015, type: Zcl.DataType.BOOLEAN},
switchType: {ID: 0x0016, type: Zcl.DataType.UINT8},
quickStartTime: {ID: 0x0017, type: Zcl.DataType.UINT8},
quickStartLevel: {ID: 0x0018, type: Zcl.DataType.UINT8},
higherOutputInNonNeutral: {ID: 0x0019, type: Zcl.DataType.BOOLEAN},
dimmingMode: {ID: 0x001a, type: Zcl.DataType.BOOLEAN},
nonNeutralAuxMediumGear: {ID: 0x001e, type: Zcl.DataType.UINT8},
nonNeutralAuxLowGear: {ID: 0x001f, type: Zcl.DataType.UINT8},
internalTemperature: {ID: 0x0020, type: Zcl.DataType.UINT8},
overheat: {ID: 0x0021, type: Zcl.DataType.BOOLEAN},
buttonDelay: {ID: 0x0032, type: Zcl.DataType.UINT8},
deviceBindNumber: {ID: 0x0033, type: Zcl.DataType.UINT8},
smartBulbMode: {ID: 0x0034, type: Zcl.DataType.BOOLEAN},
doubleTapUpToParam55: {ID: 0x0035, type: Zcl.DataType.BOOLEAN},
doubleTapDownToParam56: {ID: 0x0036, type: Zcl.DataType.BOOLEAN},
brightnessLevelForDoubleTapUp: {ID: 0x0037, type: Zcl.DataType.UINT8},
brightnessLevelForDoubleTapDown: {ID: 0x0038, type: Zcl.DataType.UINT8},
defaultLed1ColorWhenOn: {ID: 0x003c, type: Zcl.DataType.UINT8},
defaultLed1ColorWhenOff: {ID: 0x003d, type: Zcl.DataType.UINT8},
defaultLed1IntensityWhenOn: {ID: 0x003e, type: Zcl.DataType.UINT8},
defaultLed1IntensityWhenOff: {ID: 0x003f, type: Zcl.DataType.UINT8},
defaultLed2ColorWhenOn: {ID: 0x0041, type: Zcl.DataType.UINT8},
defaultLed2ColorWhenOff: {ID: 0x0042, type: Zcl.DataType.UINT8},
defaultLed2IntensityWhenOn: {ID: 0x0043, type: Zcl.DataType.UINT8},
defaultLed2IntensityWhenOff: {ID: 0x0044, type: Zcl.DataType.UINT8},
defaultLed3ColorWhenOn: {ID: 0x0046, type: Zcl.DataType.UINT8},
defaultLed3ColorWhenOff: {ID: 0x0047, type: Zcl.DataType.UINT8},
defaultLed3IntensityWhenOn: {ID: 0x0048, type: Zcl.DataType.UINT8},
defaultLed3IntensityWhenOff: {ID: 0x0049, type: Zcl.DataType.UINT8},
defaultLed4ColorWhenOn: {ID: 0x004b, type: Zcl.DataType.UINT8},
defaultLed4ColorWhenOff: {ID: 0x004c, type: Zcl.DataType.UINT8},
defaultLed4IntensityWhenOn: {ID: 0x004d, type: Zcl.DataType.UINT8},
defaultLed4IntensityWhenOff: {ID: 0x004e, type: Zcl.DataType.UINT8},
defaultLed5ColorWhenOn: {ID: 0x0050, type: Zcl.DataType.UINT8},
defaultLed5ColorWhenOff: {ID: 0x0051, type: Zcl.DataType.UINT8},
defaultLed5IntensityWhenOn: {ID: 0x0052, type: Zcl.DataType.UINT8},
defaultLed5IntensityWhenOff: {ID: 0x0053, type: Zcl.DataType.UINT8},
defaultLed6ColorWhenOn: {ID: 0x0055, type: Zcl.DataType.UINT8},
defaultLed6ColorWhenOff: {ID: 0x0056, type: Zcl.DataType.UINT8},
defaultLed6IntensityWhenOn: {ID: 0x0057, type: Zcl.DataType.UINT8},
defaultLed6IntensityWhenOff: {ID: 0x0058, type: Zcl.DataType.UINT8},
defaultLed7ColorWhenOn: {ID: 0x005a, type: Zcl.DataType.UINT8},
defaultLed7ColorWhenOff: {ID: 0x005b, type: Zcl.DataType.UINT8},
defaultLed7IntensityWhenOn: {ID: 0x005c, type: Zcl.DataType.UINT8},
defaultLed7IntensityWhenOff: {ID: 0x005d, type: Zcl.DataType.UINT8},
ledColorWhenOn: {ID: 0x005f, type: Zcl.DataType.UINT8},
ledColorWhenOff: {ID: 0x060, type: Zcl.DataType.UINT8},
ledIntensityWhenOn: {ID: 0x0061, type: Zcl.DataType.UINT8},
ledIntensityWhenOff: {ID: 0x0062, type: Zcl.DataType.UINT8},
ledBarScaling: {ID: 0x0064, type: Zcl.DataType.BOOLEAN},
singleTapBehavior: {ID: 0x0078, type: Zcl.DataType.UINT8},
fanTimerMode: {ID: 0x0079, type: Zcl.DataType.UINT8},
auxSwitchUniqueScenes: {ID: 0x007b, type: Zcl.DataType.BOOLEAN},
bindingOffToOnSyncLevel: {ID: 0x007d, type: Zcl.DataType.BOOLEAN},
breezeMode: {ID: 0x0081, type: Zcl.DataType.UINT32},
fanControlMode: {ID: 0x0082, type: Zcl.DataType.UINT8},
lowLevelForFanControlMode: {ID: 0x0083, type: Zcl.DataType.UINT8},
mediumLevelForFanControlMode: {ID: 0x0084, type: Zcl.DataType.UINT8},
highLevelForFanControlMode: {ID: 0x0085, type: Zcl.DataType.UINT8},
ledColorForFanControlMode: {ID: 0x0086, type: Zcl.DataType.UINT8},
localProtection: {ID: 0x0100, type: Zcl.DataType.BOOLEAN},
remoteProtection: {ID: 0x0101, type: Zcl.DataType.BOOLEAN},
outputMode: {ID: 0x0102, type: Zcl.DataType.BOOLEAN},
onOffLedMode: {ID: 0x0103, type: Zcl.DataType.BOOLEAN},
firmwareUpdateInProgressIndicator: {ID: 0x0104, type: Zcl.DataType.BOOLEAN},
relayClick: {ID: 0x105, type: Zcl.DataType.BOOLEAN},
doubleTapClearNotifications: {ID: 0x106, type: Zcl.DataType.BOOLEAN},
fanLedLevelType: {ID: 0x0107, type: Zcl.DataType.UINT8},
},
commands: {
ledEffect: {
ID: 1,
parameters: [
{name: 'effect', type: Zcl.DataType.UINT8},
{name: 'color', type: Zcl.DataType.UINT8},
{name: 'level', type: Zcl.DataType.UINT8},
{name: 'duration', type: Zcl.DataType.UINT8},
],
},
individualLedEffect: {
ID: 3,
parameters: [
{name: 'led', type: Zcl.DataType.UINT8},
{name: 'effect', type: Zcl.DataType.UINT8},
{name: 'color', type: Zcl.DataType.UINT8},
{name: 'level', type: Zcl.DataType.UINT8},
{name: 'duration', type: Zcl.DataType.UINT8},
],
},
},
commandsResponse: {},
}),
};
const fanModes: {[key: string]: number} = {off: 0, low: 2, smart: 4, medium: 86, high: 170, on: 255};
const breezemodes: string[] = ['off', 'low', 'medium', 'high'];
const INOVELLI = 0x122f;
interface Attribute {
ID: number;
dataType: number;
min?: number;
max?: number;
description: string;
category?: 'config' | 'diagnostic';
unit?: string;
displayType?: string;
values?: {[s: string]: number};
readOnly?: boolean;
}
interface BreezeModeValues {
speed1: string;
speed2: string;
speed3: string;
speed4: string;
speed5: string;
time1: number;
time2: number;
time3: number;
time4: number;
time5: number;
}
// Converts brightness level to a fan mode
const intToFanMode = (value: number) => {
let selectedMode = 'low';
if (value >= fanModes.low) {
selectedMode = 'low';
}
if (value >= fanModes.medium) {
selectedMode = 'medium';
}
if (value >= fanModes.high) {
selectedMode = 'high';
}
if (value == 4) {
selectedMode = 'smart';
}
if (value == 0) {
selectedMode = 'off';
}
return selectedMode;
};
/**
* Convert speed string to int needed for breeze mode calculation.
* @param speedIn - speed string
* @returns low = 1, medium = 2, high = 3, off = 0
*/
const speedToInt = (speedIn: string): number => {
switch (speedIn) {
case 'low':
return 1;
case 'medium':
return 2;
case 'high':
return 3;
default:
return 0;
}
};
// Create Expose list with Inovelli Parameters definitions
const attributesToExposeList = (ATTRIBUTES: {[s: string]: Attribute}, exposesList: Expose[]) => {
Object.keys(ATTRIBUTES).forEach((key) => {
if (ATTRIBUTES[key].displayType === 'enum') {
const enumE = e
.enum(key, ATTRIBUTES[key].readOnly ? ea.STATE_GET : ea.ALL, Object.keys(ATTRIBUTES[key].values))
.withDescription(ATTRIBUTES[key].description);
if (!ATTRIBUTES[key].readOnly) {
enumE.withCategory(ATTRIBUTES[key].category ?? 'config');
}
exposesList.push(enumE);
} else if (ATTRIBUTES[key].displayType === 'binary' || ATTRIBUTES[key].displayType === 'switch') {
const binary = e
.binary(
key,
ATTRIBUTES[key].readOnly ? ea.STATE_GET : ea.ALL,
// @ts-expect-error ignore
ATTRIBUTES[key].values.Enabled,
ATTRIBUTES[key].values.Disabled,
)
.withDescription(ATTRIBUTES[key].description);
if (!ATTRIBUTES[key].readOnly) {
binary.withCategory(ATTRIBUTES[key].category ?? 'config');
}
exposesList.push(binary);
} else {
const numeric = e
.numeric(key, ATTRIBUTES[key].readOnly ? ea.STATE_GET : ea.ALL)
.withValueMin(ATTRIBUTES[key].min)
.withValueMax(ATTRIBUTES[key].max);
if (ATTRIBUTES[key].values) {
Object.keys(ATTRIBUTES[key].values).forEach((value) => {
numeric.withPreset(value, ATTRIBUTES[key].values[value], '');
});
}
if (ATTRIBUTES[key].unit) {
numeric.withUnit(ATTRIBUTES[key].unit);
}
numeric.withDescription(ATTRIBUTES[key].description);
if (!ATTRIBUTES[key].readOnly) {
numeric.withCategory(ATTRIBUTES[key].category ?? 'config');
}
exposesList.push(numeric);
}
});
};
/**
* Common Attributes
*
* These attributes are shared between all devices with the manufacturer specific Inovelli cluster
* Some of the descriptions, max, min or value properties may be overridden for each device
*/
const COMMON_ATTRIBUTES: {[s: string]: Attribute} = {
dimmingSpeedUpRemote: {
ID: 1,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 127,
description:
'This changes the speed that the light dims up when controlled from the hub. ' +
'A setting of 0 turns the light immediately on. Increasing the value slows down the transition speed. ' +
'Every number represents 100ms. Default = 25 (2.5s)',
},
dimmingSpeedUpLocal: {
ID: 2,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 127,
description:
'This changes the speed that the light dims up when controlled at the switch. ' +
'A setting of 0 turns the light immediately on. Increasing the value slows down the transition speed. ' +
'Every number represents 100ms. Default = 127 - Keep in sync with dimmingSpeedUpRemote setting.',
},
rampRateOffToOnRemote: {
ID: 3,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 127,
description:
'This changes the speed that the light turns on when controlled from the hub. ' +
'A setting of 0 turns the light immediately on. Increasing the value slows down the transition speed. ' +
'Every number represents 100ms. Default = 127 - Keep in sync with dimmingSpeedUpRemote setting.',
},
rampRateOffToOnLocal: {
ID: 4,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 127,
description:
'This changes the speed that the light turns on when controlled at the switch. ' +
'A setting of 0 turns the light immediately on. Increasing the value slows down the transition speed. ' +
'Every number represents 100ms. Default = 127 - Keep in sync with dimmingSpeedUpRemote setting.',
},
dimmingSpeedDownRemote: {
ID: 5,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 127,
description:
'This changes the speed that the light dims down when controlled from the hub. ' +
'A setting of 0 turns the light immediately off. Increasing the value slows down the transition speed. ' +
'Every number represents 100ms. Default = 127 - Keep in sync with dimmingSpeedUpRemote setting.',
},
dimmingSpeedDownLocal: {
ID: 6,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 127,
description:
'This changes the speed that the light dims down when controlled at the switch. ' +
'A setting of 0 turns the light immediately off. Increasing the value slows down the transition speed. ' +
'Every number represents 100ms. Default = 127 - Keep in sync with dimmingSpeedUpLocal setting.',
},
rampRateOnToOffRemote: {
ID: 7,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 127,
description:
'This changes the speed that the light turns off when controlled from the hub. ' +
"A setting of 'instant' turns the light immediately off. Increasing the value slows down the transition speed. " +
'Every number represents 100ms. Default = 127 - Keep in sync with rampRateOffToOnRemote setting.',
},
rampRateOnToOffLocal: {
ID: 8,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 127,
description:
'This changes the speed that the light turns off when controlled at the switch. ' +
"A setting of 'instant' turns the light immediately off. Increasing the value slows down the transition speed. " +
'Every number represents 100ms. Default = 127 - Keep in sync with rampRateOffToOnLocal setting.',
},
invertSwitch: {
ID: 11,
dataType: Zcl.DataType.BOOLEAN,
displayType: 'enum',
values: {Yes: 1, No: 0},
min: 0,
max: 1,
description:
'Inverts the orientation of the switch.' +
' Useful when the switch is installed upside down. Essentially up becomes down and down becomes up.',
},
autoTimerOff: {
ID: 12,
min: 0,
max: 32767,
dataType: Zcl.DataType.UINT16,
unit: 'seconds',
values: {Disabled: 0},
description:
'Automatically turns the switch off after this many seconds.' +
' When the switch is turned on a timer is started. When the timer expires, the switch is turned off. 0 = Auto off is disabled.',
},
defaultLevelLocal: {
ID: 13,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 255,
description:
'Default level for the load when it is turned on at the switch.' +
' A setting of 255 means that the switch will return to the level that it was on before it was turned off.',
},
defaultLevelRemote: {
ID: 14,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 255,
description:
'Default level for the load when it is turned on from the hub.' +
' A setting of 255 means that the switch will return to the level that it was on before it was turned off.',
},
stateAfterPowerRestored: {
ID: 15,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 255,
description: 'The state the switch should return to when power is restored after power failure. 0 = off, 1-254 = level, 255 = previous.',
},
loadLevelIndicatorTimeout: {
ID: 17,
dataType: Zcl.DataType.UINT8,
description:
'Shows the level that the load is at for x number of seconds after the load is adjusted' +
' and then returns to the Default LED state. 0 = Stay Off, 1-10 = seconds, 11 = Stay On.',
displayType: 'enum',
values: {
'Stay Off': 0,
'1 Second': 1,
'2 Seconds': 2,
'3 Seconds': 3,
'4 Seconds': 4,
'5 Seconds': 5,
'6 Seconds': 6,
'7 Seconds': 7,
'8 Seconds': 8,
'9 Seconds': 9,
'10 Seconds': 10,
'Stay On': 11,
},
min: 0,
max: 11,
},
switchType: {
ID: 22,
dataType: Zcl.DataType.UINT8,
displayType: 'enum',
values: {'Single Pole': 0, '3-Way Dumb Switch': 1, '3-Way Aux Switch': 2, 'Single-Pole Full Sine Wave': 3},
min: 0,
max: 3,
description: 'Set the switch configuration.',
},
internalTemperature: {
ID: 32,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 127,
readOnly: true,
description: 'The temperature measured by the temperature sensor inside the chip, in degrees Celsius',
category: 'diagnostic',
unit: '°C',
},
overheat: {
ID: 33,
dataType: Zcl.DataType.BOOLEAN,
displayType: 'enum',
values: {'No Alert': 0, Overheated: 1},
min: 0,
max: 1,
readOnly: true,
description: 'Indicates if the internal chipset is currently in an overheated state.',
},
buttonDelay: {
ID: 50,
dataType: Zcl.DataType.UINT8,
values: {
'0ms': 0,
'100ms': 1,
'200ms': 2,
'300ms': 3,
'400ms': 4,
'500ms': 5,
'600ms': 6,
'700ms': 7,
'800ms': 8,
'900ms': 9,
},
displayType: 'enum',
min: 0,
max: 9,
description: 'This will set the button press delay. 0 = no delay (Disables Button Press Events), Default = 500ms.',
},
deviceBindNumber: {
ID: 51,
dataType: Zcl.DataType.UINT8,
readOnly: true,
description: 'The number of devices currently bound (excluding gateways) and counts one group as two devices',
},
smartBulbMode: {
ID: 52,
dataType: Zcl.DataType.BOOLEAN,
displayType: 'enum',
values: {Disabled: 0, 'Smart Bulb Mode': 1},
description: 'For use with Smart Bulbs that need constant power and are controlled via commands rather than power.',
},
doubleTapUpToParam55: {
ID: 53,
dataType: Zcl.DataType.BOOLEAN,
displayType: 'enum',
values: {Disabled: 0, Enabled: 1},
description: 'Enable or Disable setting level to parameter 55 on double-tap UP.',
},
doubleTapDownToParam56: {
ID: 54,
dataType: Zcl.DataType.BOOLEAN,
displayType: 'enum',
values: {Disabled: 0, Enabled: 1},
description: 'Enable or Disable setting level to parameter 56 on double-tap DOWN.',
},
brightnessLevelForDoubleTapUp: {
ID: 55,
dataType: Zcl.DataType.UINT8,
min: 2,
max: 255,
description: 'Set this level on double-tap UP (if enabled by P53). 255 = send ON command.',
},
brightnessLevelForDoubleTapDown: {
ID: 56,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 255,
description: 'Set this level on double-tap DOWN (if enabled by P54). 255 = send OFF command.',
},
ledColorWhenOn: {
ID: 95,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 255,
values: {
Red: 0,
Orange: 21,
Yellow: 42,
Green: 85,
Cyan: 127,
Blue: 170,
Violet: 212,
Pink: 234,
White: 255,
},
description: 'Set the color of the LED Indicator when the load is on.',
},
ledColorWhenOff: {
ID: 96,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 255,
values: {
Red: 0,
Orange: 21,
Yellow: 42,
Green: 85,
Cyan: 127,
Blue: 170,
Violet: 212,
Pink: 234,
White: 255,
},
description: 'Set the color of the LED Indicator when the load is off.',
},
ledIntensityWhenOn: {
ID: 97,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 100,
description: 'Set the intensity of the LED Indicator when the load is on.',
},
ledIntensityWhenOff: {
ID: 98,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 100,
description: 'Set the intensity of the LED Indicator when the load is off.',
},
singleTapBehavior: {
ID: 120,
dataType: Zcl.DataType.UINT8,
displayType: 'enum',
values: {'Old Behavior': 0, 'New Behavior': 1, 'Down Always Off': 2},
description:
'Behavior of single tapping the on or off button. Old behavior turns the switch on or off. ' +
'New behavior cycles through the levels set by P131-133. Down Always Off is like the new behavior but ' +
'down always turns the switch off instead of going to next lower speed.',
},
fanControlMode: {
ID: 130,
dataType: Zcl.DataType.UINT8,
displayType: 'enum',
values: {Disabled: 0, 'Multi Tap': 1, Cycle: 2},
description: 'Which mode to use when binding EP3 (config button) to another device (like a fan module).',
},
lowLevelForFanControlMode: {
ID: 131,
dataType: Zcl.DataType.UINT8,
min: 2,
max: 254,
description: 'Level to send to device bound to EP3 when set to low.',
},
mediumLevelForFanControlMode: {
ID: 132,
dataType: Zcl.DataType.UINT8,
min: 2,
max: 254,
description: 'Level to send to device bound to EP3 when set to medium.',
},
highLevelForFanControlMode: {
ID: 133,
dataType: Zcl.DataType.UINT8,
min: 2,
max: 254,
description: 'Level to send to device bound to EP3 when set to high.',
},
ledColorForFanControlMode: {
ID: 134,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 255,
values: {
Red: 0,
Orange: 21,
Yellow: 42,
Green: 85,
Cyan: 127,
Blue: 170,
Violet: 212,
Pink: 234,
White: 255,
},
description: 'LED color used to display fan control mode.',
},
auxSwitchUniqueScenes: {
ID: 123,
dataType: Zcl.DataType.BOOLEAN,
displayType: 'enum',
values: {Disabled: 0, Enabled: 1},
description: 'Have unique scene numbers for scenes activated with the aux switch.',
},
bindingOffToOnSyncLevel: {
ID: 125,
dataType: Zcl.DataType.BOOLEAN,
displayType: 'enum',
values: {Disabled: 0, Enabled: 1},
description: 'Send Move_To_Level using Default Level with Off/On to bound devices.',
},
localProtection: {
ID: 256,
dataType: Zcl.DataType.BOOLEAN,
values: {Disabled: 0, Enabled: 1},
description: 'Ability to control switch from the wall.',
displayType: 'enum',
},
remoteProtection: {
ID: 257,
dataType: Zcl.DataType.BOOLEAN,
values: {Disabled: 0, Enabled: 1},
readOnly: true,
description: 'Ability to control switch from the hub.',
displayType: 'enum',
},
onOffLedMode: {
ID: 259,
min: 0,
max: 1,
values: {All: 0, One: 1},
dataType: Zcl.DataType.BOOLEAN,
description: 'When the device is in On/Off mode, use full LED bar or just one LED.',
displayType: 'enum',
},
firmwareUpdateInProgressIndicator: {
ID: 260,
dataType: Zcl.DataType.BOOLEAN,
values: {Disabled: 0, Enabled: 1},
description: 'Display progress on LED bar during firmware update.',
displayType: 'enum',
},
defaultLed1ColorWhenOn: {
ID: 60,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 255,
description:
'0-254:This is the color of the LED strip in a hex representation. 255:Synchronization with default all LED strip color parameter.',
},
defaultLed1ColorWhenOff: {
ID: 61,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 255,
description:
'0-254:This is the color of the LED strip in a hex representation. 255:Synchronization with default all LED strip color parameter.',
},
defaultLed1IntensityWhenOn: {
ID: 62,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 101,
description: 'Intesity of LED strip when on. 101 = Synchronized with default all LED strip intensity parameter.',
},
defaultLed1IntensityWhenOff: {
ID: 63,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 101,
description: 'Intesity of LED strip when off. 101 = Synchronized with default all LED strip intensity parameter.',
},
defaultLed2ColorWhenOn: {
ID: 65,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 255,
description:
'0-254:This is the color of the LED strip in a hex representation. 255:Synchronization with default all LED strip color parameter.',
},
defaultLed2ColorWhenOff: {
ID: 66,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 255,
description:
'0-254:This is the color of the LED strip in a hex representation. 255:Synchronization with default all LED strip color parameter.',
},
defaultLed2IntensityWhenOn: {
ID: 67,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 101,
description: 'Intesity of LED strip when on. 101 = Synchronized with default all LED strip intensity parameter.',
},
defaultLed2IntensityWhenOff: {
ID: 68,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 101,
description: 'Intesity of LED strip when off. 101 = Synchronized with default all LED strip intensity parameter.',
},
defaultLed3ColorWhenOn: {
ID: 70,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 255,
description:
'0-254:This is the color of the LED strip in a hex representation. 255:Synchronization with default all LED strip color parameter.',
},
defaultLed3ColorWhenOff: {
ID: 71,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 255,
description:
'0-254:This is the color of the LED strip in a hex representation. 255:Synchronization with default all LED strip color parameter.',
},
defaultLed3IntensityWhenOn: {
ID: 72,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 101,
description: 'Intesity of LED strip when on. 101 = Synchronized with default all LED strip intensity parameter.',
},
defaultLed3IntensityWhenOff: {
ID: 73,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 101,
description: 'Intesity of LED strip when off. 101 = Synchronized with default all LED strip intensity parameter.',
},
defaultLed4ColorWhenOn: {
ID: 75,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 255,
description:
'0-254:This is the color of the LED strip in a hex representation. 255:Synchronization with default all LED strip color parameter.',
},
defaultLed4ColorWhenOff: {
ID: 76,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 255,
description:
'0-254:This is the color of the LED strip in a hex representation. 255:Synchronization with default all LED strip color parameter.',
},
defaultLed4IntensityWhenOn: {
ID: 77,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 101,
description: 'Intesity of LED strip when on. 101 = Synchronized with default all LED strip intensity parameter.',
},
defaultLed4IntensityWhenOff: {
ID: 78,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 101,
description: 'Intesity of LED strip when off. 101 = Synchronized with default all LED strip intensity parameter.',
},
defaultLed5ColorWhenOn: {
ID: 80,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 255,
description:
'0-254:This is the color of the LED strip in a hex representation. 255:Synchronization with default all LED strip color parameter.',
},
defaultLed5ColorWhenOff: {
ID: 81,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 255,
description:
'0-254:This is the color of the LED strip in a hex representation. 255:Synchronization with default all LED strip color parameter.',
},
defaultLed5IntensityWhenOn: {
ID: 82,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 101,
description: 'Intesity of LED strip when on. 101 = Synchronized with default all LED strip intensity parameter.',
},
defaultLed5IntensityWhenOff: {
ID: 83,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 101,
description: 'Intesity of LED strip when off. 101 = Synchronized with default all LED strip intensity parameter.',
},
defaultLed6ColorWhenOn: {
ID: 85,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 255,
description:
'0-254:This is the color of the LED strip in a hex representation. 255:Synchronization with default all LED strip color parameter.',
},
defaultLed6ColorWhenOff: {
ID: 86,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 255,
description:
'0-254:This is the color of the LED strip in a hex representation. 255:Synchronization with default all LED strip color parameter.',
},
defaultLed6IntensityWhenOn: {
ID: 87,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 101,
description: 'Intesity of LED strip when on. 101 = Synchronized with default all LED strip intensity parameter.',
},
defaultLed6IntensityWhenOff: {
ID: 88,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 101,
description: 'Intesity of LED strip when off. 101 = Synchronized with default all LED strip intensity parameter.',
},
defaultLed7ColorWhenOn: {
ID: 90,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 255,
description:
'0-254:This is the color of the LED strip in a hex representation. 255:Synchronization with default all LED strip color parameter.',
},
defaultLed7ColorWhenOff: {
ID: 91,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 255,
description:
'0-254:This is the color of the LED strip in a hex representation. 255:Synchronization with default all LED strip color parameter.',
},
defaultLed7IntensityWhenOn: {
ID: 92,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 101,
description: 'Intesity of LED strip when on. 101 = Synchronized with default all LED strip intensity parameter.',
},
defaultLed7IntensityWhenOff: {
ID: 93,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 101,
description: 'Intesity of LED strip when off. 101 = Synchronized with default all LED strip intensity parameter.',
},
doubleTapClearNotifications: {
ID: 262,
dataType: Zcl.DataType.BOOLEAN,
min: 0,
max: 1,
description: 'Double-Tap the Config button to clear notifications.',
values: {'Enabled (Default)': 0, Disabled: 1},
displayType: 'enum',
},
fanLedLevelType: {
ID: 263,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 10,
values: {'Limitless (like VZM31)': 0, 'Adaptive LED': 10},
description: 'Level display of the LED Strip',
},
};
/**
* Common Dimmer Attributes
*
* These attributes are shared between all devices that act like dimmers (including dimmers + fan switches) with
* the manufacturer specific Inovelli cluster. These are not shared with on/off switches.
* Some of the descriptions, max, min or value properties may be overridden for each device
*/
const COMMON_DIMMER_ATTRIBUTES: {[s: string]: Attribute} = {
...COMMON_ATTRIBUTES,
minimumLevel: {
ID: 9,
dataType: Zcl.DataType.UINT8,
min: 1,
max: 254,
description:
'The minimum level that the dimmer allows the bulb to be dimmed to. ' +
'Useful when the user has an LED bulb that does not turn on or flickers at a lower level.',
},
maximumLevel: {
ID: 10,
dataType: Zcl.DataType.UINT8,
min: 2,
max: 255,
description:
'The maximum level that the dimmer allows the bulb to be dimmed to.' +
'Useful when the user has an LED bulb that reaches its maximum level before the ' +
'dimmer value of 99 or when the user wants to limit the maximum brightness.',
},
powerType: {
ID: 21,
dataType: Zcl.DataType.BOOLEAN,
displayType: 'enum',
values: {'Non Neutral': 0, Neutral: 1},
min: 0,
max: 1,
readOnly: true,
description: 'Set the power type for the device.',
},
outputMode: {
ID: 258,
min: 0,
max: 1,
values: {Dimmer: 0, 'On/Off': 1},
dataType: Zcl.DataType.BOOLEAN,
description: 'Use device as a Dimmer or an On/Off switch.',
displayType: 'enum',
},
};
/**
* Common Dimmable light Attributes
*
* These attributes are shared between all devices that are dimmable light switches with
* the manufacturer specific Inovelli cluster. These are not shared with fans or on/off switches.
* Some of the descriptions, max, min or value properties may be overridden for each device
*/
const COMMON_DIMMABLE_LIGHT_ATTRIBUTES: {[s: string]: Attribute} = {
quickStartTime: {
ID: 23,
dataType: Zcl.DataType.UINT8,
min: 0,
max: 60,
description: 'Duration of full power output while lamp transitions from Off to On. In 60th of second. 0 = disable, 1 = 1/60s, 60 = 1s',