@willieee802/zigbee-herdsman-converters 15.0.8-4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +7 -0
- package/converters/fromZigbee.js +8439 -0
- package/converters/toZigbee.js +7162 -0
- package/devices/ITCommander.js +37 -0
- package/devices/RMC002.js +20 -0
- package/devices/acova.js +101 -0
- package/devices/acuity_brands_lighting.js +11 -0
- package/devices/adeo.js +256 -0
- package/devices/adurosmart.js +130 -0
- package/devices/aeotec.js +13 -0
- package/devices/airam.js +59 -0
- package/devices/ajax_online.js +49 -0
- package/devices/akuvox.js +28 -0
- package/devices/alchemy.js +18 -0
- package/devices/aldi.js +53 -0
- package/devices/alecto.js +98 -0
- package/devices/anchor.js +17 -0
- package/devices/atlantic.js +110 -0
- package/devices/atsmart.js +28 -0
- package/devices/aubess.js +21 -0
- package/devices/aurora_lighting.js +292 -0
- package/devices/automaton.js +44 -0
- package/devices/awox.js +184 -0
- package/devices/axis.js +22 -0
- package/devices/bankamp.js +11 -0
- package/devices/bega.js +22 -0
- package/devices/belkin.js +11 -0
- package/devices/bitron.js +334 -0
- package/devices/blaupunkt.js +27 -0
- package/devices/blitzwolf.js +47 -0
- package/devices/bosch.js +702 -0
- package/devices/brimate.js +15 -0
- package/devices/bseed.js +17 -0
- package/devices/bticino.js +118 -0
- package/devices/busch-jaeger.js +140 -0
- package/devices/byun.js +24 -0
- package/devices/calex.js +37 -0
- package/devices/candeo.js +49 -0
- package/devices/casaia.js +52 -0
- package/devices/centralite.js +359 -0
- package/devices/cleode.js +20 -0
- package/devices/cleverio.js +36 -0
- package/devices/climax.js +138 -0
- package/devices/commercial_electric.js +16 -0
- package/devices/connecte.js +46 -0
- package/devices/cree.js +11 -0
- package/devices/ctm.js +999 -0
- package/devices/current_products_corp.js +24 -0
- package/devices/custom_devices_diy.js +850 -0
- package/devices/cy-lighting.js +11 -0
- package/devices/danalock.js +26 -0
- package/devices/danfoss.js +340 -0
- package/devices/databyte.ch.js +55 -0
- package/devices/datek.js +246 -0
- package/devices/dawon_dns.js +338 -0
- package/devices/develco.js +868 -0
- package/devices/digi.js +14 -0
- package/devices/diyruz.js +305 -0
- package/devices/dlink.js +37 -0
- package/devices/dnake.js +11 -0
- package/devices/dresden_elektronik.js +47 -0
- package/devices/easyaccess.js +27 -0
- package/devices/eatonhalo_led.js +11 -0
- package/devices/echostar.js +25 -0
- package/devices/ecodim.js +145 -0
- package/devices/ecolink.js +21 -0
- package/devices/ecosmart.js +64 -0
- package/devices/ecozy.js +31 -0
- package/devices/edp.js +39 -0
- package/devices/eglo.js +25 -0
- package/devices/elko.js +176 -0
- package/devices/enbrighten.js +163 -0
- package/devices/enocean.js +52 -0
- package/devices/envilar.js +73 -0
- package/devices/essentialb.js +87 -0
- package/devices/eurotronic.js +48 -0
- package/devices/evanell.js +29 -0
- package/devices/evn.js +31 -0
- package/devices/evology.js +24 -0
- package/devices/evvr.js +17 -0
- package/devices/ewelink.js +184 -0
- package/devices/ezex.js +24 -0
- package/devices/fantem.js +77 -0
- package/devices/feibit.js +172 -0
- package/devices/fireangel.js +15 -0
- package/devices/frankever.js +23 -0
- package/devices/garza.js +11 -0
- package/devices/ge.js +111 -0
- package/devices/gewiss.js +48 -0
- package/devices/gidealed.js +11 -0
- package/devices/giderwel.js +11 -0
- package/devices/giex.js +222 -0
- package/devices/girier.js +19 -0
- package/devices/gledopto.js +756 -0
- package/devices/gmy.js +11 -0
- package/devices/gs.js +29 -0
- package/devices/halemeier.js +18 -0
- package/devices/hampton_bay.js +37 -0
- package/devices/heiman.js +805 -0
- package/devices/hej.js +107 -0
- package/devices/hfh.js +11 -0
- package/devices/hgkg.js +54 -0
- package/devices/hilux.js +11 -0
- package/devices/hive.js +524 -0
- package/devices/home_control_as.js +27 -0
- package/devices/hommyn.js +24 -0
- package/devices/honyar.js +29 -0
- package/devices/hornbach.js +53 -0
- package/devices/hzc.js +21 -0
- package/devices/hzc_electric.js +42 -0
- package/devices/icasa.js +121 -0
- package/devices/idinio.js +19 -0
- package/devices/ihorn.js +61 -0
- package/devices/ikea.js +1168 -0
- package/devices/ilightsin.js +11 -0
- package/devices/iluminize.js +262 -0
- package/devices/ilux.js +11 -0
- package/devices/immax.js +203 -0
- package/devices/innr.js +705 -0
- package/devices/inovelli.js +1315 -0
- package/devices/insta.js +110 -0
- package/devices/iolloi.js +20 -0
- package/devices/iotperfect.js +20 -0
- package/devices/iris.js +180 -0
- package/devices/istar.js +20 -0
- package/devices/jasco.js +55 -0
- package/devices/javis.js +37 -0
- package/devices/jethome.js +48 -0
- package/devices/jiawen.js +18 -0
- package/devices/jumitech.js +18 -0
- package/devices/jxuan.js +49 -0
- package/devices/kami.js +15 -0
- package/devices/keen_home.js +80 -0
- package/devices/klikaanklikuit.js +17 -0
- package/devices/kmpcil.js +148 -0
- package/devices/konke.js +141 -0
- package/devices/ksentry.js +17 -0
- package/devices/kurvia.js +17 -0
- package/devices/kwikset.js +120 -0
- package/devices/lanesto.js +11 -0
- package/devices/lds.js +11 -0
- package/devices/led_trading.js +69 -0
- package/devices/ledvance.js +353 -0
- package/devices/leedarson.js +130 -0
- package/devices/legrand.js +554 -0
- package/devices/lellki.js +146 -0
- package/devices/letsled.js +11 -0
- package/devices/letv.js +18 -0
- package/devices/leviton.js +142 -0
- package/devices/lg.js +18 -0
- package/devices/lidl.js +1000 -0
- package/devices/lifecontrol.js +92 -0
- package/devices/lightsolutions.js +37 -0
- package/devices/linkind.js +205 -0
- package/devices/livingwise.js +59 -0
- package/devices/livolo.js +286 -0
- package/devices/lixee.js +779 -0
- package/devices/lonsonho.js +218 -0
- package/devices/lubeez.js +18 -0
- package/devices/lupus.js +74 -0
- package/devices/lutron.js +32 -0
- package/devices/lux.js +40 -0
- package/devices/m-elec.js +18 -0
- package/devices/makegood.js +51 -0
- package/devices/matcall_bv.js +18 -0
- package/devices/meazon.js +47 -0
- package/devices/mercator.js +225 -0
- package/devices/miboxer.js +72 -0
- package/devices/micromatic.js +29 -0
- package/devices/moes.js +400 -0
- package/devices/mycket.js +11 -0
- package/devices/m/303/274ller_licht.js +220 -0
- package/devices/namron.js +774 -0
- package/devices/nanoleaf.js +11 -0
- package/devices/neo.js +86 -0
- package/devices/net2grid.js +29 -0
- package/devices/netvox.js +35 -0
- package/devices/niko.js +314 -0
- package/devices/ninja_blocks.js +24 -0
- package/devices/niviss.js +11 -0
- package/devices/nodon.js +109 -0
- package/devices/nordtronic.js +30 -0
- package/devices/nous.js +88 -0
- package/devices/novo.js +17 -0
- package/devices/nue_3a.js +417 -0
- package/devices/nyce.js +67 -0
- package/devices/onesti.js +59 -0
- package/devices/openlumi.js +22 -0
- package/devices/orvibo.js +515 -0
- package/devices/osram.js +519 -0
- package/devices/oujiabao.js +15 -0
- package/devices/owon.js +352 -0
- package/devices/ozsmartthings.js +11 -0
- package/devices/paul_neuhaus.js +96 -0
- package/devices/paulmann.js +158 -0
- package/devices/peq.js +24 -0
- package/devices/perenio.js +413 -0
- package/devices/philips.js +3118 -0
- package/devices/plaid.js +25 -0
- package/devices/plugwise.js +173 -0
- package/devices/popp.js +10 -0
- package/devices/profalux.js +47 -0
- package/devices/prolight.js +54 -0
- package/devices/qmotion.js +33 -0
- package/devices/qoto.js +113 -0
- package/devices/quotra.js +18 -0
- package/devices/rademacher.js +18 -0
- package/devices/rgb_genie.js +119 -0
- package/devices/robb.js +335 -0
- package/devices/roome.js +15 -0
- package/devices/rtx.js +90 -0
- package/devices/salus_controls.js +137 -0
- package/devices/samotech.js +93 -0
- package/devices/saswell.js +58 -0
- package/devices/scanproducts.js +32 -0
- package/devices/schlage.js +24 -0
- package/devices/schneider_electric.js +1039 -0
- package/devices/schwaiger.js +62 -0
- package/devices/seastar_intelligence.js +16 -0
- package/devices/securifi.js +39 -0
- package/devices/sengled.js +332 -0
- package/devices/sercomm.js +140 -0
- package/devices/shenzhen_homa.js +53 -0
- package/devices/shinasystem.js +686 -0
- package/devices/siglis.js +440 -0
- package/devices/sinope.js +1257 -0
- package/devices/siterwell.js +46 -0
- package/devices/skydance.js +112 -0
- package/devices/slv.js +27 -0
- package/devices/smart9.js +27 -0
- package/devices/smart_home_pty.js +18 -0
- package/devices/smartenit.js +42 -0
- package/devices/smartthings.js +495 -0
- package/devices/smartwings.js +24 -0
- package/devices/sohan_electric.js +13 -0
- package/devices/solaredge.js +11 -0
- package/devices/somgoms.js +47 -0
- package/devices/sonoff.js +262 -0
- package/devices/spotmau.js +36 -0
- package/devices/sprut.js +317 -0
- package/devices/stelpro.js +216 -0
- package/devices/sunricher.js +625 -0
- package/devices/swann.js +33 -0
- package/devices/sylvania.js +200 -0
- package/devices/tci.js +25 -0
- package/devices/technicolor.js +47 -0
- package/devices/terncy.js +64 -0
- package/devices/the_light_group.js +70 -0
- package/devices/third_reality.js +195 -0
- package/devices/titan_products.js +22 -0
- package/devices/tplink.js +42 -0
- package/devices/trust.js +114 -0
- package/devices/tubeszb.js +20 -0
- package/devices/tuya.js +4215 -0
- package/devices/ubisys.js +938 -0
- package/devices/uhome.js +25 -0
- package/devices/universal_electronics_inc.js +119 -0
- package/devices/urlighting.js +12 -0
- package/devices/useelink.js +52 -0
- package/devices/vbled.js +18 -0
- package/devices/vesternet.js +188 -0
- package/devices/viessmann.js +51 -0
- package/devices/villeroy_boch.js +18 -0
- package/devices/vimar.js +78 -0
- package/devices/visonic.js +80 -0
- package/devices/vrey.js +18 -0
- package/devices/wally.js +25 -0
- package/devices/waxman.js +45 -0
- package/devices/weiser.js +67 -0
- package/devices/weten.js +13 -0
- package/devices/wisdom.js +11 -0
- package/devices/woox.js +177 -0
- package/devices/wyze.js +23 -0
- package/devices/xiaomi.js +3223 -0
- package/devices/xinghuoyuan.js +11 -0
- package/devices/yale.js +227 -0
- package/devices/ynoa.js +68 -0
- package/devices/yookee.js +23 -0
- package/devices/ysrsai.js +26 -0
- package/devices/zemismart.js +254 -0
- package/devices/zen.js +34 -0
- package/devices/zipato.js +11 -0
- package/index.js +242 -0
- package/lib/color.js +784 -0
- package/lib/configureKey.js +944 -0
- package/lib/constants.js +316 -0
- package/lib/exposes.js +677 -0
- package/lib/extend.js +180 -0
- package/lib/kelvinToXy.js +1912 -0
- package/lib/legacy.js +2223 -0
- package/lib/light.js +111 -0
- package/lib/ota/OTA_URLs.md +119 -0
- package/lib/ota/common.js +476 -0
- package/lib/ota/index.js +10 -0
- package/lib/ota/inovelli.js +72 -0
- package/lib/ota/ledvance.js +52 -0
- package/lib/ota/lixee.js +57 -0
- package/lib/ota/salus.js +82 -0
- package/lib/ota/securifi.js +25 -0
- package/lib/ota/tradfri.js +45 -0
- package/lib/ota/ubisys.js +61 -0
- package/lib/ota/zigbeeOTA.js +161 -0
- package/lib/philips.js +667 -0
- package/lib/reporting.js +234 -0
- package/lib/store.js +57 -0
- package/lib/tuya.js +2027 -0
- package/lib/utils.js +527 -0
- package/lib/xiaomi.d.ts +11 -0
- package/lib/xiaomi.js +1288 -0
- package/lib/zosung.js +243 -0
- package/package.json +39 -0
|
@@ -0,0 +1,1315 @@
|
|
|
1
|
+
const fz = require('../converters/fromZigbee');
|
|
2
|
+
const tz = require('../converters/toZigbee');
|
|
3
|
+
const exposes = require('../lib/exposes');
|
|
4
|
+
const globalStore = require('../lib/store');
|
|
5
|
+
const reporting = require('../lib/reporting');
|
|
6
|
+
const ota = require('../lib/ota');
|
|
7
|
+
const utils = require('../lib/utils');
|
|
8
|
+
|
|
9
|
+
const e = exposes.presets;
|
|
10
|
+
const ea = exposes.access;
|
|
11
|
+
|
|
12
|
+
const clickLookup = {
|
|
13
|
+
0: 'single',
|
|
14
|
+
1: 'release',
|
|
15
|
+
2: 'held',
|
|
16
|
+
3: 'double',
|
|
17
|
+
4: 'triple',
|
|
18
|
+
5: 'quadruple',
|
|
19
|
+
6: 'quintuple',
|
|
20
|
+
};
|
|
21
|
+
const buttonLookup = {
|
|
22
|
+
1: 'down',
|
|
23
|
+
2: 'up',
|
|
24
|
+
3: 'config',
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const ledEffects = {
|
|
28
|
+
off: 0,
|
|
29
|
+
solid: 1,
|
|
30
|
+
fast_blink: 2,
|
|
31
|
+
slow_blink: 3,
|
|
32
|
+
pulse: 4,
|
|
33
|
+
chase: 5,
|
|
34
|
+
open_close: 6,
|
|
35
|
+
small_to_big: 7,
|
|
36
|
+
aurora: 8,
|
|
37
|
+
slow_falling: 9,
|
|
38
|
+
medium_falling: 10,
|
|
39
|
+
fast_falling: 11,
|
|
40
|
+
slow_rising: 12,
|
|
41
|
+
medium_rising: 13,
|
|
42
|
+
fast_rising: 14,
|
|
43
|
+
medium_blink: 15,
|
|
44
|
+
slow_chase: 16,
|
|
45
|
+
fast_chase: 17,
|
|
46
|
+
fast_siren: 18,
|
|
47
|
+
slow_siren: 19,
|
|
48
|
+
clear_effect: 255,
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const individualLedEffects = {
|
|
52
|
+
off: 0,
|
|
53
|
+
solid: 1,
|
|
54
|
+
fast_blink: 2,
|
|
55
|
+
slow_blink: 3,
|
|
56
|
+
pulse: 4,
|
|
57
|
+
chase: 5,
|
|
58
|
+
falling: 6,
|
|
59
|
+
rising: 7,
|
|
60
|
+
aurora: 8,
|
|
61
|
+
clear_effect: 255,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const UINT8 = 32;
|
|
65
|
+
const BOOLEAN = 16;
|
|
66
|
+
const UINT16 = 33;
|
|
67
|
+
const INOVELLI = 0x122f;
|
|
68
|
+
|
|
69
|
+
const ATTRIBUTES = {
|
|
70
|
+
dimmingSpeedUpRemote: {
|
|
71
|
+
ID: 1,
|
|
72
|
+
dataType: UINT8,
|
|
73
|
+
min: 0,
|
|
74
|
+
max: 127,
|
|
75
|
+
description:
|
|
76
|
+
'This changes the speed that the light dims up when controlled from the hub. ' +
|
|
77
|
+
'A setting of 0 turns the light immediately on. Increasing the value slows down the transition speed. ' +
|
|
78
|
+
'Every number represents 100ms. Default = 25 (2.5s)',
|
|
79
|
+
},
|
|
80
|
+
dimmingSpeedUpLocal: {
|
|
81
|
+
ID: 2,
|
|
82
|
+
dataType: UINT8,
|
|
83
|
+
min: 0,
|
|
84
|
+
max: 127,
|
|
85
|
+
description:
|
|
86
|
+
'This changes the speed that the light dims up when controlled at the switch. ' +
|
|
87
|
+
'A setting of 0 turns the light immediately on. Increasing the value slows down the transition speed. ' +
|
|
88
|
+
'Every number represents 100ms. Default = 127 - Keep in sync with dimmingSpeedUpRemote setting.',
|
|
89
|
+
},
|
|
90
|
+
rampRateOffToOnRemote: {
|
|
91
|
+
ID: 3,
|
|
92
|
+
dataType: UINT8,
|
|
93
|
+
min: 0,
|
|
94
|
+
max: 127,
|
|
95
|
+
description:
|
|
96
|
+
'This changes the speed that the light turns on when controlled from the hub. ' +
|
|
97
|
+
'A setting of 0 turns the light immediately on. Increasing the value slows down the transition speed. ' +
|
|
98
|
+
'Every number represents 100ms. Default = 127 - Keep in sync with dimmingSpeedUpRemote setting.',
|
|
99
|
+
},
|
|
100
|
+
rampRateOffToOnLocal: {
|
|
101
|
+
ID: 4,
|
|
102
|
+
dataType: UINT8,
|
|
103
|
+
min: 0,
|
|
104
|
+
max: 127,
|
|
105
|
+
description:
|
|
106
|
+
'This changes the speed that the light turns on when controlled at the switch. ' +
|
|
107
|
+
'A setting of 0 turns the light immediately on. Increasing the value slows down the transition speed. ' +
|
|
108
|
+
'Every number represents 100ms. Default = 127 - Keep in sync with dimmingSpeedUpRemote setting.',
|
|
109
|
+
},
|
|
110
|
+
dimmingSpeedDownRemote: {
|
|
111
|
+
ID: 5,
|
|
112
|
+
dataType: UINT8,
|
|
113
|
+
min: 0,
|
|
114
|
+
max: 127,
|
|
115
|
+
description:
|
|
116
|
+
'This changes the speed that the light dims down when controlled from the hub. ' +
|
|
117
|
+
'A setting of 0 turns the light immediately off. Increasing the value slows down the transition speed. ' +
|
|
118
|
+
'Every number represents 100ms. Default = 127 - Keep in sync with dimmingSpeedUpRemote setting.',
|
|
119
|
+
},
|
|
120
|
+
dimmingSpeedDownLocal: {
|
|
121
|
+
ID: 6,
|
|
122
|
+
dataType: UINT8,
|
|
123
|
+
min: 0,
|
|
124
|
+
max: 127,
|
|
125
|
+
description:
|
|
126
|
+
'This changes the speed that the light dims down when controlled at the switch. ' +
|
|
127
|
+
'A setting of 0 turns the light immediately off. Increasing the value slows down the transition speed. ' +
|
|
128
|
+
'Every number represents 100ms. Default = 127 - Keep in sync with dimmingSpeedUpLocal setting.',
|
|
129
|
+
},
|
|
130
|
+
rampRateOnToOffRemote: {
|
|
131
|
+
ID: 7,
|
|
132
|
+
dataType: UINT8,
|
|
133
|
+
min: 0,
|
|
134
|
+
max: 127,
|
|
135
|
+
description:
|
|
136
|
+
'This changes the speed that the light turns off when controlled from the hub. ' +
|
|
137
|
+
'A setting of \'instant\' turns the light immediately off. Increasing the value slows down the transition speed. ' +
|
|
138
|
+
'Every number represents 100ms. Default = 127 - Keep in sync with rampRateOffToOnRemote setting.',
|
|
139
|
+
},
|
|
140
|
+
rampRateOnToOffLocal: {
|
|
141
|
+
ID: 8,
|
|
142
|
+
dataType: UINT8,
|
|
143
|
+
min: 0,
|
|
144
|
+
max: 127,
|
|
145
|
+
description:
|
|
146
|
+
'This changes the speed that the light turns off when controlled at the switch. ' +
|
|
147
|
+
'A setting of \'instant\' turns the light immediately off. Increasing the value slows down the transition speed. ' +
|
|
148
|
+
'Every number represents 100ms. Default = 127 - Keep in sync with rampRateOffToOnLocal setting.',
|
|
149
|
+
},
|
|
150
|
+
minimumLevel: {
|
|
151
|
+
ID: 9,
|
|
152
|
+
dataType: UINT8,
|
|
153
|
+
min: 1,
|
|
154
|
+
max: 253,
|
|
155
|
+
description:
|
|
156
|
+
'The minimum level that the dimmer allows the bulb to be dimmed to. ' +
|
|
157
|
+
'Useful when the user has an LED bulb that does not turn on or flickers at a lower level.',
|
|
158
|
+
},
|
|
159
|
+
maximumLevel: {
|
|
160
|
+
ID: 10,
|
|
161
|
+
dataType: UINT8,
|
|
162
|
+
min: 2,
|
|
163
|
+
max: 254,
|
|
164
|
+
description:
|
|
165
|
+
'The maximum level that the dimmer allows the bulb to be dimmed to.' +
|
|
166
|
+
'Useful when the user has an LED bulb that reaches its maximum level before the ' +
|
|
167
|
+
'dimmer value of 99 or when the user wants to limit the maximum brightness.',
|
|
168
|
+
},
|
|
169
|
+
invertSwitch: {
|
|
170
|
+
ID: 11,
|
|
171
|
+
dataType: BOOLEAN,
|
|
172
|
+
displayType: 'enum',
|
|
173
|
+
values: {Yes: 1, No: 0},
|
|
174
|
+
min: 0,
|
|
175
|
+
max: 1,
|
|
176
|
+
description:
|
|
177
|
+
'Inverts the orientation of the switch.' +
|
|
178
|
+
' Useful when the switch is installed upside down. Essentially up becomes down and down becomes up.',
|
|
179
|
+
},
|
|
180
|
+
autoTimerOff: {
|
|
181
|
+
ID: 12,
|
|
182
|
+
min: 0,
|
|
183
|
+
max: 32767,
|
|
184
|
+
dataType: UINT16,
|
|
185
|
+
unit: 'seconds',
|
|
186
|
+
values: {Disabled: 0},
|
|
187
|
+
description:
|
|
188
|
+
'Automatically turns the switch off after this many seconds.' +
|
|
189
|
+
' When the switch is turned on a timer is started. When the timer expires, the switch is turned off. 0 = Auto off is disabled.',
|
|
190
|
+
},
|
|
191
|
+
defaultLevelLocal: {
|
|
192
|
+
ID: 13,
|
|
193
|
+
dataType: UINT8,
|
|
194
|
+
min: 0,
|
|
195
|
+
max: 255,
|
|
196
|
+
description:
|
|
197
|
+
'Default level for the dimmer when it is turned on at the switch.' +
|
|
198
|
+
' A setting of 255 means that the switch will return to the level that it was on before it was turned off.',
|
|
199
|
+
},
|
|
200
|
+
defaultLevelRemote: {
|
|
201
|
+
ID: 14,
|
|
202
|
+
dataType: UINT8,
|
|
203
|
+
min: 0,
|
|
204
|
+
max: 255,
|
|
205
|
+
description:
|
|
206
|
+
'Default level for the dimmer when it is turned on from the hub.' +
|
|
207
|
+
' A setting of 255 means that the switch will return to the level that it was on before it was turned off.',
|
|
208
|
+
},
|
|
209
|
+
stateAfterPowerRestored: {
|
|
210
|
+
ID: 15,
|
|
211
|
+
dataType: UINT8,
|
|
212
|
+
min: 0,
|
|
213
|
+
max: 255,
|
|
214
|
+
description:
|
|
215
|
+
'The state the switch should return to when power is restored after power failure. 0 = off, 1-254 = level, 255 = previous.',
|
|
216
|
+
},
|
|
217
|
+
loadLevelIndicatorTimeout: {
|
|
218
|
+
ID: 17,
|
|
219
|
+
dataType: UINT8,
|
|
220
|
+
description:
|
|
221
|
+
'Shows the level that the load is at for x number of seconds after the load is adjusted' +
|
|
222
|
+
' and then returns to the Default LED state. 0 = Stay Off, 1-10 = seconds, 11 = Stay On.',
|
|
223
|
+
displayType: 'enum',
|
|
224
|
+
values: {
|
|
225
|
+
'Stay Off': 0,
|
|
226
|
+
'1 Second': 1,
|
|
227
|
+
'2 Seconds': 2,
|
|
228
|
+
'3 Seconds': 3,
|
|
229
|
+
'4 Seconds': 4,
|
|
230
|
+
'5 Seconds': 5,
|
|
231
|
+
'6 Seconds': 6,
|
|
232
|
+
'7 Seconds': 7,
|
|
233
|
+
'8 Seconds': 8,
|
|
234
|
+
'9 Seconds': 9,
|
|
235
|
+
'10 Seconds': 10,
|
|
236
|
+
'Stay On': 11,
|
|
237
|
+
},
|
|
238
|
+
min: 0,
|
|
239
|
+
max: 11,
|
|
240
|
+
},
|
|
241
|
+
activePowerReports: {
|
|
242
|
+
ID: 18,
|
|
243
|
+
dataType: UINT8,
|
|
244
|
+
min: 0,
|
|
245
|
+
max: 100,
|
|
246
|
+
description:
|
|
247
|
+
'Percent power level change that will result in a new power report being sent. 0 = Disabled',
|
|
248
|
+
},
|
|
249
|
+
periodicPowerAndEnergyReports: {
|
|
250
|
+
ID: 19,
|
|
251
|
+
min: 0,
|
|
252
|
+
max: 32767,
|
|
253
|
+
dataType: UINT16,
|
|
254
|
+
description:
|
|
255
|
+
'Time period between consecutive power & energy reports being sent (in seconds). The timer is reset after each report is sent.',
|
|
256
|
+
},
|
|
257
|
+
activeEnergyReports: {
|
|
258
|
+
ID: 20,
|
|
259
|
+
dataType: UINT16,
|
|
260
|
+
min: 0,
|
|
261
|
+
max: 32767,
|
|
262
|
+
description:
|
|
263
|
+
'Energy reports Energy level change which will result in sending a new energy report.' +
|
|
264
|
+
'0 = disabled, 1-32767 = 0.01kWh-327.67kWh. Default setting: 10 (0.1 kWh)',
|
|
265
|
+
},
|
|
266
|
+
powerType: {
|
|
267
|
+
ID: 21,
|
|
268
|
+
dataType: BOOLEAN,
|
|
269
|
+
displayType: 'enum',
|
|
270
|
+
values: {'Non Neutral': 0, 'Neutral': 1},
|
|
271
|
+
min: 0,
|
|
272
|
+
max: 1,
|
|
273
|
+
readOnly: true,
|
|
274
|
+
description: 'Set the power type for the device.',
|
|
275
|
+
},
|
|
276
|
+
switchType: {
|
|
277
|
+
ID: 22,
|
|
278
|
+
dataType: UINT8,
|
|
279
|
+
displayType: 'enum',
|
|
280
|
+
values: {'Single Pole': 0, '3-Way Dumb Switch': 1, '3-Way Aux Switch': 2},
|
|
281
|
+
min: 0,
|
|
282
|
+
max: 2,
|
|
283
|
+
description: 'Set the switch configuration.',
|
|
284
|
+
},
|
|
285
|
+
buttonDelay: {
|
|
286
|
+
ID: 50,
|
|
287
|
+
dataType: UINT8,
|
|
288
|
+
values: {
|
|
289
|
+
'0ms': 0,
|
|
290
|
+
'100ms': 1,
|
|
291
|
+
'200ms': 2,
|
|
292
|
+
'300ms': 3,
|
|
293
|
+
'400ms': 4,
|
|
294
|
+
'500ms': 5,
|
|
295
|
+
'600ms': 6,
|
|
296
|
+
'700ms': 7,
|
|
297
|
+
'800ms': 8,
|
|
298
|
+
'900ms': 9,
|
|
299
|
+
},
|
|
300
|
+
displayType: 'enum',
|
|
301
|
+
min: 0,
|
|
302
|
+
max: 9,
|
|
303
|
+
description:
|
|
304
|
+
'This will set the button press delay. 0 = no delay (Disables Button Press Events),' +
|
|
305
|
+
'Default = 500ms.',
|
|
306
|
+
},
|
|
307
|
+
smartBulbMode: {
|
|
308
|
+
ID: 52,
|
|
309
|
+
dataType: BOOLEAN,
|
|
310
|
+
displayType: 'enum',
|
|
311
|
+
values: {'Disabled': 0, 'Smart Bulb Mode': 1},
|
|
312
|
+
description:
|
|
313
|
+
'For use with Smart Bulbs that need constant power and are controlled via commands rather than power.',
|
|
314
|
+
},
|
|
315
|
+
ledColorWhenOn: {
|
|
316
|
+
ID: 95,
|
|
317
|
+
dataType: UINT8,
|
|
318
|
+
min: 0,
|
|
319
|
+
max: 255,
|
|
320
|
+
values: {
|
|
321
|
+
Red: 0,
|
|
322
|
+
Orange: 21,
|
|
323
|
+
Yellow: 42,
|
|
324
|
+
Green: 85,
|
|
325
|
+
Cyan: 127,
|
|
326
|
+
Blue: 170,
|
|
327
|
+
Violet: 212,
|
|
328
|
+
Pink: 234,
|
|
329
|
+
White: 255,
|
|
330
|
+
},
|
|
331
|
+
description: 'Set the color of the LED Indicator when the load is on.',
|
|
332
|
+
},
|
|
333
|
+
ledColorWhenOff: {
|
|
334
|
+
ID: 96,
|
|
335
|
+
dataType: UINT8,
|
|
336
|
+
min: 0,
|
|
337
|
+
max: 255,
|
|
338
|
+
values: {
|
|
339
|
+
Red: 0,
|
|
340
|
+
Orange: 21,
|
|
341
|
+
Yellow: 42,
|
|
342
|
+
Green: 85,
|
|
343
|
+
Cyan: 127,
|
|
344
|
+
Blue: 170,
|
|
345
|
+
Violet: 212,
|
|
346
|
+
Pink: 234,
|
|
347
|
+
White: 255,
|
|
348
|
+
},
|
|
349
|
+
description: 'Set the color of the LED Indicator when the load is off.',
|
|
350
|
+
},
|
|
351
|
+
ledIntensityWhenOn: {
|
|
352
|
+
ID: 97,
|
|
353
|
+
dataType: UINT8,
|
|
354
|
+
min: 0,
|
|
355
|
+
max: 100,
|
|
356
|
+
description: 'Set the intensity of the LED Indicator when the load is on.',
|
|
357
|
+
},
|
|
358
|
+
ledIntensityWhenOff: {
|
|
359
|
+
ID: 98,
|
|
360
|
+
dataType: UINT8,
|
|
361
|
+
min: 0,
|
|
362
|
+
max: 100,
|
|
363
|
+
description: 'Set the intensity of the LED Indicator when the load is off.',
|
|
364
|
+
},
|
|
365
|
+
localProtection: {
|
|
366
|
+
ID: 256,
|
|
367
|
+
dataType: BOOLEAN,
|
|
368
|
+
values: {Disabled: 0, Enabled: 1},
|
|
369
|
+
description: 'Ability to control switch from the wall.',
|
|
370
|
+
displayType: 'enum',
|
|
371
|
+
},
|
|
372
|
+
remoteProtection: {
|
|
373
|
+
ID: 257,
|
|
374
|
+
dataType: BOOLEAN,
|
|
375
|
+
values: {Disabled: 0, Enabled: 1},
|
|
376
|
+
readOnly: true,
|
|
377
|
+
description: 'Ability to control switch from the hub.',
|
|
378
|
+
displayType: 'enum',
|
|
379
|
+
},
|
|
380
|
+
outputMode: {
|
|
381
|
+
ID: 258,
|
|
382
|
+
min: 0,
|
|
383
|
+
max: 1,
|
|
384
|
+
values: {'Dimmer': 0, 'On/Off': 1},
|
|
385
|
+
dataType: BOOLEAN,
|
|
386
|
+
description: 'Use device as a Dimmer or an On/Off switch.',
|
|
387
|
+
displayType: 'enum',
|
|
388
|
+
},
|
|
389
|
+
onOffLedMode: {
|
|
390
|
+
ID: 259,
|
|
391
|
+
min: 0,
|
|
392
|
+
max: 1,
|
|
393
|
+
values: {All: 0, One: 1},
|
|
394
|
+
dataType: BOOLEAN,
|
|
395
|
+
description:
|
|
396
|
+
'When the device is in On/Off mode, use full LED bar or just one LED.',
|
|
397
|
+
displayType: 'enum',
|
|
398
|
+
},
|
|
399
|
+
firmwareUpdateInProgressIndicator: {
|
|
400
|
+
ID: 260,
|
|
401
|
+
dataType: BOOLEAN,
|
|
402
|
+
values: {Disabled: 0, Enabled: 1},
|
|
403
|
+
description: 'Display progress on LED bar during firmware update.',
|
|
404
|
+
displayType: 'enum',
|
|
405
|
+
},
|
|
406
|
+
defaultLed1ColorWhenOn: {
|
|
407
|
+
ID: 60,
|
|
408
|
+
dataType: UINT8,
|
|
409
|
+
min: 0,
|
|
410
|
+
max: 255,
|
|
411
|
+
description:
|
|
412
|
+
'0-254:This is the color of the LED strip in a hex representation. 255:Synchronization with default all LED strip color parameter.',
|
|
413
|
+
},
|
|
414
|
+
defaultLed1ColorWhenOff: {
|
|
415
|
+
ID: 61,
|
|
416
|
+
dataType: UINT8,
|
|
417
|
+
min: 0,
|
|
418
|
+
max: 255,
|
|
419
|
+
description:
|
|
420
|
+
'0-254:This is the color of the LED strip in a hex representation. 255:Synchronization with default all LED strip color parameter.',
|
|
421
|
+
},
|
|
422
|
+
defaultLed1IntensityWhenOn: {
|
|
423
|
+
ID: 62,
|
|
424
|
+
dataType: UINT8,
|
|
425
|
+
min: 0,
|
|
426
|
+
max: 101,
|
|
427
|
+
description:
|
|
428
|
+
'Intesity of LED strip when on. 101 = Syncronized with default all LED strip intensity parameter.',
|
|
429
|
+
},
|
|
430
|
+
defaultLed1IntensityWhenOff: {
|
|
431
|
+
ID: 63,
|
|
432
|
+
dataType: UINT8,
|
|
433
|
+
min: 0,
|
|
434
|
+
max: 101,
|
|
435
|
+
description:
|
|
436
|
+
'Intesity of LED strip when off. 101 = Syncronized with default all LED strip intensity parameter.',
|
|
437
|
+
},
|
|
438
|
+
defaultLed2ColorWhenOn: {
|
|
439
|
+
ID: 65,
|
|
440
|
+
dataType: UINT8,
|
|
441
|
+
min: 0,
|
|
442
|
+
max: 255,
|
|
443
|
+
description:
|
|
444
|
+
'0-254:This is the color of the LED strip in a hex representation. 255:Synchronization with default all LED strip color parameter.',
|
|
445
|
+
},
|
|
446
|
+
defaultLed2ColorWhenOff: {
|
|
447
|
+
ID: 66,
|
|
448
|
+
dataType: UINT8,
|
|
449
|
+
min: 0,
|
|
450
|
+
max: 255,
|
|
451
|
+
description:
|
|
452
|
+
'0-254:This is the color of the LED strip in a hex representation. 255:Synchronization with default all LED strip color parameter.',
|
|
453
|
+
},
|
|
454
|
+
defaultLed2IntensityWhenOn: {
|
|
455
|
+
ID: 67,
|
|
456
|
+
dataType: UINT8,
|
|
457
|
+
min: 0,
|
|
458
|
+
max: 101,
|
|
459
|
+
description:
|
|
460
|
+
'Intesity of LED strip when on. 101 = Syncronized with default all LED strip intensity parameter.',
|
|
461
|
+
},
|
|
462
|
+
defaultLed2IntensityWhenOff: {
|
|
463
|
+
ID: 68,
|
|
464
|
+
dataType: UINT8,
|
|
465
|
+
min: 0,
|
|
466
|
+
max: 101,
|
|
467
|
+
description:
|
|
468
|
+
'Intesity of LED strip when off. 101 = Syncronized with default all LED strip intensity parameter.',
|
|
469
|
+
},
|
|
470
|
+
defaultLed3ColorWhenOn: {
|
|
471
|
+
ID: 70,
|
|
472
|
+
dataType: UINT8,
|
|
473
|
+
min: 0,
|
|
474
|
+
max: 255,
|
|
475
|
+
description:
|
|
476
|
+
'0-254:This is the color of the LED strip in a hex representation. 255:Synchronization with default all LED strip color parameter.',
|
|
477
|
+
},
|
|
478
|
+
defaultLed3ColorWhenOff: {
|
|
479
|
+
ID: 71,
|
|
480
|
+
dataType: UINT8,
|
|
481
|
+
min: 0,
|
|
482
|
+
max: 255,
|
|
483
|
+
description:
|
|
484
|
+
'0-254:This is the color of the LED strip in a hex representation. 255:Synchronization with default all LED strip color parameter.',
|
|
485
|
+
},
|
|
486
|
+
defaultLed3IntensityWhenOn: {
|
|
487
|
+
ID: 72,
|
|
488
|
+
dataType: UINT8,
|
|
489
|
+
min: 0,
|
|
490
|
+
max: 101,
|
|
491
|
+
description:
|
|
492
|
+
'Intesity of LED strip when on. 101 = Syncronized with default all LED strip intensity parameter.',
|
|
493
|
+
},
|
|
494
|
+
defaultLed3IntensityWhenOff: {
|
|
495
|
+
ID: 73,
|
|
496
|
+
dataType: UINT8,
|
|
497
|
+
min: 0,
|
|
498
|
+
max: 101,
|
|
499
|
+
description:
|
|
500
|
+
'Intesity of LED strip when off. 101 = Syncronized with default all LED strip intensity parameter.',
|
|
501
|
+
},
|
|
502
|
+
defaultLed4ColorWhenOn: {
|
|
503
|
+
ID: 75,
|
|
504
|
+
dataType: UINT8,
|
|
505
|
+
min: 0,
|
|
506
|
+
max: 255,
|
|
507
|
+
description:
|
|
508
|
+
'0-254:This is the color of the LED strip in a hex representation. 255:Synchronization with default all LED strip color parameter.',
|
|
509
|
+
},
|
|
510
|
+
defaultLed4ColorWhenOff: {
|
|
511
|
+
ID: 76,
|
|
512
|
+
dataType: UINT8,
|
|
513
|
+
min: 0,
|
|
514
|
+
max: 255,
|
|
515
|
+
description:
|
|
516
|
+
'0-254:This is the color of the LED strip in a hex representation. 255:Synchronization with default all LED strip color parameter.',
|
|
517
|
+
},
|
|
518
|
+
defaultLed4IntensityWhenOn: {
|
|
519
|
+
ID: 77,
|
|
520
|
+
dataType: UINT8,
|
|
521
|
+
min: 0,
|
|
522
|
+
max: 101,
|
|
523
|
+
description:
|
|
524
|
+
'Intesity of LED strip when on. 101 = Syncronized with default all LED strip intensity parameter.',
|
|
525
|
+
},
|
|
526
|
+
defaultLed4IntensityWhenOff: {
|
|
527
|
+
ID: 78,
|
|
528
|
+
dataType: UINT8,
|
|
529
|
+
min: 0,
|
|
530
|
+
max: 101,
|
|
531
|
+
description:
|
|
532
|
+
'Intesity of LED strip when off. 101 = Syncronized with default all LED strip intensity parameter.',
|
|
533
|
+
},
|
|
534
|
+
defaultLed5ColorWhenOn: {
|
|
535
|
+
ID: 80,
|
|
536
|
+
dataType: UINT8,
|
|
537
|
+
min: 0,
|
|
538
|
+
max: 255,
|
|
539
|
+
description:
|
|
540
|
+
'0-254:This is the color of the LED strip in a hex representation. 255:Synchronization with default all LED strip color parameter.',
|
|
541
|
+
},
|
|
542
|
+
defaultLed5ColorWhenOff: {
|
|
543
|
+
ID: 81,
|
|
544
|
+
dataType: UINT8,
|
|
545
|
+
min: 0,
|
|
546
|
+
max: 255,
|
|
547
|
+
description:
|
|
548
|
+
'0-254:This is the color of the LED strip in a hex representation. 255:Synchronization with default all LED strip color parameter.',
|
|
549
|
+
},
|
|
550
|
+
defaultLed5IntensityWhenOn: {
|
|
551
|
+
ID: 82,
|
|
552
|
+
dataType: UINT8,
|
|
553
|
+
min: 0,
|
|
554
|
+
max: 101,
|
|
555
|
+
description:
|
|
556
|
+
'Intesity of LED strip when on. 101 = Syncronized with default all LED strip intensity parameter.',
|
|
557
|
+
},
|
|
558
|
+
defaultLed5IntensityWhenOff: {
|
|
559
|
+
ID: 83,
|
|
560
|
+
dataType: UINT8,
|
|
561
|
+
min: 0,
|
|
562
|
+
max: 101,
|
|
563
|
+
description:
|
|
564
|
+
'Intesity of LED strip when off. 101 = Syncronized with default all LED strip intensity parameter.',
|
|
565
|
+
},
|
|
566
|
+
defaultLed6ColorWhenOn: {
|
|
567
|
+
ID: 85,
|
|
568
|
+
dataType: UINT8,
|
|
569
|
+
min: 0,
|
|
570
|
+
max: 255,
|
|
571
|
+
description:
|
|
572
|
+
'0-254:This is the color of the LED strip in a hex representation. 255:Synchronization with default all LED strip color parameter.',
|
|
573
|
+
},
|
|
574
|
+
defaultLed6ColorWhenOff: {
|
|
575
|
+
ID: 86,
|
|
576
|
+
dataType: UINT8,
|
|
577
|
+
min: 0,
|
|
578
|
+
max: 255,
|
|
579
|
+
description:
|
|
580
|
+
'0-254:This is the color of the LED strip in a hex representation. 255:Synchronization with default all LED strip color parameter.',
|
|
581
|
+
},
|
|
582
|
+
defaultLed6IntensityWhenOn: {
|
|
583
|
+
ID: 87,
|
|
584
|
+
dataType: UINT8,
|
|
585
|
+
min: 0,
|
|
586
|
+
max: 101,
|
|
587
|
+
description:
|
|
588
|
+
'Intesity of LED strip when on. 101 = Syncronized with default all LED strip intensity parameter.',
|
|
589
|
+
},
|
|
590
|
+
defaultLed6IntensityWhenOff: {
|
|
591
|
+
ID: 88,
|
|
592
|
+
dataType: UINT8,
|
|
593
|
+
min: 0,
|
|
594
|
+
max: 101,
|
|
595
|
+
description:
|
|
596
|
+
'Intesity of LED strip when off. 101 = Syncronized with default all LED strip intensity parameter.',
|
|
597
|
+
},
|
|
598
|
+
defaultLed7ColorWhenOn: {
|
|
599
|
+
ID: 90,
|
|
600
|
+
dataType: UINT8,
|
|
601
|
+
min: 0,
|
|
602
|
+
max: 255,
|
|
603
|
+
description:
|
|
604
|
+
'0-254:This is the color of the LED strip in a hex representation. 255:Synchronization with default all LED strip color parameter.',
|
|
605
|
+
},
|
|
606
|
+
defaultLed7ColorWhenOff: {
|
|
607
|
+
ID: 91,
|
|
608
|
+
dataType: UINT8,
|
|
609
|
+
min: 0,
|
|
610
|
+
max: 255,
|
|
611
|
+
description:
|
|
612
|
+
'0-254:This is the color of the LED strip in a hex representation. 255:Synchronization with default all LED strip color parameter.',
|
|
613
|
+
},
|
|
614
|
+
defaultLed7IntensityWhenOn: {
|
|
615
|
+
ID: 92,
|
|
616
|
+
dataType: UINT8,
|
|
617
|
+
min: 0,
|
|
618
|
+
max: 101,
|
|
619
|
+
description:
|
|
620
|
+
'Intesity of LED strip when on. 101 = Syncronized with default all LED strip intensity parameter.',
|
|
621
|
+
},
|
|
622
|
+
defaultLed7IntensityWhenOff: {
|
|
623
|
+
ID: 93,
|
|
624
|
+
dataType: UINT8,
|
|
625
|
+
min: 0,
|
|
626
|
+
max: 101,
|
|
627
|
+
description:
|
|
628
|
+
'Intesity of LED strip when off. 101 = Syncronized with default all LED strip intensity parameter.',
|
|
629
|
+
},
|
|
630
|
+
doubleTapUpForFullBrightness: {
|
|
631
|
+
ID: 53,
|
|
632
|
+
dataType: BOOLEAN,
|
|
633
|
+
min: 0,
|
|
634
|
+
max: 1,
|
|
635
|
+
description: 'Result of a double tap on the up button.',
|
|
636
|
+
values: {
|
|
637
|
+
'Button Press Event Only': 0,
|
|
638
|
+
'Button Press Event + Set Load to 100%': 1,
|
|
639
|
+
},
|
|
640
|
+
displayType: 'enum',
|
|
641
|
+
},
|
|
642
|
+
relayClick: {
|
|
643
|
+
ID: 261,
|
|
644
|
+
dataType: BOOLEAN,
|
|
645
|
+
min: 0,
|
|
646
|
+
max: 1,
|
|
647
|
+
description:
|
|
648
|
+
'In neutral on/off setups, the default is to have a clicking sound to notify you that the relay ' +
|
|
649
|
+
'is open or closed. You may disable this sound by creating a, “simulated” on/off where the switch ' +
|
|
650
|
+
'only will turn onto 100 or off to 0.',
|
|
651
|
+
values: {'Disabled (Click Sound On)': 0, 'Enabled (Click Sound Off)': 1},
|
|
652
|
+
displayType: 'enum',
|
|
653
|
+
},
|
|
654
|
+
doubleTapClearNotifications: {
|
|
655
|
+
ID: 262,
|
|
656
|
+
dataType: BOOLEAN,
|
|
657
|
+
min: 0,
|
|
658
|
+
max: 1,
|
|
659
|
+
description: 'Double-Tap the Config button to clear notifications.',
|
|
660
|
+
values: {'Enabled (Default)': 0, 'Disabled': 1},
|
|
661
|
+
displayType: 'enum',
|
|
662
|
+
},
|
|
663
|
+
};
|
|
664
|
+
|
|
665
|
+
const tzLocal = {};
|
|
666
|
+
|
|
667
|
+
// Generate toZigbee items from attribute list.
|
|
668
|
+
|
|
669
|
+
tzLocal.inovelli_vzw31sn_parameters = {
|
|
670
|
+
key: Object.keys(ATTRIBUTES).filter((a) => !ATTRIBUTES[a].readOnly),
|
|
671
|
+
convertSet: async (entity, key, value, meta) => {
|
|
672
|
+
const payload = {
|
|
673
|
+
[ATTRIBUTES[key].ID]: {
|
|
674
|
+
value:
|
|
675
|
+
ATTRIBUTES[key].displayType === 'enum' ?
|
|
676
|
+
ATTRIBUTES[key].values[value] :
|
|
677
|
+
value,
|
|
678
|
+
type: ATTRIBUTES[key].dataType,
|
|
679
|
+
},
|
|
680
|
+
};
|
|
681
|
+
|
|
682
|
+
await entity.write('manuSpecificInovelliVZM31SN', payload, {
|
|
683
|
+
manufacturerCode: INOVELLI,
|
|
684
|
+
});
|
|
685
|
+
|
|
686
|
+
meta.state[key] = value;
|
|
687
|
+
|
|
688
|
+
return {
|
|
689
|
+
state: {
|
|
690
|
+
[key]: value,
|
|
691
|
+
},
|
|
692
|
+
};
|
|
693
|
+
},
|
|
694
|
+
convertGet: async (entity, key, meta) => {
|
|
695
|
+
const value = await entity.read('manuSpecificInovelliVZM31SN', [key], {
|
|
696
|
+
manufacturerCode: INOVELLI,
|
|
697
|
+
});
|
|
698
|
+
|
|
699
|
+
if (ATTRIBUTES[key].displayType === 'enum') {
|
|
700
|
+
const valueState = Object.keys(ATTRIBUTES[key].values).find(
|
|
701
|
+
(a) => ATTRIBUTES[key].values[a] === value[key],
|
|
702
|
+
);
|
|
703
|
+
meta.state[key] = valueState;
|
|
704
|
+
return {
|
|
705
|
+
state: {
|
|
706
|
+
[key]: valueState,
|
|
707
|
+
},
|
|
708
|
+
};
|
|
709
|
+
} else {
|
|
710
|
+
meta.state[key] = value[key];
|
|
711
|
+
return {state: value};
|
|
712
|
+
}
|
|
713
|
+
},
|
|
714
|
+
};
|
|
715
|
+
|
|
716
|
+
tzLocal.inovelli_vzw31sn_parameters_readOnly = {
|
|
717
|
+
key: Object.keys(ATTRIBUTES).filter((a) => ATTRIBUTES[a].readOnly),
|
|
718
|
+
convertGet: async (entity, key, meta) => {
|
|
719
|
+
const value = await entity.read('manuSpecificInovelliVZM31SN', [key], {
|
|
720
|
+
manufacturerCode: INOVELLI,
|
|
721
|
+
});
|
|
722
|
+
|
|
723
|
+
if (ATTRIBUTES[key].displayType === 'enum') {
|
|
724
|
+
const valueState = Object.keys(ATTRIBUTES[key].values).find(
|
|
725
|
+
(a) => ATTRIBUTES[key].values[a] === value[key],
|
|
726
|
+
);
|
|
727
|
+
meta.state[key] = valueState;
|
|
728
|
+
return {
|
|
729
|
+
state: {
|
|
730
|
+
[key]: valueState,
|
|
731
|
+
},
|
|
732
|
+
};
|
|
733
|
+
} else {
|
|
734
|
+
meta.state[key] = value[key];
|
|
735
|
+
return {state: value};
|
|
736
|
+
}
|
|
737
|
+
},
|
|
738
|
+
convertSet: undefined,
|
|
739
|
+
};
|
|
740
|
+
|
|
741
|
+
tzLocal.inovelli_led_effect = {
|
|
742
|
+
key: ['led_effect'],
|
|
743
|
+
convertSet: async (entity, key, values, meta) => {
|
|
744
|
+
await entity.command(
|
|
745
|
+
'manuSpecificInovelliVZM31SN',
|
|
746
|
+
'ledEffect',
|
|
747
|
+
{
|
|
748
|
+
effect: ledEffects[values.effect],
|
|
749
|
+
color: Math.min(Math.max(0, values.color), 255),
|
|
750
|
+
level: Math.min(Math.max(0, values.level), 100),
|
|
751
|
+
duration: Math.min(Math.max(0, values.duration), 255),
|
|
752
|
+
},
|
|
753
|
+
{disableResponse: true, disableDefaultResponse: true},
|
|
754
|
+
);
|
|
755
|
+
return {state: {[key]: values}};
|
|
756
|
+
},
|
|
757
|
+
};
|
|
758
|
+
|
|
759
|
+
tzLocal.inovelli_individual_led_effect = {
|
|
760
|
+
key: ['individual_led_effect'],
|
|
761
|
+
convertSet: async (entity, key, values, meta) => {
|
|
762
|
+
await entity.command(
|
|
763
|
+
'manuSpecificInovelliVZM31SN',
|
|
764
|
+
'individualLedEffect',
|
|
765
|
+
{
|
|
766
|
+
led: Math.min(Math.max(0, parseInt(values.led)), 7),
|
|
767
|
+
effect: individualLedEffects[values.effect],
|
|
768
|
+
color: Math.min(Math.max(0, values.color), 255),
|
|
769
|
+
level: Math.min(Math.max(0, values.level), 100),
|
|
770
|
+
duration: Math.min(Math.max(0, values.duration), 255),
|
|
771
|
+
},
|
|
772
|
+
{disableResponse: true, disableDefaultResponse: true},
|
|
773
|
+
);
|
|
774
|
+
return {state: {[key]: values}};
|
|
775
|
+
},
|
|
776
|
+
};
|
|
777
|
+
|
|
778
|
+
/*
|
|
779
|
+
* Inovelli VZM31SN has a default transition property that the device should
|
|
780
|
+
* fallback to if a transition is not specified by passing 0xffff
|
|
781
|
+
*/
|
|
782
|
+
const inovelliOnOffConvertSet = async (entity, key, value, meta) => {
|
|
783
|
+
const state = meta.message.hasOwnProperty('state') ?
|
|
784
|
+
meta.message.state.toLowerCase() :
|
|
785
|
+
null;
|
|
786
|
+
utils.validateValue(state, ['toggle', 'off', 'on']);
|
|
787
|
+
|
|
788
|
+
if (
|
|
789
|
+
state === 'on' &&
|
|
790
|
+
(meta.message.hasOwnProperty('on_time') ||
|
|
791
|
+
meta.message.hasOwnProperty('off_wait_time'))
|
|
792
|
+
) {
|
|
793
|
+
const onTime = meta.message.hasOwnProperty('on_time') ?
|
|
794
|
+
meta.message.on_time :
|
|
795
|
+
0;
|
|
796
|
+
const offWaitTime = meta.message.hasOwnProperty('off_wait_time') ?
|
|
797
|
+
meta.message.off_wait_time :
|
|
798
|
+
0;
|
|
799
|
+
|
|
800
|
+
if (typeof onTime !== 'number') {
|
|
801
|
+
throw Error('The on_time value must be a number!');
|
|
802
|
+
}
|
|
803
|
+
if (typeof offWaitTime !== 'number') {
|
|
804
|
+
throw Error('The off_wait_time value must be a number!');
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
const payload = {
|
|
808
|
+
ctrlbits: 0,
|
|
809
|
+
ontime: meta.message.hasOwnProperty('on_time') ?
|
|
810
|
+
Math.round(onTime * 10) :
|
|
811
|
+
0xffff,
|
|
812
|
+
offwaittime: meta.message.hasOwnProperty('off_wait_time') ?
|
|
813
|
+
Math.round(offWaitTime * 10) :
|
|
814
|
+
0xffff,
|
|
815
|
+
};
|
|
816
|
+
await entity.command(
|
|
817
|
+
'genOnOff',
|
|
818
|
+
'onWithTimedOff',
|
|
819
|
+
payload,
|
|
820
|
+
utils.getOptions(meta.mapped, entity),
|
|
821
|
+
);
|
|
822
|
+
} else {
|
|
823
|
+
await entity.command(
|
|
824
|
+
'genOnOff',
|
|
825
|
+
state,
|
|
826
|
+
{},
|
|
827
|
+
utils.getOptions(meta.mapped, entity),
|
|
828
|
+
);
|
|
829
|
+
if (state === 'toggle') {
|
|
830
|
+
const currentState =
|
|
831
|
+
meta.state[
|
|
832
|
+
`state${meta.endpoint_name ? `_${meta.endpoint_name}` : ''}`
|
|
833
|
+
];
|
|
834
|
+
return currentState ?
|
|
835
|
+
{state: {state: currentState === 'OFF' ? 'ON' : 'OFF'}} :
|
|
836
|
+
{};
|
|
837
|
+
} else {
|
|
838
|
+
return {state: {state: state.toUpperCase()}};
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
};
|
|
842
|
+
|
|
843
|
+
/**
|
|
844
|
+
* Inovelli VZM31SN has a default transition property that the device should
|
|
845
|
+
* fallback to if a transition is not specified by passing 0xffff
|
|
846
|
+
*/
|
|
847
|
+
tzLocal.light_onoff_brightness_inovelli = {
|
|
848
|
+
key: ['state', 'brightness', 'brightness_percent'],
|
|
849
|
+
convertSet: async (entity, key, value, meta) => {
|
|
850
|
+
const {message} = meta;
|
|
851
|
+
const transition = utils.getTransition(entity, 'brightness', meta);
|
|
852
|
+
const turnsOffAtBrightness1 = utils.getMetaValue(
|
|
853
|
+
entity,
|
|
854
|
+
meta.mapped,
|
|
855
|
+
'turnsOffAtBrightness1',
|
|
856
|
+
'allEqual',
|
|
857
|
+
false,
|
|
858
|
+
);
|
|
859
|
+
let state = message.hasOwnProperty('state') ?
|
|
860
|
+
message.state.toLowerCase() :
|
|
861
|
+
undefined;
|
|
862
|
+
let brightness = undefined;
|
|
863
|
+
if (message.hasOwnProperty('brightness')) {
|
|
864
|
+
brightness = Number(message.brightness);
|
|
865
|
+
} else if (message.hasOwnProperty('brightness_percent')) {
|
|
866
|
+
brightness = utils.mapNumberRange(
|
|
867
|
+
Number(message.brightness_percent),
|
|
868
|
+
0,
|
|
869
|
+
100,
|
|
870
|
+
0,
|
|
871
|
+
255,
|
|
872
|
+
);
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
if (
|
|
876
|
+
brightness !== undefined &&
|
|
877
|
+
(isNaN(brightness) || brightness < 0 || brightness > 255)
|
|
878
|
+
) {
|
|
879
|
+
// Allow 255 value, changing this to 254 would be a breaking change.
|
|
880
|
+
throw new Error(
|
|
881
|
+
`Brightness value of message: '${JSON.stringify(
|
|
882
|
+
message,
|
|
883
|
+
)}' invalid, must be a number >= 0 and =< 254`,
|
|
884
|
+
);
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
if (
|
|
888
|
+
state !== undefined &&
|
|
889
|
+
['on', 'off', 'toggle'].includes(state) === false
|
|
890
|
+
) {
|
|
891
|
+
throw new Error(
|
|
892
|
+
`State value of message: '${JSON.stringify(
|
|
893
|
+
message,
|
|
894
|
+
)}' invalid, must be 'ON', 'OFF' or 'TOGGLE'`,
|
|
895
|
+
);
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
if (
|
|
899
|
+
state === 'toggle' ||
|
|
900
|
+
state === 'off' ||
|
|
901
|
+
(brightness === undefined && state === 'on')
|
|
902
|
+
) {
|
|
903
|
+
if (transition.specified && transition.time > 0) {
|
|
904
|
+
if (state === 'toggle') {
|
|
905
|
+
state = meta.state.state === 'ON' ? 'off' : 'on';
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
if (
|
|
909
|
+
state === 'off' &&
|
|
910
|
+
meta.state.brightness &&
|
|
911
|
+
meta.state.state === 'ON'
|
|
912
|
+
) {
|
|
913
|
+
// https://github.com/Koenkk/zigbee2mqtt/issues/2850#issuecomment-580365633
|
|
914
|
+
// We need to remember the state before turning the device off as we need to restore
|
|
915
|
+
// it once we turn it on again.
|
|
916
|
+
// We cannot rely on the meta.state as when reporting is enabled the bulb will reports
|
|
917
|
+
// it brightness while decreasing the brightness.
|
|
918
|
+
globalStore.putValue(entity, 'brightness', meta.state.brightness);
|
|
919
|
+
globalStore.putValue(entity, 'turnedOffWithTransition', true);
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
const fallbackLevel = utils.getObjectProperty(
|
|
923
|
+
meta.state,
|
|
924
|
+
'brightness',
|
|
925
|
+
254,
|
|
926
|
+
);
|
|
927
|
+
let level =
|
|
928
|
+
state === 'off' ?
|
|
929
|
+
0 :
|
|
930
|
+
globalStore.getValue(entity, 'brightness', fallbackLevel);
|
|
931
|
+
if (state === 'on' && level === 0) {
|
|
932
|
+
level = turnsOffAtBrightness1 ? 2 : 1;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
const payload = {level, transtime: transition.time};
|
|
936
|
+
await entity.command(
|
|
937
|
+
'genLevelCtrl',
|
|
938
|
+
'moveToLevelWithOnOff',
|
|
939
|
+
payload,
|
|
940
|
+
utils.getOptions(meta.mapped, entity),
|
|
941
|
+
);
|
|
942
|
+
const result = {state: {state: state.toUpperCase()}};
|
|
943
|
+
if (state === 'on') result.state.brightness = level;
|
|
944
|
+
return result;
|
|
945
|
+
} else {
|
|
946
|
+
if (
|
|
947
|
+
state === 'on' &&
|
|
948
|
+
globalStore.getValue(entity, 'turnedOffWithTransition') === true
|
|
949
|
+
) {
|
|
950
|
+
/**
|
|
951
|
+
* In case the bulb it turned OFF with a transition and turned ON WITHOUT
|
|
952
|
+
* a transition, the brightness is not recovered as it turns on with brightness 1.
|
|
953
|
+
* https://github.com/Koenkk/../issues/1073
|
|
954
|
+
*/
|
|
955
|
+
globalStore.putValue(entity, 'turnedOffWithTransition', false);
|
|
956
|
+
await entity.command(
|
|
957
|
+
'genLevelCtrl',
|
|
958
|
+
'moveToLevelWithOnOff',
|
|
959
|
+
{
|
|
960
|
+
level: globalStore.getValue(entity, 'brightness'),
|
|
961
|
+
transtime: transition.specified ? transition.time : 0xffff,
|
|
962
|
+
},
|
|
963
|
+
utils.getOptions(meta.mapped, entity),
|
|
964
|
+
);
|
|
965
|
+
const defaultTransitionTime = await entity.read(
|
|
966
|
+
'manuSpecificInovelliVZM31SN',
|
|
967
|
+
['rampRateOffToOnRemote'],
|
|
968
|
+
);
|
|
969
|
+
return {
|
|
970
|
+
state: {state: 'ON'},
|
|
971
|
+
readAfterWriteTime: transition.specified ?
|
|
972
|
+
transition.time * 100 :
|
|
973
|
+
defaultTransitionTime.rampRateOffToOnRemote * 100,
|
|
974
|
+
};
|
|
975
|
+
} else {
|
|
976
|
+
// Store brightness where the bulb was turned off with as we need it when the bulb is turned on
|
|
977
|
+
// with transition.
|
|
978
|
+
if (meta.state.hasOwnProperty('brightness') && state === 'off') {
|
|
979
|
+
globalStore.putValue(entity, 'brightness', meta.state.brightness);
|
|
980
|
+
globalStore.putValue(entity, 'turnedOffWithTransition', true);
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
const result = await inovelliOnOffConvertSet(
|
|
984
|
+
entity,
|
|
985
|
+
'state',
|
|
986
|
+
state,
|
|
987
|
+
meta,
|
|
988
|
+
);
|
|
989
|
+
|
|
990
|
+
result.readAfterWriteTime = 0;
|
|
991
|
+
if (
|
|
992
|
+
result.state &&
|
|
993
|
+
result.state.state === 'ON' &&
|
|
994
|
+
meta.state.brightness === 0
|
|
995
|
+
) {
|
|
996
|
+
result.state.brightness = 1;
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
return result;
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
} else {
|
|
1003
|
+
brightness = Math.min(254, brightness);
|
|
1004
|
+
if (brightness === 1 && turnsOffAtBrightness1) {
|
|
1005
|
+
brightness = 2;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
globalStore.putValue(entity, 'brightness', brightness);
|
|
1009
|
+
await entity.command(
|
|
1010
|
+
'genLevelCtrl',
|
|
1011
|
+
'moveToLevelWithOnOff',
|
|
1012
|
+
{
|
|
1013
|
+
level: Number(brightness),
|
|
1014
|
+
transtime: !transition.specified ? 0xffff : transition.time,
|
|
1015
|
+
},
|
|
1016
|
+
utils.getOptions(meta.mapped, entity),
|
|
1017
|
+
);
|
|
1018
|
+
|
|
1019
|
+
const defaultTransitionTime = await entity.read(
|
|
1020
|
+
'manuSpecificInovelliVZM31SN',
|
|
1021
|
+
['rampRateOnToOffRemote'],
|
|
1022
|
+
);
|
|
1023
|
+
|
|
1024
|
+
return {
|
|
1025
|
+
state: {
|
|
1026
|
+
state: brightness === 0 ? 'OFF' : 'ON',
|
|
1027
|
+
brightness: Number(brightness),
|
|
1028
|
+
},
|
|
1029
|
+
readAfterWriteTime:
|
|
1030
|
+
transition.time === 0 ?
|
|
1031
|
+
defaultTransitionTime.rampRateOnToOffRemote * 100 :
|
|
1032
|
+
transition.time * 100, // need on speed
|
|
1033
|
+
};
|
|
1034
|
+
}
|
|
1035
|
+
},
|
|
1036
|
+
convertGet: async (entity, key, meta) => {
|
|
1037
|
+
if (key === 'brightness') {
|
|
1038
|
+
await entity.read('genLevelCtrl', ['currentLevel']);
|
|
1039
|
+
} else if (key === 'state') {
|
|
1040
|
+
await tz.on_off.convertGet(entity, key, meta);
|
|
1041
|
+
}
|
|
1042
|
+
},
|
|
1043
|
+
};
|
|
1044
|
+
|
|
1045
|
+
const fzLocal = {
|
|
1046
|
+
inovelli_vzm31sn: {
|
|
1047
|
+
cluster: 'manuSpecificInovelliVZM31SN',
|
|
1048
|
+
type: ['raw', 'readResponse', 'commandQueryNextImageRequest'],
|
|
1049
|
+
convert: (model, msg, publish, options, meta) => {
|
|
1050
|
+
const command = msg.data[4]; // maybe 0
|
|
1051
|
+
if (msg.endpoint.ID == 2 && command === 0x00) {
|
|
1052
|
+
// Scene Event
|
|
1053
|
+
// # byte 1 - msg.data[6]
|
|
1054
|
+
// # 0 - pressed
|
|
1055
|
+
// # 1 - released
|
|
1056
|
+
// # 2 - held
|
|
1057
|
+
// # 3 - 2x
|
|
1058
|
+
// # 4 - 3x
|
|
1059
|
+
// # 5 - 4x
|
|
1060
|
+
// # 6 - 5x
|
|
1061
|
+
|
|
1062
|
+
// # byte 2 - msg.data[5]
|
|
1063
|
+
// # 1 - down button
|
|
1064
|
+
// # 2 - up button
|
|
1065
|
+
// # 3 - config button
|
|
1066
|
+
|
|
1067
|
+
const button = buttonLookup[msg.data[5]];
|
|
1068
|
+
const action = clickLookup[msg.data[6]];
|
|
1069
|
+
return {action: `${button}_${action}`};
|
|
1070
|
+
}
|
|
1071
|
+
},
|
|
1072
|
+
},
|
|
1073
|
+
};
|
|
1074
|
+
|
|
1075
|
+
const exposesList = [
|
|
1076
|
+
e.light_brightness(),
|
|
1077
|
+
e.power(),
|
|
1078
|
+
e.energy(),
|
|
1079
|
+
exposes
|
|
1080
|
+
.composite('led_effect', 'led_effect', ea.STATE_SET)
|
|
1081
|
+
.withFeature(
|
|
1082
|
+
exposes
|
|
1083
|
+
.enum('effect', ea.STATE_SET, [
|
|
1084
|
+
'off',
|
|
1085
|
+
'solid',
|
|
1086
|
+
'fast_blink',
|
|
1087
|
+
'slow_blink',
|
|
1088
|
+
'pulse',
|
|
1089
|
+
'chase',
|
|
1090
|
+
'open_close',
|
|
1091
|
+
'small_to_big',
|
|
1092
|
+
'aurora',
|
|
1093
|
+
'slow_falling',
|
|
1094
|
+
'medium_falling',
|
|
1095
|
+
'fast_falling',
|
|
1096
|
+
'slow_rising',
|
|
1097
|
+
'medium_rising',
|
|
1098
|
+
'fast_rising',
|
|
1099
|
+
'medium_blink',
|
|
1100
|
+
'slow_chase',
|
|
1101
|
+
'fast_chase',
|
|
1102
|
+
'fast_siren',
|
|
1103
|
+
'slow_siren',
|
|
1104
|
+
'clear_effect',
|
|
1105
|
+
])
|
|
1106
|
+
.withDescription('Animation Effect to use for the LEDs'),
|
|
1107
|
+
)
|
|
1108
|
+
.withFeature(
|
|
1109
|
+
exposes
|
|
1110
|
+
.numeric('color', ea.STATE_SET)
|
|
1111
|
+
.withValueMin(0)
|
|
1112
|
+
.withValueMax(255)
|
|
1113
|
+
.withDescription(
|
|
1114
|
+
'Calculated by using a hue color circle(value/255*360) If color = 255 display white',
|
|
1115
|
+
),
|
|
1116
|
+
)
|
|
1117
|
+
.withFeature(
|
|
1118
|
+
exposes
|
|
1119
|
+
.numeric('level', ea.STATE_SET)
|
|
1120
|
+
.withValueMin(0)
|
|
1121
|
+
.withValueMax(100)
|
|
1122
|
+
.withDescription('Brightness of the LEDs'),
|
|
1123
|
+
)
|
|
1124
|
+
.withFeature(
|
|
1125
|
+
exposes
|
|
1126
|
+
.numeric('duration', ea.STATE_SET)
|
|
1127
|
+
.withValueMin(0)
|
|
1128
|
+
.withValueMax(255)
|
|
1129
|
+
.withDescription(
|
|
1130
|
+
'1-60 is in seconds calculated 61-120 is in minutes calculated by(value-60) ' +
|
|
1131
|
+
'Example a value of 65 would be 65-60 = 5 minutes - 120-254 Is in hours calculated by(value-120) ' +
|
|
1132
|
+
'Example a value of 132 would be 132-120 would be 12 hours. - 255 Indefinitely',
|
|
1133
|
+
),
|
|
1134
|
+
),
|
|
1135
|
+
exposes
|
|
1136
|
+
.composite('individual_led_effect', 'individual_led_effect', ea.STATE_SET)
|
|
1137
|
+
.withFeature(
|
|
1138
|
+
exposes
|
|
1139
|
+
.enum('led', ea.STATE_SET, ['1', '2', '3', '4', '5', '6', '7'])
|
|
1140
|
+
.withDescription('Individual LED to target.'),
|
|
1141
|
+
)
|
|
1142
|
+
.withFeature(
|
|
1143
|
+
exposes
|
|
1144
|
+
.enum('effect', ea.STATE_SET, [
|
|
1145
|
+
'off',
|
|
1146
|
+
'solid',
|
|
1147
|
+
'fast_blink',
|
|
1148
|
+
'slow_blink',
|
|
1149
|
+
'pulse',
|
|
1150
|
+
'chase',
|
|
1151
|
+
'falling',
|
|
1152
|
+
'rising',
|
|
1153
|
+
'aurora',
|
|
1154
|
+
'clear_effect',
|
|
1155
|
+
])
|
|
1156
|
+
.withDescription('Animation Effect to use for the LED'),
|
|
1157
|
+
)
|
|
1158
|
+
.withFeature(
|
|
1159
|
+
exposes
|
|
1160
|
+
.numeric('color', ea.STATE_SET)
|
|
1161
|
+
.withValueMin(0)
|
|
1162
|
+
.withValueMax(255)
|
|
1163
|
+
.withDescription(
|
|
1164
|
+
'Calculated by using a hue color circle(value/255*360) If color = 255 display white',
|
|
1165
|
+
),
|
|
1166
|
+
)
|
|
1167
|
+
.withFeature(
|
|
1168
|
+
exposes
|
|
1169
|
+
.numeric('level', ea.STATE_SET)
|
|
1170
|
+
.withValueMin(0)
|
|
1171
|
+
.withValueMax(100)
|
|
1172
|
+
.withDescription('Brightness of the LED'),
|
|
1173
|
+
)
|
|
1174
|
+
.withFeature(
|
|
1175
|
+
exposes
|
|
1176
|
+
.numeric('duration', ea.STATE_SET)
|
|
1177
|
+
.withValueMin(0)
|
|
1178
|
+
.withValueMax(255)
|
|
1179
|
+
.withDescription(
|
|
1180
|
+
'1-60 is in seconds calculated 61-120 is in minutes calculated by(value-60) ' +
|
|
1181
|
+
'Example a value of 65 would be 65-60 = 5 minutes - 120-254 Is in hours calculated by(value-120) ' +
|
|
1182
|
+
' Example a value of 132 would be 132-120 would be 12 hours. - 255 Indefinitely',
|
|
1183
|
+
),
|
|
1184
|
+
),
|
|
1185
|
+
];
|
|
1186
|
+
|
|
1187
|
+
const toZigbee = [
|
|
1188
|
+
tzLocal.light_onoff_brightness_inovelli,
|
|
1189
|
+
tz.power_on_behavior,
|
|
1190
|
+
tzLocal.inovelli_led_effect,
|
|
1191
|
+
tzLocal.inovelli_individual_led_effect,
|
|
1192
|
+
tzLocal.inovelli_vzw31sn_parameters,
|
|
1193
|
+
tzLocal.inovelli_vzw31sn_parameters_readOnly,
|
|
1194
|
+
];
|
|
1195
|
+
|
|
1196
|
+
// Create Expose list with Inovelli Parameters
|
|
1197
|
+
Object.keys(ATTRIBUTES).forEach((key) => {
|
|
1198
|
+
if (ATTRIBUTES[key].displayType === 'enum') {
|
|
1199
|
+
const enumE = exposes
|
|
1200
|
+
.enum(
|
|
1201
|
+
key,
|
|
1202
|
+
ATTRIBUTES[key].readOnly ? ea.STATE_GET : ea.ALL,
|
|
1203
|
+
Object.keys(ATTRIBUTES[key].values),
|
|
1204
|
+
)
|
|
1205
|
+
.withDescription(ATTRIBUTES[key].description);
|
|
1206
|
+
exposesList.push(enumE);
|
|
1207
|
+
} else if (
|
|
1208
|
+
ATTRIBUTES[key].displayType === 'binary' ||
|
|
1209
|
+
ATTRIBUTES[key].displayType === 'switch'
|
|
1210
|
+
) {
|
|
1211
|
+
exposesList.push(
|
|
1212
|
+
exposes
|
|
1213
|
+
.binary(
|
|
1214
|
+
key,
|
|
1215
|
+
ATTRIBUTES[key].readOnly ? ea.STATE_GET : ea.ALL,
|
|
1216
|
+
ATTRIBUTES[key].values.Enabled,
|
|
1217
|
+
ATTRIBUTES[key].values.Disabled,
|
|
1218
|
+
)
|
|
1219
|
+
.withDescription(ATTRIBUTES[key].description),
|
|
1220
|
+
);
|
|
1221
|
+
} else {
|
|
1222
|
+
const numeric = exposes
|
|
1223
|
+
.numeric(key, ATTRIBUTES[key].readOnly ? ea.STATE_GET : ea.ALL)
|
|
1224
|
+
.withValueMin(ATTRIBUTES[key].min)
|
|
1225
|
+
.withValueMax(ATTRIBUTES[key].max);
|
|
1226
|
+
|
|
1227
|
+
if (ATTRIBUTES[key].values) {
|
|
1228
|
+
Object.keys(ATTRIBUTES[key].values).forEach((value) => {
|
|
1229
|
+
numeric.withPreset(value, ATTRIBUTES[key].values[value], '');
|
|
1230
|
+
});
|
|
1231
|
+
}
|
|
1232
|
+
if (ATTRIBUTES[key].unit) {
|
|
1233
|
+
numeric.withUnit(ATTRIBUTES[key].unit);
|
|
1234
|
+
}
|
|
1235
|
+
numeric.withDescription(ATTRIBUTES[key].description);
|
|
1236
|
+
exposesList.push(numeric);
|
|
1237
|
+
}
|
|
1238
|
+
});
|
|
1239
|
+
|
|
1240
|
+
// Put actions at the bottom of ui
|
|
1241
|
+
exposesList.push(
|
|
1242
|
+
e.action([
|
|
1243
|
+
'down_single',
|
|
1244
|
+
'up_single',
|
|
1245
|
+
'config_single',
|
|
1246
|
+
'down_release',
|
|
1247
|
+
'up_release',
|
|
1248
|
+
'config_release',
|
|
1249
|
+
'down_held',
|
|
1250
|
+
'up_held',
|
|
1251
|
+
'config_held',
|
|
1252
|
+
'down_double',
|
|
1253
|
+
'up_double',
|
|
1254
|
+
'config_double',
|
|
1255
|
+
'down_triple',
|
|
1256
|
+
'up_triple',
|
|
1257
|
+
'config_triple',
|
|
1258
|
+
'down_quadruple',
|
|
1259
|
+
'up_quadruple',
|
|
1260
|
+
'config_quadruple',
|
|
1261
|
+
'down_quintuple',
|
|
1262
|
+
'up_quintuple',
|
|
1263
|
+
'config_quintuple',
|
|
1264
|
+
]),
|
|
1265
|
+
);
|
|
1266
|
+
|
|
1267
|
+
module.exports = [
|
|
1268
|
+
{
|
|
1269
|
+
zigbeeModel: ['VZM31-SN'],
|
|
1270
|
+
model: 'VZM31-SN',
|
|
1271
|
+
vendor: 'Inovelli',
|
|
1272
|
+
description: 'Inovelli 2-in-1 switch + dimmer',
|
|
1273
|
+
exposes: exposesList,
|
|
1274
|
+
toZigbee: toZigbee,
|
|
1275
|
+
fromZigbee: [
|
|
1276
|
+
fz.on_off,
|
|
1277
|
+
fz.brightness,
|
|
1278
|
+
fz.level_config,
|
|
1279
|
+
fz.power_on_behavior,
|
|
1280
|
+
fz.ignore_basic_report,
|
|
1281
|
+
fz.electrical_measurement,
|
|
1282
|
+
fz.metering,
|
|
1283
|
+
fzLocal.inovelli_vzm31sn,
|
|
1284
|
+
],
|
|
1285
|
+
ota: ota.inovelli,
|
|
1286
|
+
configure: async (device, coordinatorEndpoint, logger) => {
|
|
1287
|
+
const endpoint = device.getEndpoint(1);
|
|
1288
|
+
await reporting.bind(endpoint, coordinatorEndpoint, [
|
|
1289
|
+
'seMetering',
|
|
1290
|
+
'haElectricalMeasurement',
|
|
1291
|
+
'genOnOff',
|
|
1292
|
+
'genLevelCtrl',
|
|
1293
|
+
]);
|
|
1294
|
+
await reporting.onOff(endpoint);
|
|
1295
|
+
|
|
1296
|
+
// Bind for Button Event Reporting
|
|
1297
|
+
const endpoint2 = device.getEndpoint(2);
|
|
1298
|
+
await reporting.bind(endpoint2, coordinatorEndpoint, [
|
|
1299
|
+
'manuSpecificInovelliVZM31SN',
|
|
1300
|
+
]);
|
|
1301
|
+
await endpoint.read('haElectricalMeasurement', [
|
|
1302
|
+
'acPowerMultiplier',
|
|
1303
|
+
'acPowerDivisor',
|
|
1304
|
+
]);
|
|
1305
|
+
await reporting.readMeteringMultiplierDivisor(endpoint);
|
|
1306
|
+
|
|
1307
|
+
await reporting.activePower(endpoint, {min: 15, max: 3600, change: 1});
|
|
1308
|
+
await reporting.currentSummDelivered(endpoint, {
|
|
1309
|
+
min: 15,
|
|
1310
|
+
max: 3600,
|
|
1311
|
+
change: 0,
|
|
1312
|
+
});
|
|
1313
|
+
},
|
|
1314
|
+
},
|
|
1315
|
+
];
|