zigbee-herdsman-converters 17.1.1 → 18.0.0
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/CHANGELOG.md +19 -0
- package/README.md +3 -0
- package/converters/fromZigbee.d.ts +4 -22
- package/converters/fromZigbee.d.ts.map +1 -1
- package/converters/fromZigbee.js +22 -65
- package/converters/fromZigbee.js.map +1 -1
- package/devices/bosch.d.ts.map +1 -1
- package/devices/bosch.js +3 -6
- package/devices/bosch.js.map +1 -1
- package/devices/custom_devices_diy.d.ts.map +1 -1
- package/devices/custom_devices_diy.js +4 -10
- package/devices/custom_devices_diy.js.map +1 -1
- package/devices/develco.d.ts.map +1 -1
- package/devices/develco.js +1 -2
- package/devices/develco.js.map +1 -1
- package/devices/ikea.d.ts.map +1 -1
- package/devices/ikea.js +1 -3
- package/devices/ikea.js.map +1 -1
- package/devices/sonoff.d.ts.map +1 -1
- package/devices/sonoff.js +2 -1
- package/devices/sonoff.js.map +1 -1
- package/devices/sprut.d.ts.map +1 -1
- package/devices/sprut.js +1 -3
- package/devices/sprut.js.map +1 -1
- package/devices/tuya.d.ts.map +1 -1
- package/devices/tuya.js +5 -5
- package/devices/tuya.js.map +1 -1
- package/devices/woolley.d.ts.map +1 -1
- package/devices/woolley.js +1 -6
- package/devices/woolley.js.map +1 -1
- package/devices/xiaomi.d.ts.map +1 -1
- package/devices/xiaomi.js +1 -0
- package/devices/xiaomi.js.map +1 -1
- package/index.d.ts +2 -1
- package/index.d.ts.map +1 -1
- package/index.js +28 -1
- package/index.js.map +1 -1
- package/lib/legacy.d.ts +9 -18
- package/lib/legacy.d.ts.map +1 -1
- package/lib/legacy.js +30 -58
- package/lib/legacy.js.map +1 -1
- package/lib/tuya.d.ts +0 -1
- package/lib/tuya.d.ts.map +1 -1
- package/lib/tuya.js +1 -34
- package/lib/tuya.js.map +1 -1
- package/lib/utils.d.ts +2 -0
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +7 -2
- package/lib/utils.js.map +1 -1
- package/lib/xiaomi.d.ts +0 -5
- package/lib/xiaomi.d.ts.map +1 -1
- package/lib/xiaomi.js +14 -39
- package/lib/xiaomi.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [18.0.0](https://github.com/Koenkk/zigbee-herdsman-converters/compare/v17.1.1...v18.0.0) (2023-12-26)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* Improve consistency of calibrate and precision round options ([#6769](https://github.com/Koenkk/zigbee-herdsman-converters/issues/6769))
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* Improve consistency of calibrate and precision round options ([#6769](https://github.com/Koenkk/zigbee-herdsman-converters/issues/6769)) ([204ee90](https://github.com/Koenkk/zigbee-herdsman-converters/commit/204ee901a06953d43762f75b9973c0ab4c9cdc0d))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* Fix power source/type for Xiaomi QBKG20LM https://github.com/Koenkk/zigbee2mqtt/issues/20384 ([340228b](https://github.com/Koenkk/zigbee-herdsman-converters/commit/340228b79c44bbac22475bea298ef86039968395))
|
|
18
|
+
* Fix set upper/bottom limit expose for TuYa TS0601_cover_4 https://github.com/Koenkk/zigbee2mqtt/issues/19690 ([bb4a44f](https://github.com/Koenkk/zigbee-herdsman-converters/commit/bb4a44f46181cb561661e0de206edb3463571e7c))
|
|
19
|
+
* **ignore:** Fix configure for SONOFF BASICZBR3 failing ([4e5f3ec](https://github.com/Koenkk/zigbee-herdsman-converters/commit/4e5f3ec6a016d67fcc637f772bbfde7e488253e1))
|
|
20
|
+
* Support OTA for TuYa TS110E_1gang_2 [@mrmaximas](https://github.com/mrmaximas) https://github.com/Koenkk/zigbee2mqtt/issues/18702 ([0ad15d9](https://github.com/Koenkk/zigbee-herdsman-converters/commit/0ad15d9f58a7d75e9611b9531401243dcc052f9d))
|
|
21
|
+
|
|
3
22
|
## [17.1.1](https://github.com/Koenkk/zigbee-herdsman-converters/compare/v17.1.0...v17.1.1) (2023-12-26)
|
|
4
23
|
|
|
5
24
|
|
package/README.md
CHANGED
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
Collection of device converters to be used with zigbee-herdsman.
|
|
5
5
|
|
|
6
6
|
## Breaking changes
|
|
7
|
+
18.0.0
|
|
8
|
+
- After converting a message with a fromZigbee converter, `postProcessConvertedFromZigbeeMessage` should be called now (for applying calibration/precision)
|
|
9
|
+
|
|
7
10
|
17.0.0
|
|
8
11
|
- Various methods in `index.ts` are now async and return a `Promise`
|
|
9
12
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fz, KeyValueAny
|
|
1
|
+
import { Fz, KeyValueAny } from '../lib/types';
|
|
2
2
|
import * as exposes from '../lib/exposes';
|
|
3
3
|
declare const converters: {
|
|
4
4
|
command_arm_with_transaction: {
|
|
@@ -73,7 +73,6 @@ declare const converters: {
|
|
|
73
73
|
RTCGQ11LM_illuminance: {
|
|
74
74
|
cluster: string;
|
|
75
75
|
type: string[];
|
|
76
|
-
options: exposes.Numeric[];
|
|
77
76
|
convert: (model: import("../lib/types").Definition, msg: Fz.Message, publish: import("../lib/types").Publish, options: import("../lib/types").KeyValue, meta: Fz.Meta) => Promise<KeyValueAny>;
|
|
78
77
|
};
|
|
79
78
|
terncy_raw: {
|
|
@@ -186,7 +185,6 @@ declare const converters: {
|
|
|
186
185
|
temperature: {
|
|
187
186
|
cluster: string;
|
|
188
187
|
type: string[];
|
|
189
|
-
options: exposes.Numeric[];
|
|
190
188
|
convert: (model: import("../lib/types").Definition, msg: Fz.Message, publish: import("../lib/types").Publish, options: import("../lib/types").KeyValue, meta: Fz.Meta) => {
|
|
191
189
|
[x: string]: number;
|
|
192
190
|
};
|
|
@@ -194,7 +192,6 @@ declare const converters: {
|
|
|
194
192
|
device_temperature: {
|
|
195
193
|
cluster: string;
|
|
196
194
|
type: string[];
|
|
197
|
-
options: exposes.Numeric[];
|
|
198
195
|
convert: (model: import("../lib/types").Definition, msg: Fz.Message, publish: import("../lib/types").Publish, options: import("../lib/types").KeyValue, meta: Fz.Meta) => {
|
|
199
196
|
device_temperature: number;
|
|
200
197
|
};
|
|
@@ -202,7 +199,6 @@ declare const converters: {
|
|
|
202
199
|
humidity: {
|
|
203
200
|
cluster: string;
|
|
204
201
|
type: string[];
|
|
205
|
-
options: exposes.Numeric[];
|
|
206
202
|
convert: (model: import("../lib/types").Definition, msg: Fz.Message, publish: import("../lib/types").Publish, options: import("../lib/types").KeyValue, meta: Fz.Meta) => {
|
|
207
203
|
[x: string]: number;
|
|
208
204
|
};
|
|
@@ -217,7 +213,6 @@ declare const converters: {
|
|
|
217
213
|
soil_moisture: {
|
|
218
214
|
cluster: string;
|
|
219
215
|
type: string[];
|
|
220
|
-
options: exposes.Numeric[];
|
|
221
216
|
convert: (model: import("../lib/types").Definition, msg: Fz.Message, publish: import("../lib/types").Publish, options: import("../lib/types").KeyValue, meta: Fz.Meta) => {
|
|
222
217
|
soil_moisture: number;
|
|
223
218
|
};
|
|
@@ -225,16 +220,14 @@ declare const converters: {
|
|
|
225
220
|
illuminance: {
|
|
226
221
|
cluster: string;
|
|
227
222
|
type: string[];
|
|
228
|
-
options: exposes.Numeric[];
|
|
229
223
|
convert: (model: import("../lib/types").Definition, msg: Fz.Message, publish: import("../lib/types").Publish, options: import("../lib/types").KeyValue, meta: Fz.Meta) => {
|
|
230
|
-
illuminance:
|
|
224
|
+
illuminance: any;
|
|
231
225
|
illuminance_lux: number;
|
|
232
226
|
};
|
|
233
227
|
};
|
|
234
228
|
pressure: {
|
|
235
229
|
cluster: string;
|
|
236
230
|
type: string[];
|
|
237
|
-
options: exposes.Numeric[];
|
|
238
231
|
convert: (model: import("../lib/types").Definition, msg: Fz.Message, publish: import("../lib/types").Publish, options: import("../lib/types").KeyValue, meta: Fz.Meta) => {
|
|
239
232
|
pressure: number;
|
|
240
233
|
};
|
|
@@ -299,7 +292,6 @@ declare const converters: {
|
|
|
299
292
|
*/
|
|
300
293
|
cluster: string;
|
|
301
294
|
type: string[];
|
|
302
|
-
options: (definition: import("../lib/types").Definition) => Option[];
|
|
303
295
|
convert: (model: import("../lib/types").Definition, msg: Fz.Message, publish: import("../lib/types").Publish, options: import("../lib/types").KeyValue, meta: Fz.Meta) => KeyValueAny;
|
|
304
296
|
};
|
|
305
297
|
electrical_measurement: {
|
|
@@ -309,7 +301,6 @@ declare const converters: {
|
|
|
309
301
|
*/
|
|
310
302
|
cluster: string;
|
|
311
303
|
type: string[];
|
|
312
|
-
options: exposes.Numeric[];
|
|
313
304
|
convert: (model: import("../lib/types").Definition, msg: Fz.Message, publish: import("../lib/types").Publish, options: import("../lib/types").KeyValue, meta: Fz.Meta) => KeyValueAny;
|
|
314
305
|
};
|
|
315
306
|
on_off: {
|
|
@@ -948,7 +939,6 @@ declare const converters: {
|
|
|
948
939
|
terncy_temperature: {
|
|
949
940
|
cluster: string;
|
|
950
941
|
type: string[];
|
|
951
|
-
options: exposes.Numeric[];
|
|
952
942
|
convert: (model: import("../lib/types").Definition, msg: Fz.Message, publish: import("../lib/types").Publish, options: import("../lib/types").KeyValue, meta: Fz.Meta) => {
|
|
953
943
|
temperature: number;
|
|
954
944
|
};
|
|
@@ -1300,7 +1290,6 @@ declare const converters: {
|
|
|
1300
1290
|
lifecontrolVoc: {
|
|
1301
1291
|
cluster: string;
|
|
1302
1292
|
type: string[];
|
|
1303
|
-
options: exposes.Numeric[];
|
|
1304
1293
|
convert: (model: import("../lib/types").Definition, msg: Fz.Message, publish: import("../lib/types").Publish, options: import("../lib/types").KeyValue, meta: Fz.Meta) => {
|
|
1305
1294
|
temperature: number;
|
|
1306
1295
|
humidity: number;
|
|
@@ -1346,7 +1335,6 @@ declare const converters: {
|
|
|
1346
1335
|
_3310_humidity: {
|
|
1347
1336
|
cluster: string;
|
|
1348
1337
|
type: string[];
|
|
1349
|
-
options: exposes.Numeric[];
|
|
1350
1338
|
convert: (model: import("../lib/types").Definition, msg: Fz.Message, publish: import("../lib/types").Publish, options: import("../lib/types").KeyValue, meta: Fz.Meta) => {
|
|
1351
1339
|
humidity: number;
|
|
1352
1340
|
};
|
|
@@ -1451,9 +1439,8 @@ declare const converters: {
|
|
|
1451
1439
|
xiaomi_power: {
|
|
1452
1440
|
cluster: string;
|
|
1453
1441
|
type: string[];
|
|
1454
|
-
options: exposes.Numeric[];
|
|
1455
1442
|
convert: (model: import("../lib/types").Definition, msg: Fz.Message, publish: import("../lib/types").Publish, options: import("../lib/types").KeyValue, meta: Fz.Meta) => {
|
|
1456
|
-
power:
|
|
1443
|
+
power: any;
|
|
1457
1444
|
};
|
|
1458
1445
|
};
|
|
1459
1446
|
xiaomi_on_off_action: {
|
|
@@ -1510,7 +1497,6 @@ declare const converters: {
|
|
|
1510
1497
|
};
|
|
1511
1498
|
xiaomi_temperature: {
|
|
1512
1499
|
cluster: string;
|
|
1513
|
-
options: exposes.Numeric[];
|
|
1514
1500
|
type: string[];
|
|
1515
1501
|
convert: (model: import("../lib/types").Definition, msg: Fz.Message, publish: import("../lib/types").Publish, options: import("../lib/types").KeyValue, meta: Fz.Meta) => {
|
|
1516
1502
|
temperature: number;
|
|
@@ -1663,9 +1649,8 @@ declare const converters: {
|
|
|
1663
1649
|
keen_home_smart_vent_pressure: {
|
|
1664
1650
|
cluster: string;
|
|
1665
1651
|
type: string[];
|
|
1666
|
-
options: exposes.Numeric[];
|
|
1667
1652
|
convert: (model: import("../lib/types").Definition, msg: Fz.Message, publish: import("../lib/types").Publish, options: import("../lib/types").KeyValue, meta: Fz.Meta) => {
|
|
1668
|
-
pressure:
|
|
1653
|
+
pressure: any;
|
|
1669
1654
|
};
|
|
1670
1655
|
};
|
|
1671
1656
|
U02I007C01_contact: {
|
|
@@ -2063,7 +2048,6 @@ declare const converters: {
|
|
|
2063
2048
|
schneider_temperature: {
|
|
2064
2049
|
cluster: string;
|
|
2065
2050
|
type: string[];
|
|
2066
|
-
options: exposes.Numeric[];
|
|
2067
2051
|
convert: (model: import("../lib/types").Definition, msg: Fz.Message, publish: import("../lib/types").Publish, options: import("../lib/types").KeyValue, meta: Fz.Meta) => {
|
|
2068
2052
|
[x: string]: number;
|
|
2069
2053
|
};
|
|
@@ -2174,7 +2158,6 @@ declare const converters: {
|
|
|
2174
2158
|
SNZB02_temperature: {
|
|
2175
2159
|
cluster: string;
|
|
2176
2160
|
type: string[];
|
|
2177
|
-
options: exposes.Numeric[];
|
|
2178
2161
|
convert: (model: import("../lib/types").Definition, msg: Fz.Message, publish: import("../lib/types").Publish, options: import("../lib/types").KeyValue, meta: Fz.Meta) => {
|
|
2179
2162
|
[x: string]: number;
|
|
2180
2163
|
};
|
|
@@ -2182,7 +2165,6 @@ declare const converters: {
|
|
|
2182
2165
|
SNZB02_humidity: {
|
|
2183
2166
|
cluster: string;
|
|
2184
2167
|
type: string[];
|
|
2185
|
-
options: exposes.Numeric[];
|
|
2186
2168
|
convert: (model: import("../lib/types").Definition, msg: Fz.Message, publish: import("../lib/types").Publish, options: import("../lib/types").KeyValue, meta: Fz.Meta) => {
|
|
2187
2169
|
humidity: number;
|
|
2188
2170
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fromZigbee.d.ts","sourceRoot":"","sources":["../src/converters/fromZigbee.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fromZigbee.d.ts","sourceRoot":"","sources":["../src/converters/fromZigbee.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,EAAE,EAAE,WAAW,EAAuB,MAAM,cAAc,CAAC;AAKnE,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAwoM1C,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;QA/UR;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAu4BpB,CAAC;AAEpD,eAAe,UAAU,CAAC"}
|
package/converters/fromZigbee.js
CHANGED
|
@@ -395,30 +395,27 @@ const converters1 = {
|
|
|
395
395
|
temperature: {
|
|
396
396
|
cluster: 'msTemperatureMeasurement',
|
|
397
397
|
type: ['attributeReport', 'readResponse'],
|
|
398
|
-
options: [exposes.options.precision('temperature'), exposes.options.calibration('temperature')],
|
|
399
398
|
convert: (model, msg, publish, options, meta) => {
|
|
400
399
|
if (msg.data.hasOwnProperty('measuredValue')) {
|
|
401
400
|
const temperature = parseFloat(msg.data['measuredValue']) / 100.0;
|
|
402
401
|
const property = (0, utils_1.postfixWithEndpointName)('temperature', msg, model, meta);
|
|
403
|
-
return { [property]:
|
|
402
|
+
return { [property]: temperature };
|
|
404
403
|
}
|
|
405
404
|
},
|
|
406
405
|
},
|
|
407
406
|
device_temperature: {
|
|
408
407
|
cluster: 'genDeviceTempCfg',
|
|
409
408
|
type: ['attributeReport', 'readResponse'],
|
|
410
|
-
options: [exposes.options.calibration('device_temperature')],
|
|
411
409
|
convert: (model, msg, publish, options, meta) => {
|
|
412
410
|
if (msg.data.hasOwnProperty('currentTemperature')) {
|
|
413
411
|
const value = parseInt(msg.data['currentTemperature']);
|
|
414
|
-
return { device_temperature:
|
|
412
|
+
return { device_temperature: value };
|
|
415
413
|
}
|
|
416
414
|
},
|
|
417
415
|
},
|
|
418
416
|
humidity: {
|
|
419
417
|
cluster: 'msRelativeHumidity',
|
|
420
418
|
type: ['attributeReport', 'readResponse'],
|
|
421
|
-
options: [exposes.options.precision('humidity'), exposes.options.calibration('humidity')],
|
|
422
419
|
convert: (model, msg, publish, options, meta) => {
|
|
423
420
|
const humidity = parseFloat(msg.data['measuredValue']) / 100.0;
|
|
424
421
|
const property = (0, utils_1.postfixWithEndpointName)('humidity', msg, model, meta);
|
|
@@ -426,7 +423,7 @@ const converters1 = {
|
|
|
426
423
|
// Sometimes the sensor publishes non-realistic vales, it should only publish message
|
|
427
424
|
// in the 0 - 100 range, don't produce messages beyond these values.
|
|
428
425
|
if (humidity >= 0 && humidity <= 100) {
|
|
429
|
-
return { [property]:
|
|
426
|
+
return { [property]: humidity };
|
|
430
427
|
}
|
|
431
428
|
},
|
|
432
429
|
},
|
|
@@ -442,30 +439,24 @@ const converters1 = {
|
|
|
442
439
|
soil_moisture: {
|
|
443
440
|
cluster: 'msSoilMoisture',
|
|
444
441
|
type: ['attributeReport', 'readResponse'],
|
|
445
|
-
options: [exposes.options.precision('soil_moisture'), exposes.options.calibration('soil_moisture')],
|
|
446
442
|
convert: (model, msg, publish, options, meta) => {
|
|
447
443
|
const soilMoisture = parseFloat(msg.data['measuredValue']) / 100.0;
|
|
448
|
-
return { soil_moisture:
|
|
444
|
+
return { soil_moisture: soilMoisture };
|
|
449
445
|
},
|
|
450
446
|
},
|
|
451
447
|
illuminance: {
|
|
452
448
|
cluster: 'msIlluminanceMeasurement',
|
|
453
449
|
type: ['attributeReport', 'readResponse'],
|
|
454
|
-
options: [exposes.options.calibration('illuminance', 'percentual'), exposes.options.calibration('illuminance_lux', 'percentual')],
|
|
455
450
|
convert: (model, msg, publish, options, meta) => {
|
|
456
451
|
// DEPRECATED: only return lux here (change illuminance_lux -> illuminance)
|
|
457
452
|
const illuminance = msg.data['measuredValue'];
|
|
458
453
|
const illuminanceLux = illuminance === 0 ? 0 : Math.pow(10, (illuminance - 1) / 10000);
|
|
459
|
-
return {
|
|
460
|
-
illuminance: (0, utils_1.calibrateAndPrecisionRoundOptions)(illuminance, options, 'illuminance'),
|
|
461
|
-
illuminance_lux: (0, utils_1.calibrateAndPrecisionRoundOptions)(illuminanceLux, options, 'illuminance_lux'),
|
|
462
|
-
};
|
|
454
|
+
return { illuminance: illuminance, illuminance_lux: illuminanceLux };
|
|
463
455
|
},
|
|
464
456
|
},
|
|
465
457
|
pressure: {
|
|
466
458
|
cluster: 'msPressureMeasurement',
|
|
467
459
|
type: ['attributeReport', 'readResponse'],
|
|
468
|
-
options: [exposes.options.precision('pressure'), exposes.options.calibration('pressure')],
|
|
469
460
|
convert: (model, msg, publish, options, meta) => {
|
|
470
461
|
let pressure = 0;
|
|
471
462
|
if (msg.data.hasOwnProperty('scaledValue')) {
|
|
@@ -475,7 +466,7 @@ const converters1 = {
|
|
|
475
466
|
else {
|
|
476
467
|
pressure = parseFloat(msg.data['measuredValue']);
|
|
477
468
|
}
|
|
478
|
-
return { pressure
|
|
469
|
+
return { pressure };
|
|
479
470
|
},
|
|
480
471
|
},
|
|
481
472
|
co2: {
|
|
@@ -682,19 +673,6 @@ const converters1 = {
|
|
|
682
673
|
*/
|
|
683
674
|
cluster: 'seMetering',
|
|
684
675
|
type: ['attributeReport', 'readResponse'],
|
|
685
|
-
// FIXME: Why are we expecting errors here? Sounds like a codesmell
|
|
686
|
-
options: (definition) => {
|
|
687
|
-
const result = [];
|
|
688
|
-
// @ts-expect-error
|
|
689
|
-
if (definition.exposes.find((e) => e.name === 'power')) {
|
|
690
|
-
result.push(exposes.options.precision('power'), exposes.options.calibration('power', 'percentual'));
|
|
691
|
-
}
|
|
692
|
-
// @ts-expect-error
|
|
693
|
-
if (definition.exposes.find((e) => e.name === 'energy')) {
|
|
694
|
-
result.push(exposes.options.precision('energy'), exposes.options.calibration('energy', 'percentual'));
|
|
695
|
-
}
|
|
696
|
-
return result;
|
|
697
|
-
},
|
|
698
676
|
convert: (model, msg, publish, options, meta) => {
|
|
699
677
|
if (utils.hasAlreadyProcessedMessage(msg, model))
|
|
700
678
|
return;
|
|
@@ -707,7 +685,7 @@ const converters1 = {
|
|
|
707
685
|
if (factor != null) {
|
|
708
686
|
power = (power * factor) * 1000; // kWh to Watt
|
|
709
687
|
}
|
|
710
|
-
payload.power =
|
|
688
|
+
payload.power = power;
|
|
711
689
|
}
|
|
712
690
|
if (factor != null && (msg.data.hasOwnProperty('currentSummDelivered') ||
|
|
713
691
|
msg.data.hasOwnProperty('currentSummReceived'))) {
|
|
@@ -722,7 +700,7 @@ const converters1 = {
|
|
|
722
700
|
const value = (parseInt(data[0]) << 32) + parseInt(data[1]);
|
|
723
701
|
energy -= value * factor;
|
|
724
702
|
}
|
|
725
|
-
payload.energy =
|
|
703
|
+
payload.energy = energy;
|
|
726
704
|
}
|
|
727
705
|
return payload;
|
|
728
706
|
},
|
|
@@ -734,11 +712,6 @@ const converters1 = {
|
|
|
734
712
|
*/
|
|
735
713
|
cluster: 'haElectricalMeasurement',
|
|
736
714
|
type: ['attributeReport', 'readResponse'],
|
|
737
|
-
options: [
|
|
738
|
-
exposes.options.calibration('power', 'percentual'), exposes.options.precision('power'),
|
|
739
|
-
exposes.options.calibration('current', 'percentual'), exposes.options.precision('current'),
|
|
740
|
-
exposes.options.calibration('voltage', 'percentual'), exposes.options.precision('voltage'),
|
|
741
|
-
],
|
|
742
715
|
convert: (model, msg, publish, options, meta) => {
|
|
743
716
|
if (utils.hasAlreadyProcessedMessage(msg, model))
|
|
744
717
|
return;
|
|
@@ -768,7 +741,7 @@ const converters1 = {
|
|
|
768
741
|
const factor = getFactor(entry.factor);
|
|
769
742
|
const property = (0, utils_1.postfixWithEndpointName)(entry.name, msg, model, meta);
|
|
770
743
|
const value = msg.data[entry.key] * factor;
|
|
771
|
-
payload[property] =
|
|
744
|
+
payload[property] = value;
|
|
772
745
|
}
|
|
773
746
|
}
|
|
774
747
|
if (msg.data.hasOwnProperty('powerFactor')) {
|
|
@@ -2114,10 +2087,9 @@ const converters1 = {
|
|
|
2114
2087
|
terncy_temperature: {
|
|
2115
2088
|
cluster: 'msTemperatureMeasurement',
|
|
2116
2089
|
type: ['attributeReport', 'readResponse'],
|
|
2117
|
-
options: [exposes.options.precision('temperature'), exposes.options.calibration('temperature')],
|
|
2118
2090
|
convert: (model, msg, publish, options, meta) => {
|
|
2119
2091
|
const temperature = parseFloat(msg.data['measuredValue']) / 10.0;
|
|
2120
|
-
return { temperature:
|
|
2092
|
+
return { temperature: temperature };
|
|
2121
2093
|
},
|
|
2122
2094
|
},
|
|
2123
2095
|
ts0216_siren: {
|
|
@@ -3443,18 +3415,12 @@ const converters1 = {
|
|
|
3443
3415
|
lifecontrolVoc: {
|
|
3444
3416
|
cluster: 'msTemperatureMeasurement',
|
|
3445
3417
|
type: ['attributeReport', 'readResponse'],
|
|
3446
|
-
options: [exposes.options.precision('temperature'), exposes.options.calibration('temperature'),
|
|
3447
|
-
exposes.options.precision('humidity'), exposes.options.calibration('humidity')],
|
|
3448
3418
|
convert: (model, msg, publish, options, meta) => {
|
|
3449
3419
|
const temperature = parseFloat(msg.data['measuredValue']) / 100.0;
|
|
3450
3420
|
const humidity = parseFloat(msg.data['minMeasuredValue']) / 100.0;
|
|
3451
3421
|
const eco2 = parseFloat(msg.data['maxMeasuredValue']);
|
|
3452
3422
|
const voc = parseFloat(msg.data['tolerance']);
|
|
3453
|
-
return {
|
|
3454
|
-
temperature: (0, utils_1.calibrateAndPrecisionRoundOptions)(temperature, options, 'temperature'),
|
|
3455
|
-
humidity: (0, utils_1.calibrateAndPrecisionRoundOptions)(humidity, options, 'humidity'),
|
|
3456
|
-
eco2, voc,
|
|
3457
|
-
};
|
|
3423
|
+
return { temperature, humidity, eco2, voc };
|
|
3458
3424
|
},
|
|
3459
3425
|
},
|
|
3460
3426
|
_8840100H_water_leak_alarm: {
|
|
@@ -3522,10 +3488,9 @@ const converters1 = {
|
|
|
3522
3488
|
_3310_humidity: {
|
|
3523
3489
|
cluster: 'manuSpecificCentraliteHumidity',
|
|
3524
3490
|
type: ['attributeReport', 'readResponse'],
|
|
3525
|
-
options: [exposes.options.precision('humidity'), exposes.options.calibration('humidity')],
|
|
3526
3491
|
convert: (model, msg, publish, options, meta) => {
|
|
3527
3492
|
const humidity = parseFloat(msg.data['measuredValue']) / 100.0;
|
|
3528
|
-
return { humidity
|
|
3493
|
+
return { humidity };
|
|
3529
3494
|
},
|
|
3530
3495
|
},
|
|
3531
3496
|
smartthings_acceleration: {
|
|
@@ -3716,9 +3681,8 @@ const converters1 = {
|
|
|
3716
3681
|
xiaomi_power: {
|
|
3717
3682
|
cluster: 'genAnalogInput',
|
|
3718
3683
|
type: ['attributeReport', 'readResponse'],
|
|
3719
|
-
options: [exposes.options.calibration('power', 'percentual'), exposes.options.precision('power')],
|
|
3720
3684
|
convert: (model, msg, publish, options, meta) => {
|
|
3721
|
-
return { power:
|
|
3685
|
+
return { power: msg.data['presentValue'] };
|
|
3722
3686
|
},
|
|
3723
3687
|
},
|
|
3724
3688
|
xiaomi_on_off_action: {
|
|
@@ -3796,8 +3760,7 @@ const converters1 = {
|
|
|
3796
3760
|
// Therefore we need to publish the no_motion detected by ourselves.
|
|
3797
3761
|
cluster: 'aqaraOpple',
|
|
3798
3762
|
type: ['attributeReport', 'readResponse'],
|
|
3799
|
-
options: [exposes.options.occupancy_timeout_2(), exposes.options.no_occupancy_since_true(),
|
|
3800
|
-
exposes.options.calibration('illuminance', 'percentual')],
|
|
3763
|
+
options: [exposes.options.occupancy_timeout_2(), exposes.options.no_occupancy_since_true()],
|
|
3801
3764
|
convert: (model, msg, publish, options, meta) => {
|
|
3802
3765
|
if (msg.data.hasOwnProperty('illuminance')) {
|
|
3803
3766
|
// The occupancy sensor only sends a message when motion detected.
|
|
@@ -3817,7 +3780,7 @@ const converters1 = {
|
|
|
3817
3780
|
// Sometimes RTCGQ14LM reports high illuminance values in the dark
|
|
3818
3781
|
// https://github.com/Koenkk/zigbee2mqtt/issues/12596
|
|
3819
3782
|
const illuminance = msg.data['illuminance'] > 130536 ? 0 : msg.data['illuminance'] - 65536;
|
|
3820
|
-
const payload = { occupancy: true, illuminance
|
|
3783
|
+
const payload = { occupancy: true, illuminance };
|
|
3821
3784
|
utils.noOccupancySince(msg.endpoint, options, publish, 'start');
|
|
3822
3785
|
return payload;
|
|
3823
3786
|
}
|
|
@@ -3924,14 +3887,13 @@ const converters1 = {
|
|
|
3924
3887
|
},
|
|
3925
3888
|
xiaomi_temperature: {
|
|
3926
3889
|
cluster: 'msTemperatureMeasurement',
|
|
3927
|
-
options: [exposes.options.precision('temperature'), exposes.options.calibration('temperature')],
|
|
3928
3890
|
type: ['attributeReport', 'readResponse'],
|
|
3929
3891
|
convert: (model, msg, publish, options, meta) => {
|
|
3930
3892
|
const temperature = parseFloat(msg.data['measuredValue']) / 100.0;
|
|
3931
3893
|
// https://github.com/Koenkk/zigbee2mqtt/issues/798
|
|
3932
3894
|
// Sometimes the sensor publishes non-realistic vales.
|
|
3933
3895
|
if (temperature > -65 && temperature < 65) {
|
|
3934
|
-
return { temperature
|
|
3896
|
+
return { temperature };
|
|
3935
3897
|
}
|
|
3936
3898
|
},
|
|
3937
3899
|
},
|
|
@@ -4249,10 +4211,9 @@ const converters1 = {
|
|
|
4249
4211
|
keen_home_smart_vent_pressure: {
|
|
4250
4212
|
cluster: 'msPressureMeasurement',
|
|
4251
4213
|
type: ['attributeReport', 'readResponse'],
|
|
4252
|
-
options: [exposes.options.precision('pressure'), exposes.options.calibration('pressure')],
|
|
4253
4214
|
convert: (model, msg, publish, options, meta) => {
|
|
4254
4215
|
const pressure = msg.data.hasOwnProperty('measuredValue') ? msg.data.measuredValue : parseFloat(msg.data['32']) / 1000.0;
|
|
4255
|
-
return { pressure
|
|
4216
|
+
return { pressure };
|
|
4256
4217
|
},
|
|
4257
4218
|
},
|
|
4258
4219
|
U02I007C01_contact: {
|
|
@@ -5355,11 +5316,10 @@ const converters1 = {
|
|
|
5355
5316
|
schneider_temperature: {
|
|
5356
5317
|
cluster: 'msTemperatureMeasurement',
|
|
5357
5318
|
type: ['attributeReport', 'readResponse'],
|
|
5358
|
-
options: [exposes.options.precision('temperature'), exposes.options.calibration('temperature')],
|
|
5359
5319
|
convert: (model, msg, publish, options, meta) => {
|
|
5360
5320
|
const temperature = parseFloat(msg.data['measuredValue']) / 100.0;
|
|
5361
5321
|
const property = (0, utils_1.postfixWithEndpointName)('local_temperature', msg, model, meta);
|
|
5362
|
-
return { [property]:
|
|
5322
|
+
return { [property]: temperature };
|
|
5363
5323
|
},
|
|
5364
5324
|
},
|
|
5365
5325
|
wiser_smart_thermostat_client: {
|
|
@@ -5668,27 +5628,25 @@ const converters1 = {
|
|
|
5668
5628
|
SNZB02_temperature: {
|
|
5669
5629
|
cluster: 'msTemperatureMeasurement',
|
|
5670
5630
|
type: ['attributeReport', 'readResponse'],
|
|
5671
|
-
options: [exposes.options.precision('temperature'), exposes.options.calibration('temperature')],
|
|
5672
5631
|
convert: (model, msg, publish, options, meta) => {
|
|
5673
5632
|
const temperature = parseFloat(msg.data['measuredValue']) / 100.0;
|
|
5674
5633
|
// https://github.com/Koenkk/zigbee2mqtt/issues/13640
|
|
5675
5634
|
// SNZB-02 reports stranges values sometimes
|
|
5676
5635
|
if (temperature > -33 && temperature < 100) {
|
|
5677
5636
|
const property = (0, utils_1.postfixWithEndpointName)('temperature', msg, model, meta);
|
|
5678
|
-
return { [property]:
|
|
5637
|
+
return { [property]: temperature };
|
|
5679
5638
|
}
|
|
5680
5639
|
},
|
|
5681
5640
|
},
|
|
5682
5641
|
SNZB02_humidity: {
|
|
5683
5642
|
cluster: 'msRelativeHumidity',
|
|
5684
5643
|
type: ['attributeReport', 'readResponse'],
|
|
5685
|
-
options: [exposes.options.precision('humidity'), exposes.options.calibration('humidity')],
|
|
5686
5644
|
convert: (model, msg, publish, options, meta) => {
|
|
5687
5645
|
const humidity = parseFloat(msg.data['measuredValue']) / 100.0;
|
|
5688
5646
|
// https://github.com/Koenkk/zigbee2mqtt/issues/13640
|
|
5689
5647
|
// SNZB-02 reports stranges values sometimes
|
|
5690
5648
|
if (humidity >= 0 && humidity <= 99.75) {
|
|
5691
|
-
return { humidity
|
|
5649
|
+
return { humidity };
|
|
5692
5650
|
}
|
|
5693
5651
|
},
|
|
5694
5652
|
},
|
|
@@ -6093,7 +6051,6 @@ const converters2 = {
|
|
|
6093
6051
|
RTCGQ11LM_illuminance: {
|
|
6094
6052
|
cluster: 'msIlluminanceMeasurement',
|
|
6095
6053
|
type: ['attributeReport', 'readResponse'],
|
|
6096
|
-
options: [exposes.options.calibration('illuminance', 'percentual'), exposes.options.calibration('illuminance_lux', 'percentual')],
|
|
6097
6054
|
convert: async (model, msg, publish, options, meta) => {
|
|
6098
6055
|
// also trigger movement, because there is no illuminance without movement
|
|
6099
6056
|
// https://github.com/Koenkk/zigbee-herdsman-converters/issues/1925
|
|
@@ -6102,8 +6059,8 @@ const converters2 = {
|
|
|
6102
6059
|
if (payload) {
|
|
6103
6060
|
// DEPRECATED: remove illuminance_lux here.
|
|
6104
6061
|
const illuminance = msg.data['measuredValue'];
|
|
6105
|
-
payload.illuminance =
|
|
6106
|
-
payload.illuminance_lux =
|
|
6062
|
+
payload.illuminance = illuminance;
|
|
6063
|
+
payload.illuminance_lux = illuminance;
|
|
6107
6064
|
}
|
|
6108
6065
|
return payload;
|
|
6109
6066
|
},
|