zigbee-herdsman-converters 14.0.512 → 14.0.513

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.
@@ -1699,7 +1699,7 @@ const converters = {
1699
1699
  result.hysterersis = precisionRound(data[0x100A], 2) / 10;
1700
1700
  }
1701
1701
  if (data.hasOwnProperty(0x100B)) { // DisplayAutoOffEnable
1702
- const lookup = {0: 'enable', 1: 'disable'};
1702
+ const lookup = {0: 'enabled', 1: 'disabled'};
1703
1703
  result.display_auto_off_enabled = lookup[data[0x100B]];
1704
1704
  }
1705
1705
  if (data.hasOwnProperty(0x2001)) { // AlarmAirTempOverValue
@@ -8496,6 +8496,38 @@ const converters = {
8496
8496
  return result;
8497
8497
  },
8498
8498
  },
8499
+ ZG204ZL_lms: {
8500
+ cluster: 'manuSpecificTuya',
8501
+ type: ['commandDataResponse', 'commandDataReport'],
8502
+ convert: (model, msg, publish, options, meta) => {
8503
+ const result = {};
8504
+ for (const dpValue of msg.data.dpValues) {
8505
+ const dp = dpValue.dp;
8506
+ const value = tuya.getDataValue(dpValue);
8507
+ switch (dp) {
8508
+ case tuya.dataPoints.lmsState:
8509
+ result.occupancy = (value === 0);
8510
+ break;
8511
+ case tuya.dataPoints.lmsBattery:
8512
+ result.battery = value;
8513
+ break;
8514
+ case tuya.dataPoints.lmsSensitivity:
8515
+ result.sensitivity = {'0': 'low', '1': 'medium', '2': 'high'}[value];
8516
+ break;
8517
+ case tuya.dataPoints.lmsKeepTime:
8518
+ result.keep_time = {'0': '10', '1': '30', '2': '60', '3': '120'}[value];
8519
+ break;
8520
+ case tuya.dataPoints.lmsIlluminance:
8521
+ result.illuminance = value;
8522
+ break;
8523
+ default:
8524
+ meta.logger.warn(`zigbee-herdsman-converters:ZG204ZL_lms: NOT RECOGNIZED DP #${
8525
+ dp} with data ${JSON.stringify(dpValue)}`);
8526
+ }
8527
+ }
8528
+ return result;
8529
+ },
8530
+ },
8499
8531
  // #endregion
8500
8532
 
8501
8533
  // #region Ignore converters (these message dont need parsing).
@@ -3092,10 +3092,10 @@ const converters = {
3092
3092
  const payload = {0x1009: {value: value * 2, type: 0x20}};
3093
3093
  await entity.write('hvacThermostat', payload, manufacturerOptions.sunricher);
3094
3094
  } else if (key==='hysterersis') {
3095
- const payload = {0x100A: {value: value* 10, type: 0x20}};
3095
+ const payload = {0x100A: {value: value * 10, type: 0x20}};
3096
3096
  await entity.write('hvacThermostat', payload, manufacturerOptions.sunricher);
3097
3097
  } else if (key==='display_auto_off_enabled') {
3098
- const lookup = {'enable': 0, 'disabled': 1};
3098
+ const lookup = {'enabled': 0, 'disabled': 1};
3099
3099
  const payload = {0x100B: {value: lookup[value], type: herdsman.Zcl.DataType.enum8}};
3100
3100
  await entity.write('hvacThermostat', payload, manufacturerOptions.sunricher);
3101
3101
  } else if (key==='alarm_airtemp_overvalue') {
@@ -7436,6 +7436,33 @@ const converters = {
7436
7436
  }
7437
7437
  },
7438
7438
  },
