forked from Koenkk/zigbee-herdsman-converters
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyokis.ts
2748 lines (2555 loc) · 119 KB
/
yokis.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 {ClusterDefinition} from 'zigbee-herdsman/dist/zspec/zcl/definition/tstype';
import tz from '../converters/toZigbee';
import * as exposes from '../lib/exposes';
import {logger} from '../lib/logger';
import * as m from '../lib/modernExtend';
import {DefinitionWithExtend, KeyValueAny, ModernExtend, Tz} from '../lib/types';
import * as utils from '../lib/utils';
// #region Constants
const e = exposes.presets;
const ea = exposes.access;
// const manufacturerOptions = {manufacturerCode: Zcl.ManufacturerCode.YOKIS};
const NS = 'zhc:yokis';
// stateAfterBlinkEnum (manuSpecificYokisLightControl)
const stateAfterBlinkEnum: {[s: string]: number} = {
previous: 0x00,
off: 0x01,
on: 0x02,
infinite: 0x03,
};
// resetActionEnum (manuSpecificYokisDevice)
const resetActionEnum: {[s: string]: number} = {
factory_reset: 0x00,
configuration_reset: 0x01,
network_reset: 0x02,
};
// inputModeEnum (manuSpecificYokisInput)
const inputModeEnum: {[s: string]: number} = {
unknown: 0x00,
push_button: 0x01, // default
switch: 0x02,
relay: 0x03,
fp_in: 0x04, // Fil pilote
};
// #endregion
// #region Custom cluster definition
const YokisClustersDefinition: {
[s: string]: ClusterDefinition;
} = {
manuSpecificYokisDevice: {
ID: 0xfc01,
manufacturerCode: Zcl.ManufacturerCode.YOKIS,
attributes: {
// Indicate if the device configuration has changed. 0 to 0xFFFE -> No Change, 0xFFFF -> Change have been detected
configurationChanged: {ID: 0x0005, type: Zcl.DataType.UINT16},
},
commands: {
// Reset setting depending on RESET ACTION value
resetToFactorySettings: {
ID: 0x00,
response: 0,
parameters: [
// 0x00 -> Factory reset, 0x01 -> Configuration Reset, 0x02 -> Network Reset
{name: 'uc_ResetAction', type: Zcl.DataType.INT8},
],
},
// Relaunch BLE advertising for 15 minutes
relaunchBleAdvert: {
ID: 0x11,
response: 0,
parameters: [],
},
// Open ZigBee network
openNetwork: {
ID: 0x12,
response: 0,
parameters: [
// Opening time wanted from 1 to 255 seconds,0 means closing the network.
{name: 'uc_OpeningTime', type: Zcl.DataType.INT8},
],
},
},
commandsResponse: {},
},
manuSpecificYokisInput: {
ID: 0xfc02,
manufacturerCode: Zcl.ManufacturerCode.YOKIS,
attributes: {
// Indicate how the input should be handle: 0 -> Unknow, 1 -> Push button, 2 -> Switch, 3 -> Relay, 4 -> FP_IN
inputMode: {ID: 0x0000, type: Zcl.DataType.ENUM8},
// Indicate the contact nature of the entry: 0 -> NC, 1 -> NO
contactMode: {ID: 0x0001, type: Zcl.DataType.BOOLEAN},
// Indicate the last known state of the local BP (Bouton Poussoir, or Push Button)
lastLocalCommandState: {ID: 0x0002, type: Zcl.DataType.BOOLEAN},
// Indicate the last known state of the Bp connect
lastBPConnectState: {ID: 0x0003, type: Zcl.DataType.BOOLEAN},
// Indicate the backlight intensity applied on the keys. Only use for “Simon” product. Default: 0x0A, Min-Max: 0x00 - 0x64
backlightIntensity: {ID: 0x0004, type: Zcl.DataType.UINT8},
},
commands: {
// Send to the server cluster a button press
sendPress: {
ID: 0x00,
parameters: [],
},
// Send to the server cluster a button release
sendRelease: {
ID: 0x01,
parameters: [],
},
// Change the Input mode to use switch input, wired relay or simple push button
selectInputMode: {
ID: 0x02,
parameters: [
// Input mode to be set. See @inputMode
{name: 'uc_InputMode', type: Zcl.DataType.UINT8},
],
},
},
commandsResponse: {},
},
manuSpecificYokisEntryConfigurator: {
ID: 0xfc03,
manufacturerCode: Zcl.ManufacturerCode.YOKIS,
attributes: {
// Use to enable short press action
eShortPress: {ID: 0x0001, type: Zcl.DataType.BOOLEAN},
// Use to enable long press action
eLongPress: {ID: 0x0002, type: Zcl.DataType.BOOLEAN},
// Define long Press duration in milliseconds. Default: 0x0BB8, Min-Max: 0x00 - 0x1388
longPressDuration: {ID: 0x0003, type: Zcl.DataType.UINT16},
// Define the maximum time between 2 press to keep in a sequence (In milliseconds). Default: 0x01F4, Min-Max: 0x0064 - 0x0258
timeBetweenPress: {ID: 0x0004, type: Zcl.DataType.UINT16},
// Enable R12M Long Press action
eR12MLongPress: {ID: 0x0005, type: Zcl.DataType.BOOLEAN},
// Disable local configuration
eLocalConfigLock: {ID: 0x0006, type: Zcl.DataType.BOOLEAN},
},
commands: {},
commandsResponse: {},
},
manuSpecificYokisSubSystem: {
ID: 0xfc04,
manufacturerCode: Zcl.ManufacturerCode.YOKIS,
attributes: {
// Define the device behavior after power failure : 0 -> LAST STATE, 1 -> OFF, 2 -> ON, 3-> BLINK
powerFailureMode: {ID: 0x0001, type: Zcl.DataType.ENUM8},
},
commands: {},
commandsResponse: {},
},
manuSpecificYokisLoadManager: {
ID: 0xfc05, // Details coming soon
manufacturerCode: Zcl.ManufacturerCode.YOKIS,
attributes: {},
commands: {},
commandsResponse: {},
},
manuSpecificYokisLightControl: {
ID: 0xfc06,
manufacturerCode: Zcl.ManufacturerCode.YOKIS,
attributes: {
// Use to know which state is the relay
onOff: {ID: 0x0000, type: Zcl.DataType.BOOLEAN},
// Indicate the previous state before action
prevState: {ID: 0x0001, type: Zcl.DataType.BOOLEAN},
// Define the ON embedded timer duration in seconds. Default: 0x00, Min-Max: 0x00 – 0x00409980
onTimer: {ID: 0x0002, type: Zcl.DataType.UINT32},
// Enable (0x01) / Disable (0x00) use of onTimer.
eOnTimer: {ID: 0x0003, type: Zcl.DataType.BOOLEAN},
// Define the PRE-ON embedded delay in seconds. Default: 0x00, Min-Max: 0x00 – 0x00409980
preOnDelay: {ID: 0x0004, type: Zcl.DataType.UINT32},
// Enable (0x01) / Disable (0x00) use of PreOnTimer.
ePreOnDelay: {ID: 0x0005, type: Zcl.DataType.BOOLEAN},
// Define the PRE-OFF embedded delay in seconds. Default: 0x00, Min-Max: 0x00 – 0x00409980
preOffDelay: {ID: 0x0008, type: Zcl.DataType.UINT32},
// Enable (0x01) / Disable (0x00) PreOff delay.
ePreOffDelay: {ID: 0x0009, type: Zcl.DataType.BOOLEAN},
// Set the value of ON pulse length. Default: 0x01F4, Min-Max: 0x0014 – 0xFFFE
pulseDuration: {ID: 0x000a, type: Zcl.DataType.UINT16},
// Indicates the current Type of time selected that will be used during push button configuration: 0x00 -> Seconds, 0x01 -> Minutes
timeType: {ID: 0x000b, type: Zcl.DataType.ENUM8},
// Set the value of the LONG ON embedded timer in seconds. Default: 0x5460 (1h), Min-Max: 0x00 – 0x00409980
longOnDuration: {ID: 0x000c, type: Zcl.DataType.UINT32},
// Indicates the operating mode: 0x00 -> Timer, 0x01 -> Staircase, 0x02 -> Pulse
operatingMode: {ID: 0x000d, type: Zcl.DataType.ENUM8},
// Time before goes off after the stop announce blinking. (In seconds). Default: 0x0000, Min-Max: 0x00 – 0x00409980
stopAnnounceTime: {ID: 0x0013, type: Zcl.DataType.UINT32},
// Enable (0x01) / Disable (0x00) the announcement before turning OFF.
eStopAnnounce: {ID: 0x0014, type: Zcl.DataType.BOOLEAN},
// Enable (0x01) / Disable (0x00) Deaf Actions.
eDeaf: {ID: 0x0015, type: Zcl.DataType.BOOLEAN},
// Enable (0x01) / Disable (0x00) Blink Actions.
eBlink: {ID: 0x0016, type: Zcl.DataType.BOOLEAN},
// Number of blinks done when receiving the corresponding order. One blink is considered as one ON step followed by one OFF step.
// Default: 0x03, Min-Max: 0x00 – 0x14
blinkAmount: {ID: 0x0017, type: Zcl.DataType.UINT8},
// Duration for the ON time on a blink period (In millisecond). Default: 0x000001F4, Min-Max: 0x00 – 0x00409980
blinkOnTime: {ID: 0x0018, type: Zcl.DataType.UINT32},
// Duration for the OFF time on a blink period (In millisecond). Default: 0x000001F4, Min-Max: 0x00 – 0x00409980
blinkOffTime: {ID: 0x0019, type: Zcl.DataType.UINT32},
// Define number of blink to do when receiving the DEAF action. One blink is considered as one ON step followed by one OFF step.
// Default: 0x03, Min-Max: 0x00 – 0x14
deafBlinkAmount: {ID: 0x001a, type: Zcl.DataType.UINT8},
// Define duration of a blink ON (In millisecond). Default: 0x0320, Min-Max: 0x0064– 0x4E20
deafBlinkTime: {ID: 0x001b, type: Zcl.DataType.UINT16},
// Indicate which state must be apply after a blink sequence: 0x00 -> State before blinking, 0x01 -> OFF, 0x02 -> ON
stateAfterBlink: {ID: 0x001c, type: Zcl.DataType.ENUM8},
// Define the output relay as Normaly close.
eNcCommand: {ID: 0x001d, type: Zcl.DataType.BOOLEAN},
},
commands: {
// Move to position specified in uc_BrightnessEnd parameter.
// If TOR mode or MTR is set (no dimming) : if uc_BrightnessEnd under 50% will set to OFF else will be set to ON
moveToPosition: {
ID: 0x02,
parameters: [
{name: 'uc_BrightnessStart', type: Zcl.DataType.UINT8},
{name: 'uc_BrightnessEnd', type: Zcl.DataType.UINT8},
{name: 'ul_PreTimerValue', type: Zcl.DataType.UINT32},
{name: 'b_PreTimerEnable', type: Zcl.DataType.BOOLEAN},
{name: 'ul_TimerValue', type: Zcl.DataType.UINT32},
{name: 'b_TimerEnable', type: Zcl.DataType.BOOLEAN},
{name: 'ul_TransitionTime', type: Zcl.DataType.UINT32},
],
},
// This command allows the relay to be controlled with an impulse. The pulse time is defined by PulseLength.
pulse: {
ID: 0x04,
parameters: [{name: 'PulseLength', type: Zcl.DataType.UINT16}],
},
// With this command, the module is asked to perform a blinking sequence.
blink: {
ID: 0x05,
parameters: [
{name: 'uc_BlinkAmount', type: Zcl.DataType.UINT8},
{name: 'ul_BlinkOnPeriod', type: Zcl.DataType.UINT32},
{name: 'ul_BlinkOffPeriod', type: Zcl.DataType.UINT32},
{name: 'uc_StateAfterSequence', type: Zcl.DataType.UINT8},
{name: 'b_DoPeriodicCycle', type: Zcl.DataType.BOOLEAN},
],
},
// Start a deaf sequene on a device only if the attribute “eDeaf” is set to Enable.
deafBlink: {
ID: 0x06,
parameters: [
{name: 'uc_BlinkAmount', type: Zcl.DataType.UINT8},
{name: 'ul_BlinkOnTime', type: Zcl.DataType.UINT16},
{name: 'uc_SequenceAmount', type: Zcl.DataType.UINT8},
{name: 'tuc_BlinkAmount', type: Zcl.DataType.ARRAY},
],
},
// Switch output ON for LONG ON DURATION time.
longOn: {
ID: 0x07,
parameters: [],
},
},
commandsResponse: {},
},
manuSpecificYokisDimmer: {
ID: 0xfc07,
manufacturerCode: Zcl.ManufacturerCode.YOKIS,
attributes: {
// This attribute defines the current position, in %. Default: 0x00, Min-Max: 0x00 - 0x64
currentPosition: {ID: 0x0000, type: Zcl.DataType.UINT8},
// This attribute defines the memory position, in %. Default: 0x00, Min-Max: 0x00 - 0x64
memoryPosition: {ID: 0x0001, type: Zcl.DataType.UINT8},
// This attribute defines if a ramp up should be used or not.
eRampUp: {ID: 0x0002, type: Zcl.DataType.BOOLEAN},
// This attribute defines the time taken during the ramp up in ms. Default: 0x000003E8, Min-Max: 0x00000000 – 0x05265C00
rampUp: {ID: 0x0003, type: Zcl.DataType.UINT32},
// This attribute defines if a ramp down should be used or not.
eRampDown: {ID: 0x0004, type: Zcl.DataType.BOOLEAN},
// This attribute defines the time taken during the ramp down in ms. Default: 0x000003E8, Min-Max: 0x00000000 – 0x05265C00
rampDown: {ID: 0x0005, type: Zcl.DataType.UINT32},
// This attribute defines the time taken during the ramp loop in ms. Default: 0x00000FA0, Min-Max: 0x00000000 – 0x05265C00
rampContinuousTime: {ID: 0x0006, type: Zcl.DataType.UINT32},
// This attribute defines the value of each step during a dimming up. This value is set in %. Default: 0x01, Min-Max: 0x00 - 0x64
stepUp: {ID: 0x0007, type: Zcl.DataType.UINT8},
// This attribute defines the value of the low dim limit, used during a dimming loop, on a long press for example. This value is set in %. Default: 0x06, Min-Max: 0x00 - 0x64
lowDimLimit: {ID: 0x0008, type: Zcl.DataType.UINT8},
// This attribute defines the value of the high dim limit, used during a dimming loop, on a long press for example. This value is set in %. Default: 0x64, Min-Max: 0x00 - 0x64
highDimLimit: {ID: 0x0009, type: Zcl.DataType.UINT8},
// This attribute defines the time before the nightlight begin. This value is set in seconds. Default: 0x00000000, Min-Max: 0x00000000 – 0xFFFFFFFE
nightLightStartingDelay: {ID: 0x000c, type: Zcl.DataType.UINT32},
// This attribute defines the dimming value at the start of the nightlight. This value is set in %. Default: 0x28, Min-Max: 0x00 - 0x64
nightLightStartingBrightness: {ID: 0x000d, type: Zcl.DataType.UINT8},
// This attribute defines the dimming value at the last step of the nightlight. This attribute must be lower than 0x000D :Nightlight starting brightness. This value is set in %. Default: 0x05, Min-Max: 0x00 - 0x64
nightLightEndingBrightness: {ID: 0x000e, type: Zcl.DataType.UINT8},
// This attribute defines the ramp duration of the nightlight. The ramp is running after the end of the starting delay and until the ending bright is reached. This value is set in seconds. Default: 0x00000E10, Min-Max: 0x00000000 – 0x05265C00
nightLightRampTime: {ID: 0x000f, type: Zcl.DataType.UINT32},
// This attribute defines the total duration of the nightlight. It must not be lower than 0x000F : Nightlight ramp time. This value is set in seconds. Default: 0x00000E10, Min-Max: 0x00000000 – 0x05265C00
nightLightOnTime: {ID: 0x0010, type: Zcl.DataType.UINT32},
// This attribute defines the value of the favorite position 1. This value is set in %. Default: 0x19, Min-Max: 0x00 - 0x64
favoritePosition1: {ID: 0x0011, type: Zcl.DataType.UINT8},
// This attribute defines the value of the favorite position 2. This value is set in %. Default: 0x32, Min-Max: 0x00 - 0x64
favoritePosition2: {ID: 0x0012, type: Zcl.DataType.UINT8},
// This attribute defines the value of the favorite position 3. This value is set in %. Default: 0x4B, Min-Max: 0x00 - 0x64
favoritePosition3: {ID: 0x0013, type: Zcl.DataType.UINT8},
// This attribute enables or disables the 2-step controller mode. This mode enable product to run without any ramp before and after ON or OFF. It acts like a relay.
stepControllerMode: {ID: 0x0014, type: Zcl.DataType.BOOLEAN},
// This attribute enables or disables the memory position mode at first push button release.
memoryPositionMode: {ID: 0x0015, type: Zcl.DataType.BOOLEAN},
// This attribute defines the value of each step during a dimming down. This value is set in %. Default: 0x01, Min-Max: 0x01 - 0x64
stepDown: {ID: 0x0016, type: Zcl.DataType.UINT8},
// This attribute defines the value of each step during a dimming loop. This value is set in %. Default: 0x01, Min-Max: 0x01 - 0x64
stepContinuous: {ID: 0x0017, type: Zcl.DataType.UINT8},
// This attribute defines the value of each step during the ramp down of the nightlight mode. This value is set in %. Default: 0x01, Min-Max: 0x01 - 0x64
stepNightLight: {ID: 0x0018, type: Zcl.DataType.UINT8},
},
commands: {
// Start dimming up, from current position to the upper dim limit. When the limit is reached, stay at this position.
dimUp: {
ID: 0x00,
parameters: [],
},
// Start dimming down, from current position to the lower dim limit. When the limit is reached, stay at this position.
dimDown: {
ID: 0x01,
parameters: [],
},
// Start the dimming loop process for the selected duration.
dim: {
ID: 0x02,
parameters: [
// Set the duration of the ramp for the continuous variation, otherwise use 0xFFFFFFFF to use the one configured in the product. Value is in ms.
{name: 'ul_RampContinuousDuration', type: Zcl.DataType.UINT32},
// Set the step size, otherwise use 0xFF to use the one configured in the product.. Value is in %.
{name: 'uc_StepContinuous', type: Zcl.DataType.UINT8},
],
},
// Stop the actual dimming process.
dimStop: {
ID: 0x04,
parameters: [],
},
// Start dimming to the min value set in the device.
dimToMin: {
ID: 0x05,
parameters: [
// Set the transition time to the selected value, otherwise use 0xFFFFFFFF to use the one configured in the product. Value is in ms.
{name: 'ul_TransitionTime', type: Zcl.DataType.UINT32},
],
},
// Start dimming to the max value set in the device.
dimToMax: {
ID: 0x06,
parameters: [
// Set the transition time to the selected value, otherwise use 0xFFFFFFFF to use the one configured in the product. Value is in ms.
{name: 'ul_TransitionTime', type: Zcl.DataType.UINT32},
],
},
// Start the nightlight mode with the given parameters.
startNightLightMode: {
ID: 0x07,
parameters: [
// Set the starting delay value, used before the start of the nightlight, otherwise use 0xFFFFFFFF to use the one configured in the product. Value is in ms.
{name: 'ul_ChildModeStartingDelay', type: Zcl.DataType.UINT32},
// Set the brightness at the beginning of the ramp, otherwise use 0xFF to use the one configured in the product. Value is in %.
{name: 'uc_ChildModeBrightnessStart', type: Zcl.DataType.UINT8},
// Set the brightness at the end of the ramp, otherwise use 0xFF to use the one configured in the product. Value is in %.
{name: 'uc_ChildModeBrightnessEnd', type: Zcl.DataType.UINT8},
// Set the ramp duration, otherwise use 0xFFFFFFFF to use the one configured in the product. Value is in ms.
{name: 'ul_ChildModeRampDuration', type: Zcl.DataType.UINT32},
// Set the total duration of the nightlight, otherwise use 0xFFFFFFFF to use the one configured in the product. Value is in ms.
{name: 'ul_ChildModeOnDuration', type: Zcl.DataType.UINT32},
// Set the step size between each dim, otherwise use 0xFF to use the one configured in the product. Value is in %.
{name: 'uc_ChildStep', type: Zcl.DataType.UINT8},
],
},
// Start the nightlight mode from the current dimming value.
startNightLightModeCurrent: {
ID: 0x08,
parameters: [],
},
// Start dimming to the favorite position 1.
moveToFavorite1: {
ID: 0x09,
parameters: [],
},
// Start dimming to the favorite position 2.
moveToFavorite2: {
ID: 0x0a,
parameters: [],
},
// Start dimming to the favorite position 3.
moveToFavorite3: {
ID: 0x0b,
parameters: [],
},
},
commandsResponse: {},
},
manuSpecificYokisWindowCovering: {
ID: 0xfc08, // Details coming soon
manufacturerCode: Zcl.ManufacturerCode.YOKIS,
attributes: {},
commands: {},
commandsResponse: {},
},
manuSpecificYokisChannel: {
ID: 0xfc09, // Details coming soon
manufacturerCode: Zcl.ManufacturerCode.YOKIS,
attributes: {
// Define the command to send to the servers using cluster On/Off. 0x00 -> toggle, 0x01 -> ON, 0x02 -> OFF, 0x03 -> OFF
onOffClusterMode: {ID: 0x0000, type: Zcl.DataType.ENUM8},
// Define the command to send to the servers using cluster Level control. 0x00 -> nothing, 0x01 -> Move up, 0x02 -> Move down, 0x03 -> stop
levelControlClusterMode: {ID: 0x0001, type: Zcl.DataType.ENUM8},
// Define the command to send to the servers using cluster Window Covering. 0x00 -> toggle, 0x01 -> up/open, 0x02 -> down/close, 0x03 -> stop
windowCoveringClusterMode: {ID: 0x0002, type: Zcl.DataType.ENUM8},
// Defines the cluster that will be used by the channel to create an order. Default: 0xFFF0, Min-Max: 0x0000 – 0xFFFF
clusterToBeUsed: {ID: 0x0003, type: Zcl.DataType.UINT16},
// Define the channel sending mode. 0x00 -> Direct, 0x01 -> Broadcast, 0x02 -> Group
sendingMode: {ID: 0x0004, type: Zcl.DataType.ENUM8},
// Define the light control mode used between remote and the binded device. 0x00 -> Mode pulse, 0x01 -> Mode deaf
yokisLightControlMode: {ID: 0x0005, type: Zcl.DataType.ENUM8},
// Define the command to send to the servers using cluster Yokis Pilot Wire. 0x00 -> toggle, 0x01 -> confort, 0x02 -> eco
yokisPilotWireClusterMode: {ID: 0x0006, type: Zcl.DataType.ENUM8},
// Indicate the group id who will receive the command from the dedicated endpoint. Default: 0x0000, Min-Max: 0x0000 – 0xFFFF
groupId: {ID: 0x0007, type: Zcl.DataType.UINT16},
},
commands: {},
commandsResponse: {},
},
manuSpecificYokisPilotWire: {
ID: 0xfc0a,
manufacturerCode: Zcl.ManufacturerCode.YOKIS,
attributes: {
// Represent the actual order used by the device. Default: 0x02, Min-Max: 0x00 - 0xF1. Reportable, not writable
actualOrder: {ID: 0x0000, type: Zcl.DataType.UINT8},
// Define the “Order” embedded timer duration. This timer is set when the device changes its order (in second). After that duration, the device is set back to its fallback order. Default: 0x00000000, Min-Max: 0x00000000 - 0xFFFFFFFF
orderTimer: {ID: 0x0001, type: Zcl.DataType.UINT32},
// Define the duration before an order is set. This timer is used when a new order is asked, it corresponds to the time before this order is applied. The duration is set in second. Default: 0x00000000, Min-Max: 0x00000000 - 0xFFFFFFFF
preOrderTimer: {ID: 0x0002, type: Zcl.DataType.UINT32},
// Represent the actual unit used for local command configuration : 0x00 -> Second, 0x01 -> Minutes. Default: 0x00, Min-Max: 0x00 - 0x01.
timerUnit: {ID: 0x0003, type: Zcl.DataType.UINT8},
// Define the product’s LED behavior: 0x00 -> LED is always ON and blink during radio activity, 0x01 -> LED is only OFF during few seconds after a mode transition. Default: 0x00, Min-Max: 0x00 - 0x01.
ledMode: {ID: 0x0004, type: Zcl.DataType.UINT8},
// Define if the product must be set into pilot wire relay mode: 0x00 -> Relay mode is deactivated, 0x01 -> Relay mode is activated. Default: 0x00, Min-Max: 0x00 - 0x01.
pilotWireRelayMode: {ID: 0x0005, type: Zcl.DataType.UINT8},
// Define the order scrolling sense: 0x00 -> Forward : Confort -> Confort – 1 -> Confort – 2 -> Eco -> Hors-Gel -> Arrêt, 0x01 -> Backward : Arrêt -> Hors-Gel -> Eco -> Confort – 2 -> Confort – 1 -> Confort. Default: 0x00, Min-Max: 0x00 - 0x01.
orderScrollingMode: {ID: 0x0006, type: Zcl.DataType.UINT8},
// Define the number of orders supported by the device: 0x00 -> 4 orders (Confort, Eco, Hors-Gel, Arrêt), 0x01 -> 6 orders (Confort, Confort – 1, Confort – 2, Eco, Hors-Gel, Arrêt). Default: 0x01, Min-Max: 0x00 - 0x01.
orderNumberSupported: {ID: 0x0007, type: Zcl.DataType.UINT8},
// Represent the fallback order used by the device after the end of an order timer is reached: 0x00 -> Stop, 0x01 -> Frost-off, 0x02 -> Eco, 0x03 -> Confort-2, 0x04 -> Confort-1, 0x05 -> Confort. Default: 0x02, Min-Max: 0x00 - 0x05.
fallbackOrder: {ID: 0x0008, type: Zcl.DataType.UINT8},
},
commands: {
// Set the device in the specified order.
setOrder: {
ID: 0x00,
parameters: [
// Order to be set : 0x00 -> Stop, 0x01 -> Frost-off, 0x02 -> Eco, 0x03 -> Confort-2, 0x04 -> Confort-1, 0x05 -> Confort
{name: 'uc_Order', type: Zcl.DataType.UINT8},
],
},
// Toggle between order by respecting the scrolling order.
toggleOrder: {
ID: 0x01,
parameters: [],
},
},
commandsResponse: {},
},
manuSpecificYokisTemperatureMeasurement: {
ID: 0xfc0b,
manufacturerCode: Zcl.ManufacturerCode.YOKIS,
attributes: {
// This attribute represents the last value measured. The unit is in 0.01 °C (12,25°C -> 1225). Default: 0x0000, Min-Max: 0x954D - 0x7FFE. Reportable, not writable
currentValue: {ID: 0x0000, type: Zcl.DataType.INT16},
// Represent the minimal value set since the last power-on/reset. The unit is in 0.01 °C (12,25°C -> 1225). Default: 0x7FFE , Min-Max: 0x954D - 0x7FFE. Reportable, not writable
minMeasuredValue: {ID: 0x0001, type: Zcl.DataType.INT16},
// Represent the maximal value set since the last power-on/reset. The unit is in 0.01 °C (12,25°C -> 1225). Default: 0x954D , Min-Max: 0x954D - 0x7FFE. Reportable, not writable
maxMeasuredValue: {ID: 0x0002, type: Zcl.DataType.INT16},
// Represent the offset applicated to the temperature measured. The unit is in 0,1°C (1,5°C -> 15). Default: 0x00, Min-Max: 0xCE (-50) - 0x32 (50).
offset: {ID: 0x0003, type: Zcl.DataType.INT8},
// Represent the sampling period used to process the temperature measurement. The unit is in seconds. Default: 0x0A, Min-Max: 0x01 - 0x78.
samplingPeriod: {ID: 0x0004, type: Zcl.DataType.UINT8},
// Represents the sampling number to sense per sampling period defined before. Default: 0x03, Min-Max: 0x01 - 0x14.
samplingNumber: {ID: 0x0005, type: Zcl.DataType.UINT8},
// Represents the temperature variation to request a new temperature sending through reports. The unit is in 0,1°C (0,5°C ->5). Default: 0x00, Min-Max: 0x00 - 0x0A.
deltaTemp: {ID: 0x0006, type: Zcl.DataType.UINT8},
// Represents the minimal sending period that the device must respect before sending a new value through reporting. A writing on this attribute will update all reporting entries related to the temperature measurement. Default: 0x0A, Min-Max: 0x0000 - 0xFFFF.
minimalSendingPeriod: {ID: 0x0007, type: Zcl.DataType.UINT16},
// Represents the maximal sending period. The device must send a new value through reporting before the end of this period. A writing on this attribute will update all reporting entries related to the temperature measurement. Default: 0x0A, Min-Max: 0x0000 - 0xFFFF.
maximalSendingPeriod: {ID: 0x0008, type: Zcl.DataType.UINT16},
},
commands: {
// Reset the Min and Max temperature value information.
minMaxReset: {
ID: 0x00,
parameters: [],
},
},
commandsResponse: {},
},
manuSpecificYokisStats: {
ID: 0xfcf0, // Details coming soon
manufacturerCode: Zcl.ManufacturerCode.YOKIS,
attributes: {},
commands: {},
commandsResponse: {},
},
};
// #endregion
// #region Extension definition
// Checks definition
const yokisExtendChecks = {
parseResetInput: (input: string) => {
if (!input) {
throw new Error(`MISSING_INPUT`);
}
if (!Object.keys(resetActionEnum).includes(input)) {
throw new Error(`INVALID_RESET_ACTION`);
}
return {
payload: {
uc_ResetAction: utils.getFromLookup(input, resetActionEnum),
},
};
},
parseOpenNetworkInput: (input: KeyValueAny) => {
if (!input || typeof input !== 'object') {
throw new Error(`NOT_OBJECT`);
}
if (!('opening_time' in input) || !utils.isNumber(input.opening_time)) {
throw new Error(`INVALID_OPENNETWORK_OPENINGTIME`);
}
return {
payload: {
uc_OpeningTime: input.opening_time,
},
};
},
parseInputModeInput: (input: KeyValueAny) => {
if (!input || typeof input !== 'object') {
throw new Error(`NOT_OBJECT`);
}
if (!('select_input_mode' in input) || !Object.keys(inputModeEnum).includes(input.select_input_mode)) {
throw new Error(`INVALID_INPUTMODE`);
}
return {
payload: {
uc_InputMode: utils.getFromLookup(input.select_input_mode, inputModeEnum),
},
};
},
parseMoveToPositionInput: (input: KeyValueAny) => {
if (!input || typeof input !== 'object') {
throw new Error(`NOT_OBJECT`);
}
if (!('brightness_start' in input) || !utils.isNumber(input.brightness_start)) {
throw new Error(`INVALID_MOVE_BRIGHTNESSSTART`);
}
if (!('brightness_end' in input) || !utils.isNumber(input.brightness_end)) {
throw new Error(`INVALID_MOVE_BRIGHTNESSEND`);
}
if (!('pre_timer_value' in input) || !utils.isNumber(input.pre_timer_value)) {
throw new Error(`INVALID_MOVE_PRETIMERVALUE`);
}
if (!('enable_pre_timer' in input) || !utils.isBoolean(input.enable_pre_timer)) {
throw new Error(`INVALID_MOVE_PRETIMERENABLE`);
}
if (!('timer_value' in input) || !utils.isNumber(input.timer_value)) {
throw new Error(`INVALID_MOVE_TIMERVALUE`);
}
if (!('enable_timer' in input) || !utils.isBoolean(input.enable_timer)) {
throw new Error(`INVALID_MOVE_TIMERENABLE`);
}
if (!('transition_time' in input) || !utils.isNumber(input.transition_time)) {
throw new Error(`INVALID_MOVE_TRANSITIONTIME`);
}
return {
payload: {
uc_BrightnessStart: input.brightness_start,
uc_BrightnessEnd: input.brightness_end,
ul_PreTimerValue: input.pre_timer_value,
b_PreTimerEnable: input.enable_pre_timer ? 1 : 0,
ul_TimerValue: input.timer_value,
b_TimerEnable: input.enable_timer ? 1 : 0,
ul_TransitionTime: input.transition_time,
},
};
},
parseBlinkInput: (input: KeyValueAny) => {
if (!input || typeof input !== 'object') {
throw new Error(`NOT_OBJECT`);
}
if (!('blink_amount' in input) || !utils.isNumber(input.blink_amount)) {
throw new Error(`INVALID_BLINK_BLINKAMOUNT`);
}
if (!('blink_on_period' in input) || !utils.isNumber(input.blink_on_period)) {
throw new Error(`INVALID_BLINK_BLINKONPERIOD`);
}
if (!('blink_off_period' in input) || !utils.isNumber(input.blink_off_period)) {
throw new Error(`INVALID_BLINK_BLINKOFFPERIOD`);
}
if (!('state_after_sequence' in input) || !Object.keys(stateAfterBlinkEnum).includes(input.state_after_sequence)) {
throw new Error(`MISSING_BLINK_STATEAFTERSEQUENCE`);
}
if (!('do_periodic_cycle' in input) || !utils.isBoolean(input.do_periodic_cycle)) {
throw new Error(`INVALID_BLINK_DOPERIODICYCLE`);
}
return {
payload: {
uc_BlinkAmount: input.blink_amount,
ul_BlinkOnPeriod: input.blink_on_period,
ul_BlinkOffPeriod: input.blink_off_period,
uc_StateAfterSequence: utils.getFromLookup(input.state_after_sequence, stateAfterBlinkEnum),
b_DoPeriodicCycle: input.do_periodic_cycle ? 1 : 0,
},
};
},
parsePulseInput: (input: KeyValueAny) => {
if (!input || typeof input !== 'object') {
throw new Error(`NOT_OBJECT`);
}
if (!('pulse_length' in input) || !utils.isNumber(input.pulse_length)) {
throw new Error(`INVALID_PULSE_PULSELENGTH`);
}
return {
payload: {
PulseLength: input.pulse_length,
},
};
},
parseDeafBlinkPropInput: (input: KeyValueAny) => {
if (!input || typeof input !== 'object') {
throw new Error(`NOT_OBJECT`);
}
if (!('blink_amount' in input) || !utils.isNumber(input.blink_amount)) {
throw new Error(`INVALID_BLINK_AMOUNT`);
}
if (!('blink_on_time' in input) || !utils.isNumber(input.blink_on_time)) {
throw new Error(`INVALID_BLINK_ONTIME`);
}
if (!('sequence_amount' in input) || !utils.isNumber(input.sequence_amount)) {
throw new Error(`INVALID_SEQUENCE_AMOUNT`);
}
if (input.sequence_of_blinks && Array.isArray(input.sequence_of_blinks)) {
// if (input.uc_SequenceAmount < input.tuc_BlinkAmount.length) {
// // more sequences configured than expected, pop extragenous
// for(let i = 0; i < input.tuc_BlinkAmount.length - input.uc_SequenceAmount; i++) {
// input.tuc_BlinkAmount.pop();
// }
// }
// if (input.uc_SequenceAmount > input.tuc_BlinkAmount.length) {
// // more sequences than configured, pad with additionals
// for(let i = 0; i < input.uc_SequenceAmount - input.tuc_BlinkAmount.length; i++) {
// input.tuc_BlinkAmount.push({"uc_BlinkAmountItem":1}); //puke
// }
// }
// Updating number of elements
input.sequence_amount = input.sequence_of_blinks.length;
} else {
throw new Error(`INVALID_TUC_BLINKAMOUNT`);
}
if (!('uc_BlinkAmount' in input) || !utils.isNumber(input.uc_SequenceAmount)) {
throw new Error(`INVALID_SEQUENCE_AMOUNT`);
}
return {
payload: {
uc_BlinkAmount: input.blink_amount,
ul_BlinkOnTime: input.blink_on_time,
uc_SequenceAmount: input.sequence_of_blinks.length,
tuc_BlinkAmount: input.sequence_of_blinks.map((elem) => (typeof elem === 'object' ? Object.values(elem).shift() : elem)), // [{"undefined":1},{"undefined":1}] > [1,1]
},
};
},
parseDim: (input: KeyValueAny) => {
let _ul_RampContinuousDuration, _uc_StepContinuous;
if (!input || typeof input !== 'object') {
throw new Error(`NOT_OBJECT`);
}
if (!('ramp_continuous_duration' in input) || !utils.isNumber(input.ramp_continuous_duration)) {
_ul_RampContinuousDuration = 0xffffffff; // use default value
} else _ul_RampContinuousDuration = input.ramp_continuous_duration;
if (!('step_continuous' in input) || !utils.isNumber(input.step_continuous)) {
_uc_StepContinuous = 0xff; // use default value
} else _uc_StepContinuous = input.step_continuous;
return {
payload: {
ul_RampContinuousDuration: _ul_RampContinuousDuration,
uc_StepContinuous: _uc_StepContinuous,
},
};
},
parseDimMinMax: (input: KeyValueAny) => {
let _ul_TransitionTime, _action;
if (!input || typeof input !== 'object') {
throw new Error(`NOT_OBJECT`);
}
if (!('transition_time' in input) || !utils.isNumber(input.transition_time)) {
_ul_TransitionTime = 0xffffffff; // use default value
} else _ul_TransitionTime = input.transition_time;
if (!('action' in input)) {
throw new Error(`MISSING_ACTION`);
} else {
_action = input.action;
}
return {
action: _action,
payload: {
ul_TransitionTime: _ul_TransitionTime,
},
};
},
parseStartNightLightMode: (input: KeyValueAny) => {
let _ul_ChildModeStartingDelay,
_uc_ChildModeBrightnessStart,
_uc_ChildModeBrightnessEnd,
_ul_ChildModeRampDuration,
_ul_ChildModeOnDuration,
_uc_ChildStep;
if (!input || typeof input !== 'object') {
throw new Error(`NOT_OBJECT`);
}
if (!('childmode_starting_delay' in input) || !utils.isNumber(input.childmode_starting_delay)) {
_ul_ChildModeStartingDelay = 0xffffffff; // use default value
} else _ul_ChildModeStartingDelay = input.childmode_starting_delay;
if (!('childmode_brightness_start' in input) || !utils.isNumber(input.childmode_brightness_start)) {
_uc_ChildModeBrightnessStart = 0xff; // use default value
} else _uc_ChildModeBrightnessStart = input.childmode_brightness_start;
if (!('childmode_brightness_end' in input) || !utils.isNumber(input.childmode_brightness_end)) {
_uc_ChildModeBrightnessEnd = 0xff; // use default value
} else _uc_ChildModeBrightnessEnd = input.childmode_brightness_end;
if (!('childmode_ramp_duration' in input) || !utils.isNumber(input.childmode_ramp_duration)) {
_ul_ChildModeRampDuration = 0xffffffff; // use default value
} else _ul_ChildModeRampDuration = input.childmode_ramp_duration;
if (!('childmode_on_duration' in input) || !utils.isNumber(input.childmode_on_duration)) {
_ul_ChildModeOnDuration = 0xffffffff; // use default value
} else _ul_ChildModeOnDuration = input.childmode_on_duration;
if (!('childmode_step' in input) || !utils.isNumber(input.childmode_step)) {
_uc_ChildStep = 0xff; // use default value
} else _uc_ChildStep = input.childmode_step;
return {
payload: {
ul_ChildModeStartingDelay: _ul_ChildModeStartingDelay,
uc_ChildModeBrightnessStart: _uc_ChildModeBrightnessStart,
uc_ChildModeBrightnessEnd: _uc_ChildModeBrightnessEnd,
ul_ChildModeRampDuration: _ul_ChildModeRampDuration,
ul_ChildModeOnDuration: _ul_ChildModeOnDuration,
uc_ChildStep: _uc_ChildStep,
},
};
},
log: (key: string, value: KeyValueAny | string, payload?: KeyValueAny) => {
logger.debug(`Invoked converter with key: '${key}'`, NS);
logger.debug('Invoked converter with values:' + JSON.stringify(value), NS);
if (payload) logger.debug('Invoked converter with payload:' + JSON.stringify(payload), NS);
},
};
// Command definition
const yokisCommandsExtend = {
resetToFactorySettings: (): ModernExtend => {
const exposes = e
.enum('reset_to_factory_settings', ea.SET, Object.keys(resetActionEnum))
.withDescription('Reset setting depending on RESET ACTION value')
.withCategory('config');
const toZigbee: Tz.Converter[] = [
{
key: ['reset_to_factory_settings'],
convertSet: async (entity, key, value: string, meta) => {
const commandWrapper = yokisExtendChecks.parseResetInput(value);
yokisExtendChecks.log(key, value);
await entity.command('manuSpecificYokisDevice', 'resetToFactorySettings', commandWrapper.payload);
},
},
];
return {
exposes: [exposes],
toZigbee,
isModernExtend: true,
};
},
relaunchBleAdvert: (): ModernExtend => {
const exposes = e
.enum('relaunch_ble_advert', ea.SET, ['relaunch_ble_advert'])
.withDescription('Relaunch BLE advertising for 15 minutes')
.withCategory('config');
const toZigbee: Tz.Converter[] = [
{
key: ['relaunch_ble_advert'],
convertSet: async (entity, key, value, meta) => {
yokisExtendChecks.log(key, value);
await entity.command('manuSpecificYokisDevice', 'relaunchBleAdvert', {});
},
},
];
return {
exposes: [exposes],
toZigbee,
isModernExtend: true,
};
},
openNetwork: (): ModernExtend => {
const exposes = e
.composite('open_network_command', 'open_network_prop', ea.SET)
.withDescription('Open ZigBee network')
.withFeature(
e
.numeric('opening_time', ea.SET) //uc_OpeningTime
.withValueMin(0)
.withValueMax(255)
.withUnit('s')
.withDescription('Opening time wanted from 1 to 255 seconds,0 means closing the network.'),
)
.withCategory('config');
const toZigbee: Tz.Converter[] = [
{
key: ['open_network_prop'],
convertSet: async (entity, key, value, meta) => {
const commandWrapper = yokisExtendChecks.parseOpenNetworkInput(value);
yokisExtendChecks.log(key, value);
await entity.command('manuSpecificYokisDevice', 'OpenNetwork', commandWrapper.payload);
},
},
];
return {
exposes: [exposes],
toZigbee,
isModernExtend: true,
};
},
moveToPosition: (): ModernExtend => {
const exposes = e
.composite('move_to_position_command', 'move_to_position_prop', ea.SET)
.withDescription(
'Move to position specified in uc_BrightnessEnd parameter.' +
'If TOR mode is set (no dimming) or MTR : if uc_BrightnessEnd under 50% will set to OFF else will be set to ON',
)
.withFeature(
e
.numeric('brightness_start', ea.SET) // uc_BrightnessStart
.withDescription('Define the brightness at the beginning of the transition, in %'),
)
.withFeature(
e
.numeric('brightness_end', ea.SET) // uc_BrightnessEnd
.withDescription('Define the brightness at the end of the transition, in %'),
)
.withFeature(
e
.numeric('pre_timer_value', ea.SET) // ul_PreTimerValue
.withUnit('s')
.withDescription('Define the pre timer value, otherwise use 0xFFFFFFFF to use the one configured in the product'),
)
.withFeature(
e
.binary('enable_pre_timer', ea.SET, true, false) // b_PreTimerEnable
.withDescription('Define whether the device should use the pre timer or not, if 0xFF then use the one configured in product'),
)
.withFeature(
e
.numeric('timer_value', ea.SET) // ul_TimerValue
.withUnit('s')
.withDescription('Define the timer ON value, otherwise use 0xFFFFFFFF to use the one configured in the product'),
)
.withFeature(
e
.binary('enable_timer', ea.SET, true, false) // b_TimerEnable
.withDescription('Define whether the device should use the timer ON or not, if 0xFF then use the one configured in product'),
)
.withFeature(
e
.numeric('transition_time', ea.SET) // ul_TransitionTime
.withDescription('Define the transition time from the brightness start to the brightness end, in ms'),
)
.withCategory('config');
const toZigbee: Tz.Converter[] = [
{
key: ['move_to_position_prop'],
convertSet: async (entity, key, value, meta) => {
// const options = utils.getOptions(meta.mapped, entity);
// logger.debug('Invoked converter with options:' + JSON.stringify(options));
const commandWrapper = yokisExtendChecks.parseMoveToPositionInput(value);
yokisExtendChecks.log(key, value, commandWrapper.payload);
await entity.command('manuSpecificYokisLightControl', 'moveToPosition', commandWrapper.payload);
},
},
];
return {
exposes: [exposes],
toZigbee,
isModernExtend: true,
};
},
blink: (): ModernExtend => {
const exposes = e
.composite('blink_command', 'blink_prop', ea.SET)
.withDescription('With this command, the module is asked to perform a blinking sequence.')
.withFeature(
e
.numeric('blink_amount', ea.SET) // uc_BlinkAmount
.withDescription(
'If defined will force the number of blink to be done (only for this order) if not the device will use its own value.',
),
)
.withFeature(
e
.numeric('blink_on_period', ea.SET) // ul_BlinkOnPeriod
.withDescription('If defined will force the blink’s “on time” (only for this order) if not the device will use its own value.'),
)
.withFeature(
e
.numeric('blink_off_period', ea.SET) // ul_BlinkOffPeriod
.withDescription('If defined will force the blink’s “off time” (only for this order) if not the device will use its own value.'),
)
.withFeature(
e
.enum('state_after_sequence', ea.SET, Object.keys(stateAfterBlinkEnum)) // uc_StateAfterSequence
.withDescription(
'If defined will force the state after the sequence (only for this order). if not the device will use its own value-',
),
)
.withFeature(
e
.binary('do_periodic_cycle', ea.SET, true, false) // b_DoPeriodicCycle
.withDescription('If set to true the blinking will be “infinite”'),
)
.withCategory('config');
const toZigbee: Tz.Converter[] = [
{
key: ['blink_prop'],
convertSet: async (entity, key, value, meta) => {
const commandWrapper = yokisExtendChecks.parseBlinkInput(value);
yokisExtendChecks.log(key, value, commandWrapper.payload);
await entity.command('manuSpecificYokisLightControl', 'blink', commandWrapper.payload);
},
},
];