@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,413 @@
|
|
|
1
|
+
const fz = require('../converters/fromZigbee');
|
|
2
|
+
const tz = require('../converters/toZigbee');
|
|
3
|
+
const exposes = require('../lib/exposes');
|
|
4
|
+
const reporting = require('../lib/reporting');
|
|
5
|
+
const utils = require('../lib/utils');
|
|
6
|
+
const e = exposes.presets;
|
|
7
|
+
const ea = exposes.access;
|
|
8
|
+
const ota = require('../lib/ota');
|
|
9
|
+
|
|
10
|
+
const switchTypeValues = [
|
|
11
|
+
'maintained_state',
|
|
12
|
+
'maintained_toggle',
|
|
13
|
+
'momentary_state',
|
|
14
|
+
'momentary_press',
|
|
15
|
+
'momentary_release',
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
const defaultOnOffStateValues = [
|
|
19
|
+
'on',
|
|
20
|
+
'off',
|
|
21
|
+
'previous',
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
const fzPerenio = {
|
|
25
|
+
diagnostic: {
|
|
26
|
+
cluster: 'haDiagnostic',
|
|
27
|
+
type: ['attributeReport', 'readResponse'],
|
|
28
|
+
convert: (model, msg, publish, options, meta) => {
|
|
29
|
+
const result = {};
|
|
30
|
+
if (msg.data.hasOwnProperty('lastMessageLqi')) {
|
|
31
|
+
result['last_message_lqi'] = msg.data['lastMessageLqi'];
|
|
32
|
+
}
|
|
33
|
+
if (msg.data.hasOwnProperty('lastMessageRssi')) {
|
|
34
|
+
result['last_message_rssi'] = msg.data['lastMessageRssi'];
|
|
35
|
+
}
|
|
36
|
+
return result;
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
switch_type: {
|
|
40
|
+
cluster: 'genMultistateValue',
|
|
41
|
+
type: ['attributeReport', 'readResponse'],
|
|
42
|
+
convert: (model, msg, publish, options, meta) => {
|
|
43
|
+
const result = {};
|
|
44
|
+
const switchTypeLookup = {
|
|
45
|
+
0x0001: 'momentary_state',
|
|
46
|
+
0x0010: 'maintained_state',
|
|
47
|
+
0x00CC: 'maintained_toggle',
|
|
48
|
+
0x00CD: 'momentary_release',
|
|
49
|
+
0x00DC: 'momentary_press',
|
|
50
|
+
};
|
|
51
|
+
if (msg.data.hasOwnProperty('presentValue')) {
|
|
52
|
+
const property = utils.postfixWithEndpointName('switch_type', msg, model, meta);
|
|
53
|
+
result[property] = switchTypeLookup[msg.data['presentValue']];
|
|
54
|
+
}
|
|
55
|
+
return result;
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
smart_plug: {
|
|
59
|
+
cluster: '64635',
|
|
60
|
+
type: ['attributeReport', 'readResponse'],
|
|
61
|
+
convert: (model, msg, publish, options, meta) => {
|
|
62
|
+
const result = {};
|
|
63
|
+
if (msg.data.hasOwnProperty(2)) {
|
|
64
|
+
result['rms_current'] = msg.data[2];
|
|
65
|
+
}
|
|
66
|
+
if (msg.data.hasOwnProperty(3)) {
|
|
67
|
+
result['rms_voltage'] = msg.data[3];
|
|
68
|
+
}
|
|
69
|
+
if (msg.data.hasOwnProperty(4)) {
|
|
70
|
+
result['voltage_min'] = msg.data[4];
|
|
71
|
+
}
|
|
72
|
+
if (msg.data.hasOwnProperty(5)) {
|
|
73
|
+
result['voltage_max'] = msg.data[5];
|
|
74
|
+
}
|
|
75
|
+
if (msg.data.hasOwnProperty(10)) {
|
|
76
|
+
result['active_power'] = msg.data[10];
|
|
77
|
+
}
|
|
78
|
+
if (msg.data.hasOwnProperty(11)) {
|
|
79
|
+
result['power_max'] = msg.data[11];
|
|
80
|
+
}
|
|
81
|
+
if (msg.data.hasOwnProperty(14)) {
|
|
82
|
+
result['consumed_energy'] = msg.data[14];
|
|
83
|
+
}
|
|
84
|
+
if (msg.data.hasOwnProperty(15)) {
|
|
85
|
+
result['consumed_energy_limit'] = msg.data[15];
|
|
86
|
+
}
|
|
87
|
+
if (msg.data.hasOwnProperty(24)) {
|
|
88
|
+
result['rssi'] = msg.data[24];
|
|
89
|
+
}
|
|
90
|
+
const powerOnStateLookup = {
|
|
91
|
+
0: 'off',
|
|
92
|
+
1: 'on',
|
|
93
|
+
2: 'previous',
|
|
94
|
+
};
|
|
95
|
+
if (msg.data.hasOwnProperty(0)) {
|
|
96
|
+
result['default_on_off_state'] = powerOnStateLookup[msg.data[0]];
|
|
97
|
+
}
|
|
98
|
+
if (msg.data.hasOwnProperty(1)) {
|
|
99
|
+
if (msg.data[1] == 0) {
|
|
100
|
+
result['alarm_voltage_min'] = false;
|
|
101
|
+
result['alarm_voltage_max'] = false;
|
|
102
|
+
result['alarm_power_max'] = false;
|
|
103
|
+
result['alarm_consumed_energy'] = false;
|
|
104
|
+
} else {
|
|
105
|
+
if (msg.data[1] & 1) {
|
|
106
|
+
result['alarm_voltage_min'] = true;
|
|
107
|
+
}
|
|
108
|
+
if (msg.data[1] & 2) {
|
|
109
|
+
result['alarm_voltage_max'] = true;
|
|
110
|
+
}
|
|
111
|
+
if (msg.data[1] & 4) {
|
|
112
|
+
result['alarm_power_max'] = true;
|
|
113
|
+
}
|
|
114
|
+
if (msg.data[1] & 8) {
|
|
115
|
+
result['alarm_consumed_energy'] = true;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return result;
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const tzPerenio = {
|
|
125
|
+
switch_type: {
|
|
126
|
+
key: ['switch_type'],
|
|
127
|
+
convertSet: async (entity, key, value, meta) => {
|
|
128
|
+
const switchTypeLookup = {
|
|
129
|
+
'momentary_state': 0x0001,
|
|
130
|
+
'maintained_state': 0x0010,
|
|
131
|
+
'maintained_toggle': 0x00CC,
|
|
132
|
+
'momentary_release': 0x00CD,
|
|
133
|
+
'momentary_press': 0x00DC,
|
|
134
|
+
};
|
|
135
|
+
await entity.write('genMultistateValue', {presentValue: switchTypeLookup[value]}, utils.getOptions(meta.mapped, entity));
|
|
136
|
+
return {state: {switch_type: value}};
|
|
137
|
+
},
|
|
138
|
+
convertGet: async (entity, key, meta) => {
|
|
139
|
+
await entity.read('genMultistateValue', ['presentValue']);
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
default_state: {
|
|
143
|
+
key: ['default_on_off_state'],
|
|
144
|
+
convertSet: async (entity, key, val, meta) => {
|
|
145
|
+
const powerOnStateLookup = {
|
|
146
|
+
'off': 0,
|
|
147
|
+
'on': 1,
|
|
148
|
+
'previous': 2,
|
|
149
|
+
};
|
|
150
|
+
await entity.write(64635, {0: {value: powerOnStateLookup[val], type: 0x20}}, {manufacturerCode: 0x007B});
|
|
151
|
+
return {state: {default_on_off_state: val}};
|
|
152
|
+
},
|
|
153
|
+
convertGet: async (entity, key, meta) => {
|
|
154
|
+
await entity.read(64635, [0]);
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
alarms_reset: {
|
|
158
|
+
key: ['alarm_voltage_min', 'alarm_voltage_max', 'alarm_power_max', 'alarm_consumed_energy'],
|
|
159
|
+
convertSet: async (entity, key, val, meta) => {
|
|
160
|
+
await entity.write(64635, {1: {value: 0, type: 0x20}}, {manufacturerCode: 0x007B});
|
|
161
|
+
return {state: {alarm_voltage_min: false, alarm_voltage_max: false, alarm_power_max: false, alarm_consumed_energy: false}};
|
|
162
|
+
},
|
|
163
|
+
convertGet: async (entity, key, meta) => {
|
|
164
|
+
await entity.read(64635, [1]);
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
alarms_limits: {
|
|
168
|
+
key: ['voltage_min', 'voltage_max', 'power_max', 'consumed_energy_limit'],
|
|
169
|
+
convertSet: async (entity, key, val, meta) => {
|
|
170
|
+
switch (key) {
|
|
171
|
+
case 'voltage_min':
|
|
172
|
+
await entity.write(64635, {4: {value: val, type: 0x21}}, {manufacturerCode: 0x007B});
|
|
173
|
+
break;
|
|
174
|
+
case 'voltage_max':
|
|
175
|
+
await entity.write(64635, {5: {value: val, type: 0x21}}, {manufacturerCode: 0x007B});
|
|
176
|
+
break;
|
|
177
|
+
case 'power_max':
|
|
178
|
+
await entity.write(64635, {11: {value: val, type: 0x21}}, {manufacturerCode: 0x007B});
|
|
179
|
+
break;
|
|
180
|
+
case 'consumed_energy_limit':
|
|
181
|
+
await entity.write(64635, {15: {value: val, type: 0x21}}, {manufacturerCode: 0x007B});
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
return {state: {[key]: val}};
|
|
185
|
+
},
|
|
186
|
+
convertGet: async (entity, key, meta) => {
|
|
187
|
+
switch (key) {
|
|
188
|
+
case 'voltage_min':
|
|
189
|
+
await entity.read(64635, [4]);
|
|
190
|
+
break;
|
|
191
|
+
case 'voltage_max':
|
|
192
|
+
await entity.read(64635, [5]);
|
|
193
|
+
break;
|
|
194
|
+
case 'power_max':
|
|
195
|
+
await entity.read(64635, [11]);
|
|
196
|
+
break;
|
|
197
|
+
case 'consumed_energy_limit':
|
|
198
|
+
await entity.read(64635, [15]);
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
on_off_mod: {
|
|
204
|
+
key: ['state', 'on_time', 'off_wait_time'],
|
|
205
|
+
convertSet: async (entity, key, value, meta) => {
|
|
206
|
+
const state = meta.message.hasOwnProperty('state') ? meta.message.state.toLowerCase() : null;
|
|
207
|
+
utils.validateValue(state, ['toggle', 'off', 'on']);
|
|
208
|
+
const alarmVoltageMin = meta.state[`alarm_voltage_min${meta.endpoint_name ? `_${meta.endpoint_name}` : ''}`];
|
|
209
|
+
const alarmVoltageMax = meta.state[`alarm_voltage_max${meta.endpoint_name ? `_${meta.endpoint_name}` : ''}`];
|
|
210
|
+
const alarmPowerMax = meta.state[`alarm_power_max${meta.endpoint_name ? `_${meta.endpoint_name}` : ''}`];
|
|
211
|
+
if (alarmVoltageMin || alarmVoltageMax || alarmPowerMax) {
|
|
212
|
+
return {state: {state: 'OFF'}};
|
|
213
|
+
}
|
|
214
|
+
if (state === 'on' && (meta.message.hasOwnProperty('on_time') || meta.message.hasOwnProperty('off_wait_time'))) {
|
|
215
|
+
const onTime = meta.message.hasOwnProperty('on_time') ? meta.message.on_time : 0;
|
|
216
|
+
const offWaitTime = meta.message.hasOwnProperty('off_wait_time') ? meta.message.off_wait_time : 0;
|
|
217
|
+
|
|
218
|
+
if (typeof onTime !== 'number') {
|
|
219
|
+
throw Error('The on_time value must be a number!');
|
|
220
|
+
}
|
|
221
|
+
if (typeof offWaitTime !== 'number') {
|
|
222
|
+
throw Error('The off_wait_time value must be a number!');
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
const payload = {ctrlbits: 0, ontime: Math.round(onTime * 10), offwaittime: Math.round(offWaitTime * 10)};
|
|
226
|
+
await entity.command('genOnOff', 'onWithTimedOff', payload, utils.getOptions(meta.mapped, entity));
|
|
227
|
+
} else {
|
|
228
|
+
await entity.command('genOnOff', state, {}, utils.getOptions(meta.mapped, entity));
|
|
229
|
+
if (state === 'toggle') {
|
|
230
|
+
const currentState = meta.state[`state${meta.endpoint_name ? `_${meta.endpoint_name}` : ''}`];
|
|
231
|
+
return currentState ? {state: {state: currentState === 'OFF' ? 'ON' : 'OFF'}} : {};
|
|
232
|
+
} else {
|
|
233
|
+
return {state: {state: state.toUpperCase()}};
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
convertGet: async (entity, key, meta) => {
|
|
238
|
+
await entity.read('genOnOff', ['onOff']);
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
module.exports = [
|
|
244
|
+
{
|
|
245
|
+
zigbeeModel: ['PECLS01'],
|
|
246
|
+
model: 'PECLS01',
|
|
247
|
+
vendor: 'Perenio',
|
|
248
|
+
description: 'Flood alarm device',
|
|
249
|
+
fromZigbee: [fz.ias_water_leak_alarm_1, fz.ignore_basic_report, fz.battery],
|
|
250
|
+
toZigbee: [],
|
|
251
|
+
configure: async (device, coordinatorEndpoint, logger) => {
|
|
252
|
+
const endpoint = device.getEndpoint(1);
|
|
253
|
+
await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']);
|
|
254
|
+
await reporting.batteryPercentageRemaining(endpoint);
|
|
255
|
+
},
|
|
256
|
+
exposes: [e.water_leak(), e.battery_low(), e.tamper(), e.battery()],
|
|
257
|
+
ota: ota.zigbeeOTA,
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
zigbeeModel: ['ZHA-DoorLockSensor'],
|
|
261
|
+
model: 'PECWS01',
|
|
262
|
+
vendor: 'Perenio',
|
|
263
|
+
description: 'Door sensor',
|
|
264
|
+
fromZigbee: [fz.ias_contact_alarm_1, fz.battery, fz.ignore_basic_report, fz.ias_contact_alarm_1_report],
|
|
265
|
+
toZigbee: [],
|
|
266
|
+
exposes: [e.contact(), e.battery(), e.battery_voltage()],
|
|
267
|
+
configure: async (device, coordinatorEndpoint, logger) => {
|
|
268
|
+
const endpoint = device.getEndpoint(1);
|
|
269
|
+
await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']);
|
|
270
|
+
await reporting.batteryPercentageRemaining(endpoint);
|
|
271
|
+
await reporting.batteryVoltage(endpoint);
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
fingerprint: [{modelID: 'ZHA-PirSensor', manufacturerName: 'LDS'}],
|
|
276
|
+
model: 'PECMS01',
|
|
277
|
+
vendor: 'Perenio',
|
|
278
|
+
description: 'Motion sensor',
|
|
279
|
+
fromZigbee: [fz.battery, fz.ias_occupancy_alarm_1],
|
|
280
|
+
toZigbee: [],
|
|
281
|
+
exposes: [e.occupancy(), e.battery_low(), e.tamper(), e.battery()],
|
|
282
|
+
configure: async (device, coordinatorEndpoint, logger) => {
|
|
283
|
+
const endpoint = device.getEndpoint(1);
|
|
284
|
+
await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']);
|
|
285
|
+
await reporting.batteryPercentageRemaining(endpoint);
|
|
286
|
+
},
|
|
287
|
+
ota: ota.zigbeeOTA,
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
zigbeeModel: ['PEHWE20', 'PEHWE2X'],
|
|
291
|
+
model: 'PEHWE20',
|
|
292
|
+
vendor: 'Perenio',
|
|
293
|
+
description: 'Two channel single wire mini-relay',
|
|
294
|
+
fromZigbee: [fz.on_off, fz.power_on_behavior, fzPerenio.diagnostic, fzPerenio.switch_type],
|
|
295
|
+
toZigbee: [tz.on_off, tz.power_on_behavior, tzPerenio.switch_type],
|
|
296
|
+
endpoint: (device) => {
|
|
297
|
+
return {l1: 1, l2: 2};
|
|
298
|
+
},
|
|
299
|
+
meta: {multiEndpoint: true},
|
|
300
|
+
configure: async (device, coordinatorEndpoint, logger) => {
|
|
301
|
+
const endpoint1 = device.getEndpoint(1);
|
|
302
|
+
const endpoint2 = device.getEndpoint(2);
|
|
303
|
+
const endpoint10 = device.getEndpoint(10);
|
|
304
|
+
await reporting.bind(endpoint1, coordinatorEndpoint, ['genOnOff']);
|
|
305
|
+
await reporting.bind(endpoint2, coordinatorEndpoint, ['genOnOff']);
|
|
306
|
+
await reporting.bind(endpoint10, coordinatorEndpoint, ['haDiagnostic']);
|
|
307
|
+
const payload = [{
|
|
308
|
+
attribute: 'onOff',
|
|
309
|
+
minimumReportInterval: 0,
|
|
310
|
+
maximumReportInterval: 3600,
|
|
311
|
+
reportableChange: 0,
|
|
312
|
+
}];
|
|
313
|
+
const payloadDiagnostic = [{
|
|
314
|
+
attribute: 'lastMessageLqi',
|
|
315
|
+
minimumReportInterval: 5,
|
|
316
|
+
maximumReportInterval: 60,
|
|
317
|
+
reportableChange: 0,
|
|
318
|
+
}, {
|
|
319
|
+
attribute: 'lastMessageRssi',
|
|
320
|
+
minimumReportInterval: 5,
|
|
321
|
+
maximumReportInterval: 60,
|
|
322
|
+
reportableChange: 0,
|
|
323
|
+
}];
|
|
324
|
+
await endpoint1.configureReporting('genOnOff', payload);
|
|
325
|
+
await endpoint2.configureReporting('genOnOff', payload);
|
|
326
|
+
await endpoint10.configureReporting('haDiagnostic', payloadDiagnostic);
|
|
327
|
+
await endpoint1.read('genOnOff', ['onOff', 'startUpOnOff']);
|
|
328
|
+
await endpoint2.read('genOnOff', ['onOff', 'startUpOnOff']);
|
|
329
|
+
await endpoint1.read('genMultistateValue', ['presentValue']);
|
|
330
|
+
await endpoint2.read('genMultistateValue', ['presentValue']);
|
|
331
|
+
await endpoint10.read('haDiagnostic', ['lastMessageLqi', 'lastMessageRssi']);
|
|
332
|
+
},
|
|
333
|
+
exposes: [
|
|
334
|
+
e.switch().withEndpoint('l1'),
|
|
335
|
+
e.power_on_behavior().withEndpoint('l1'),
|
|
336
|
+
exposes.enum('switch_type', ea.ALL, switchTypeValues).withEndpoint('l1'),
|
|
337
|
+
e.switch().withEndpoint('l2'),
|
|
338
|
+
e.power_on_behavior().withEndpoint('l2'),
|
|
339
|
+
exposes.enum('switch_type', ea.ALL, switchTypeValues).withEndpoint('l2'),
|
|
340
|
+
exposes.numeric('last_message_lqi', ea.STATE).withUnit('lqi')
|
|
341
|
+
.withDescription('LQI seen by the device').withValueMin(0).withValueMax(255),
|
|
342
|
+
exposes.numeric('last_message_rssi', ea.STATE).withUnit('dB')
|
|
343
|
+
.withDescription('RSSI seen by the device').withValueMin(-128).withValueMax(127),
|
|
344
|
+
],
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
zigbeeModel: ['PEHPL0X'],
|
|
348
|
+
model: 'PEHPL0X',
|
|
349
|
+
vendor: 'Perenio',
|
|
350
|
+
description: 'Power link',
|
|
351
|
+
fromZigbee: [fz.on_off, fzPerenio.smart_plug, fz.metering],
|
|
352
|
+
toZigbee: [tzPerenio.on_off_mod, tzPerenio.default_state, tzPerenio.alarms_reset, tzPerenio.alarms_limits],
|
|
353
|
+
configure: async (device, coordinatorEndpoint, logger) => {
|
|
354
|
+
const endpoint = device.getEndpoint(1);
|
|
355
|
+
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 64635]);
|
|
356
|
+
const payload = [{
|
|
357
|
+
attribute: 'onOff',
|
|
358
|
+
minimumReportInterval: 1,
|
|
359
|
+
maximumReportInterval: 3600,
|
|
360
|
+
reportableChange: 0,
|
|
361
|
+
}];
|
|
362
|
+
await endpoint.configureReporting('genOnOff', payload);
|
|
363
|
+
await endpoint.configureReporting(64635, [{
|
|
364
|
+
attribute: {ID: 0x000a, type: 0x21},
|
|
365
|
+
minimumReportInterval: 5,
|
|
366
|
+
maximumReportInterval: 60,
|
|
367
|
+
reportableChange: 0,
|
|
368
|
+
}]);
|
|
369
|
+
await endpoint.configureReporting(64635, [{
|
|
370
|
+
attribute: {ID: 0x000e, type: 0x23},
|
|
371
|
+
minimumReportInterval: 5,
|
|
372
|
+
maximumReportInterval: 60,
|
|
373
|
+
reportableChange: 0,
|
|
374
|
+
}]);
|
|
375
|
+
await endpoint.configureReporting(64635, [{
|
|
376
|
+
attribute: {ID: 0x0003, type: 0x21},
|
|
377
|
+
minimumReportInterval: 5,
|
|
378
|
+
maximumReportInterval: 5,
|
|
379
|
+
reportableChange: 0,
|
|
380
|
+
}]);
|
|
381
|
+
await endpoint.read(64635, [0, 1, 2, 3]);
|
|
382
|
+
await endpoint.read(64635, [4, 5, 11, 15]);
|
|
383
|
+
},
|
|
384
|
+
exposes: [
|
|
385
|
+
e.switch(),
|
|
386
|
+
exposes.enum('default_on_off_state', ea.ALL, defaultOnOffStateValues),
|
|
387
|
+
exposes.numeric('rms_voltage', ea.STATE).withUnit('V').withDescription('RMS voltage'),
|
|
388
|
+
exposes.numeric('active_power', ea.STATE).withUnit('W').withDescription('Active power'),
|
|
389
|
+
exposes.numeric('consumed_energy', ea.STATE).withUnit('W*h').withDescription('Consumed energy'),
|
|
390
|
+
exposes.binary('alarm_voltage_min', ea.ALL, true, false)
|
|
391
|
+
.withDescription('Indicates if the alarm is triggered on the voltage drop below the limit, allows to reset alarms'),
|
|
392
|
+
exposes.binary('alarm_voltage_max', ea.ALL, true, false)
|
|
393
|
+
.withDescription('Indicates if the alarm is triggered on the voltage rise above the limit, allows to reset alarms'),
|
|
394
|
+
exposes.binary('alarm_power_max', ea.ALL, true, false)
|
|
395
|
+
.withDescription('Indicates if the alarm is triggered on the active power rise above the limit, allows to reset alarms'),
|
|
396
|
+
exposes.binary('alarm_consumed_energy', ea.ALL, true, false)
|
|
397
|
+
.withDescription(
|
|
398
|
+
'Indicates if the alarm is triggered when the consumption energy limit is reached, allows to reset alarms'),
|
|
399
|
+
exposes.numeric('voltage_min', ea.ALL).withValueMin(0).withValueMax(253)
|
|
400
|
+
.withDescription('Minimum allowable voltage limit for alarms.'),
|
|
401
|
+
exposes.numeric('voltage_max', ea.ALL).withValueMin(0).withValueMax(253)
|
|
402
|
+
.withDescription('Maximum allowable voltage limit for alarms.'),
|
|
403
|
+
exposes.numeric('power_max', ea.ALL).withValueMin(0).withValueMax(65534)
|
|
404
|
+
.withDescription('Maximum allowable power limit for alarms.'),
|
|
405
|
+
exposes.numeric('consumed_energy_limit', ea.ALL).withValueMin(0).withValueMax(65534)
|
|
406
|
+
.withDescription('Limit of electric energy consumption in kW*h. 0 value represents no limit'),
|
|
407
|
+
exposes.numeric('rssi', ea.STATE).withUnit('dB')
|
|
408
|
+
.withDescription('RSSI seen by the device').withValueMin(-128).withValueMax(127),
|
|
409
|
+
],
|
|
410
|
+
ota: ota.zigbeeOTA,
|
|
411
|
+
},
|
|
412
|
+
];
|
|
413
|
+
|