7439
+ ZG204ZL_lms: {
7440
+ key: ['sensitivity', 'keep_time'],
7441
+ convertSet: async (entity, key, value, meta) => {
7442
+ switch (key) {
7443
+ case 'sensitivity':
7444
+ await tuya.sendDataPointEnum(entity, tuya.dataPoints.lmsSensitivity, {'low': 0, 'medium': 1, 'high': 2}[value]);
7445
+ break;
7446
+ case 'keep_time':
7447
+ await tuya.sendDataPointEnum(entity, tuya.dataPoints.lmsKeepTime, {'10': 0, '30': 1, '60': 2, '120': 3}[value]);
7448
+ break;
7449
+ default: // Unknown key
7450
+ meta.logger.warn(`tz.ZG204ZL_lms: Unhandled key ${key}`);
7451
+ }
7452
+ },
7453
+ convertGet: async (entity, key, meta) => {
7454
+ switch (key) {
7455
+ case 'sensitivity':
7456
+ await tuya.sendDataPointEnum(entity, tuya.dataPoints.lmsSensitivity, 0, 'dataQuery' );
7457
+ break;
7458
+ case 'keep_time':
7459
+ await tuya.sendDataPointEnum(entity, tuya.dataPoints.lmsKeepTime, 0, 'dataQuery' );
7460
+ break;
7461
+ default: // Unknown key
7462
+ meta.logger.warn(`Unhandled key toZigbee.ZG204ZL_lms.convertGet ${key}`);
7463
+ }
7464
+ },
7465
+ },
7439
7466
  // #endregion
7440
7467
 
7441
7468
  // #region Ignore converters
package/devices/lellki.js CHANGED
@@ -9,9 +9,10 @@ const tuya = require('../lib/tuya');
9
9
 
10
10
  module.exports = [
11
11
  {
12
- fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3000_air9m6af'}, {modelID: 'TS011F', manufacturerName: '_TZ3000_9djocypn'}],
12
+ fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3000_air9m6af'}, {modelID: 'TS011F', manufacturerName: '_TZ3000_9djocypn'},
13
+ {modelID: 'TS011F', manufacturerName: '_TZ3000_bppxj3sf'}],
13
14
  zigbeeModel: ['JZ-ZB-005'],
14
- model: 'WP33-EU',
15
+ model: 'WP33-EU/WP34-EU',
15
16
  vendor: 'LELLKI',
16
17
  description: 'Multiprise with 4 AC outlets and 2 USB super charging ports (16A)',
17
18
  extend: extend.switch(),
@@ -22,11 +23,9 @@ module.exports = [
22
23
  return {l1: 1, l2: 2, l3: 3, l4: 4, l5: 5};
23
24
  },
24
25
  configure: async (device, coordinatorEndpoint, logger) => {
25
- await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
26
- await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
27
- await reporting.bind(device.getEndpoint(3), coordinatorEndpoint, ['genOnOff']);
28
- await reporting.bind(device.getEndpoint(4), coordinatorEndpoint, ['genOnOff']);
29
- await reporting.bind(device.getEndpoint(5), coordinatorEndpoint, ['genOnOff']);
26
+ for (const ID of [1, 2, 3, 4, 5]) {
27
+ await reporting.bind(device.getEndpoint(ID), coordinatorEndpoint, ['genOnOff']);
28
+ }
30
29
  },
31
30
  },
32
31
  {
@@ -104,24 +103,6 @@ module.exports = [
104
103
  .withDescription('Recover state after power outage')],
105
104
  onEvent: tuya.onEventMeasurementPoll,
106
105
  },
107
- {
108
- fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3000_bppxj3sf'}],
109
- model: 'WP34-EU',
110
- vendor: 'LELLKI',
111
- description: 'Outlet power cord with 4 sockets and 2 USB',
112
- exposes: [e.switch().withEndpoint('l1'), e.switch().withEndpoint('l2'), e.switch().withEndpoint('l3'),
113
- e.switch().withEndpoint('l4'), e.switch().withEndpoint('l5')],
114
- extend: extend.switch(),
115
- meta: {multiEndpoint: true},
116
- configure: async (device, coordinatorEndpoint, logger) => {
117
- for (const ID of [1, 2, 3, 4, 5]) {
118
- await reporting.bind(device.getEndpoint(ID), coordinatorEndpoint, ['genOnOff']);
119
- }
120
- },
121
- endpoint: (device) => {
122
- return {'l1': 1, 'l2': 2, 'l3': 3, 'l4': 4, 'l5': 5};
123
- },
124
- },
125
106
  {
126
107
  fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3000_0yxeawjt'}],
127
108
  model: 'WK34-EU',
@@ -0,0 +1,41 @@
1
+ const exposes = require('../lib/exposes');
2
+ const fz = require('../converters/fromZigbee');
3
+ const tz = require('../converters/toZigbee');
4
+ const reporting = require('../lib/reporting');
5
+ const e = exposes.presets;
6
+ const ea = exposes.access;
7
+
8
+ module.exports = [
9
+ {
10
+ fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3210_7jnk7l3k'}],
11
+ model: 'SPP02GIP',
12
+ vendor: 'Mercator',
13
+ description: 'Ikuü double outdoors power point',
14
+ fromZigbee: [fz.on_off, fz.electrical_measurement, fz.metering, fz.ignore_basic_report, fz.tuya_switch_power_outage_memory],
15
+ toZigbee: [tz.on_off],
16
+ exposes: [e.switch().withEndpoint('left'), e.switch().withEndpoint('right'),
17
+ e.power().withEndpoint('left'), e.current().withEndpoint('left'),
18
+ e.voltage().withEndpoint('left').withAccess(ea.STATE), e.energy()],
19
+ endpoint: (device) => {
20
+ return {left: 1, right: 2};
21
+ },
22
+ meta: {multiEndpoint: true},
23
+ configure: async (device, coordinatorEndpoint, logger) => {
24
+ const endpoint1 = device.getEndpoint(1);
25
+ const endpoint2 = device.getEndpoint(2);
26
+ await reporting.bind(endpoint1, coordinatorEndpoint, ['genBasic', 'genOnOff', 'haElectricalMeasurement', 'seMetering']);
27
+ await reporting.bind(endpoint2, coordinatorEndpoint, ['genOnOff']);
28
+ await reporting.onOff(endpoint1);
29
+ await reporting.onOff(endpoint1);
30
+ await reporting.onOff(endpoint1);
31
+ await reporting.rmsVoltage(endpoint1, {change: 5});
32
+ await reporting.rmsCurrent(endpoint1, {change: 50});
33
+ await reporting.activePower(endpoint1, {change: 1});
34
+ await reporting.onOff(endpoint1);
35
+ await reporting.onOff(endpoint2);
36
+ endpoint1.saveClusterAttributeKeyValue('haElectricalMeasurement', {acCurrentDivisor: 1000, acCurrentMultiplier: 1});
37
+ endpoint1.saveClusterAttributeKeyValue('seMetering', {divisor: 100, multiplier: 1});
38
+ device.save();
39
+ },
40
+ },
41
+ ];
package/devices/moes.js CHANGED
@@ -165,7 +165,7 @@ module.exports = [
165
165
  },
166
166
  },
167
167
  {
168
- fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_tz32mtza'}, {modelID: 'TS0601', manufacturerName: '_TZE200_vm1gyrso'}],
168
+ fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_tz32mtza'}],
169
169
  model: 'ZTS-EU_3gang',
170
170
  vendor: 'Moes',
171
171
  description: 'Wall touch light switch (3 gang)',
package/devices/namron.js CHANGED
@@ -314,7 +314,7 @@ module.exports = [
314
314
  .withUnit('°C')
315
315
  .withValueMin(0.5).withValueMax(2).withValueStep(0.1)
316
316
  .withDescription('Hysteresis setting, between 0.5 and 2 in 0.1 °C. Default: 0.5.'),
317
- exposes.enum('display_auto_off_enabled', ea.ALL, ['enable', 'disabled']),
317
+ exposes.enum('display_auto_off_enabled', ea.ALL, ['enabled', 'disabled']),
318
318
  exposes.numeric('alarm_airtemp_overvalue', ea.ALL)
319
319
  .withUnit('°C')
320
320
  .withValueMin(20).withValueMax(60)
package/devices/tuya.js CHANGED
@@ -592,7 +592,7 @@ module.exports = [
592
592
  },
593
593
  },
594
594
  {
595
- fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_aqnazj70'}],
595
+ fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_aqnazj70'}, {modelID: 'TS0601', manufacturerName: 'TZE200_k6jhsr0q'}],
596
596
  model: 'TS0601_switch_4_gang',
597
597
  vendor: 'TuYa',
598
598
  description: '4 gang switch',
@@ -712,6 +712,7 @@ module.exports = [
712
712
  {modelID: 'TS0502B', manufacturerName: '_TZ3210_ijsj2evj'},
713
713
  {modelID: 'TS0502B', manufacturerName: '_TZ3210_pgq2qvyv'},
714
714
  {modelID: 'TS0502B', manufacturerName: '_TZ3210_nvaik6gk'},
715
+ {modelID: 'TS0502B', manufacturerName: '_TZ3000_armwcncd'},
715
716
  ],
716
717
  model: 'TS0502B',
717
718
  vendor: 'TuYa',
@@ -1417,7 +1418,10 @@ module.exports = [
1417
1418
  .withDescription('Plug LED indicator mode'), e.child_lock()],
1418
1419
  },
1419
1420
  {
1420
- fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3000_gjnozsaz', applicationVersion: 74}]
1421
+ fingerprint: [
1422
+ {modelID: 'TS011F', manufacturerName: '_TZ3000_gjnozsaz', applicationVersion: 74},
1423
+ {modelID: 'TS011F', manufacturerName: '_TZ3000_cehuw1lw', applicationVersion: 74},
1424
+ ]
1421
1425
  .concat(...TS011Fplugs.map((manufacturerName) => {
1422
1426
  return [69, 68, 65, 64].map((applicationVersion) => {
1423
1427
  return {modelID: 'TS011F', manufacturerName, applicationVersion};
@@ -2350,4 +2354,20 @@ module.exports = [
2350
2354
  onEvent: tuya.onEventSetLocalTime,
2351
2355
  exposes: [e.temperature(), e.humidity(), e.battery()],
2352
2356
  },
2357
+ {
2358
+ fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_3towulqd'}],
2359
+ model: 'ZG-204ZL',
2360
+ vendor: 'TuYa',
2361
+ description: 'Luminance motion sensor',
2362
+ fromZigbee: [fz.ZG204ZL_lms],
2363
+ toZigbee: [tz.ZG204ZL_lms],
2364
+ exposes: [
2365
+ e.occupancy(), e.illuminance(), e.battery(),
2366
+ exposes.enum('sensitivity', ea.ALL, ['low', 'medium', 'high'])
2367
+ .withDescription('PIR sensor sensitivity (refresh and update only while active)'),
2368
+ exposes.enum('keep_time', ea.ALL, ['10', '30', '60', '120'])
2369
+ .withDescription('PIR keep time in seconds (refresh and update only while active)'),
2370
+ ],
2371
+ },
2372
+
2353
2373
  ];
package/devices/xiaomi.js CHANGED
@@ -884,7 +884,8 @@ module.exports = [
884
884
  description: 'Aqara T1 human body movement and illuminance sensor',
885
885
  fromZigbee: [fz.aqara_occupancy_illuminance, fz.aqara_opple, fz.battery],
886
886
  toZigbee: [tz.aqara_detection_interval],
887
- exposes: [e.occupancy(), e.illuminance().withUnit('lx').withDescription('Measured illuminance in lux'),
887
+ exposes: [e.occupancy(), e.illuminance_lux().withProperty('illuminance'),
888
+ e.illuminance().withUnit('lx').withDescription('Measured illuminance in lux'),
888
889
  exposes.numeric('detection_interval', ea.ALL).withValueMin(2).withValueMax(65535).withUnit('s')
889
890
  .withDescription('Time interval for detecting actions'), e.temperature(), e.battery()],
890
891
  meta: {battery: {voltageToPercentage: '3V_2850_3000_log'}},
package/lib/tuya.js CHANGED
@@ -686,6 +686,12 @@ const dataPoints = {
686
686
  tshpsIlluminanceLux: 104,
687
687
  tshpsCLI: 103, // not recognize
688
688
  tshpsSelfTest: 6, // not recognize
689
+ // TuYa Luminance Motion sensor
690
+ lmsState: 1,
691
+ lmsBattery: 4,
692
+ lmsSensitivity: 9,
693
+ lmsKeepTime: 10,
694
+ lmsIlluminance: 12,
689
695
  };
690
696
 
691
697
  const thermostatWeekFormat = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "14.0.512",
3
+ "version": "14.0.513",
4
4
  "description": "Collection of device converters to be used with zigbee-herdsman",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -38,7 +38,7 @@
38
38
  "buffer-crc32": "^0.2.13",
39
39
  "https-proxy-agent": "^5.0.1",
40
40
  "tar-stream": "^2.2.0",
41
- "zigbee-herdsman": "^0.14.27"
41
+ "zigbee-herdsman": "^0.14.28"
42
42
  },
43
43
  "devDependencies": {
44
44
  "eslint": "*",