zigbee-herdsman-converters 15.0.111 → 15.0.112

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/devices/tuya.js CHANGED
@@ -1389,7 +1389,6 @@ module.exports = [
1389
1389
  },
1390
1390
  whiteLabel: [
1391
1391
  {vendor: 'Linkoze', model: 'LKMSZ001'},
1392
- tuya.whitelabel('TuYa', '809WZT', 'Motion sensor', ['_TZ3040_bb6xaihh']),
1393
1392
  ],
1394
1393
  },
1395
1394
  {
@@ -1410,6 +1409,9 @@ module.exports = [
1410
1409
  await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']);
1411
1410
  await reporting.batteryPercentageRemaining(endpoint);
1412
1411
  },
1412
+ whiteLabel: [
1413
+ tuya.whitelabel('TuYa', '809WZT', 'Motion sensor', ['_TZ3040_bb6xaihh']),
1414
+ ],
1413
1415
  },
1414
1416
  {
1415
1417
  fingerprint: [{modelID: 'TS0202', manufacturerName: '_TYZB01_dr6sduka'},
@@ -2279,7 +2281,7 @@ module.exports = [
2279
2281
  },
2280
2282
  {
2281
2283
  fingerprint: tuya.fingerprint('TS0001', ['_TZ3000_xkap8wtb', '_TZ3000_qnejhcsu', '_TZ3000_x3ewpzyr',
2282
- '_TZ3000_mkhkxx1p', '_TZ3000_tgddllx4']),
2284
+ '_TZ3000_mkhkxx1p', '_TZ3000_tgddllx4', '_TZ3000_kqvb5akv']),
2283
2285
  model: 'TS0001_power',
2284
2286
  description: 'Switch with power monitoring',
2285
2287
  vendor: 'TuYa',
@@ -2516,6 +2518,7 @@ module.exports = [
2516
2518
  {modelID: 'TS0601', manufacturerName: '_TZE200_cf1sl3tj'},
2517
2519
  {modelID: 'TS0601', manufacturerName: '_TZE200_b2u1drdv'},
2518
2520
  {modelID: 'TS0601', manufacturerName: '_TZE200_ol5jlkkr'},
2521
+ {modelID: 'TS0601', manufacturerName: '_TZE204_guvc7pdy'},
2519
2522
  // Roller blinds:
2520
2523
  {modelID: 'TS0601', manufacturerName: '_TZE200_fctwhugx'},
2521
2524
  {modelID: 'TS0601', manufacturerName: '_TZE200_hsgrhjpf'},
@@ -2552,6 +2555,7 @@ module.exports = [
2552
2555
  {vendor: 'Zemismart', model: 'BCM500DS-TYZ', description: 'Curtain motor'},
2553
2556
  {vendor: 'A-OK', model: 'AM25', description: 'Tubular motor'},
2554
2557
  {vendor: 'Alutech', model: 'AM/R-Sm', description: 'Tubular motor'},
2558
+ tuya.whitelabel('Shenzhen Golden Security Technology', 'GM46', 'Curtain motor', ['_TZE204_guvc7pdy']),
2555
2559
  tuya.whitelabel('Zemismart', 'ZM85EL-2Z', 'Roman Rod I type U curtains track', ['_TZE200_cf1sl3tj']),
2556
2560
  ],
2557
2561
  fromZigbee: [fz.tuya_cover, fz.ignore_basic_report],
package/devices/xiaomi.js CHANGED
@@ -10,7 +10,7 @@ const ea = exposes.access;
10
10
  const globalStore = require('../lib/store');
11
11
  const xiaomi = require('../lib/xiaomi');
12
12
  const utils = require('../lib/utils');
13
- const {printNumberAsHex, printNumbersAsHexSequence} = utils;
13
+ const {printNumbersAsHexSequence} = utils;
14
14
  const {fp1, manufacturerCode, trv} = xiaomi;
15
15
 
16
16
  const xiaomiExtend = {
@@ -35,12 +35,11 @@ const preventReset = async (type, data, device) => {
35
35
  ) {
36
36
  return;
37
37
  }
38
- const options = {manufacturerCode: 0x115f};
39
38
  const payload = {[0xfff0]: {
40
39
  value: [0xaa, 0x10, 0x05, 0x41, 0x47, 0x01, 0x01, 0x10, 0x01],
41
40
  type: 0x41,
42
41
  }};
43
- await device.getEndpoint(1).write('genBasic', payload, options);
42
+ await device.getEndpoint(1).write('genBasic', payload, {manufacturerCode});
44
43
  };
45
44
 
46
45
  const daysLookup = {
@@ -253,7 +252,6 @@ const fzLocal = {
253
252
 
254
253
  Object.entries(msg.data).forEach(([key, value]) => {
255
254
  const eventKey = parseInt(key);
256
- const eventKeyHex = printNumberAsHex(eventKey, 4);
257
255
 
258
256
  switch (eventKey) {
259
257
  case fp1.constants.region_event_key: {
@@ -287,21 +285,6 @@ const fzLocal = {
287
285
  payload.action = `region_${regionId}_${eventTypeName}`;
288
286
  break;
289
287
  }
290
- case 0xf7: {
291
- const valueHexSequence = printNumbersAsHexSequence(value, 2);
292
- log('debug', `Unhandled key ${eventKeyHex} = ${valueHexSequence}`);
293
- break;
294
- }
295
- case 0x0142:
296
- case 0x0143:
297
- case 0x0144:
298
- case 0x0146: {
299
- log('debug', `Unhandled key ${eventKeyHex} = ${value}`);
300
- break;
301
- }
302
- default: {
303
- log('warn', `Unknown key ${eventKeyHex} = ${value}`);
304
- }
305
288
  }
306
289
  });
307
290
 
@@ -354,6 +337,18 @@ const fzLocal = {
354
337
  };
355
338
 
356
339
  const tzLocal = {
340
+ aqara_detection_distance: {
341
+ key: ['detection_distance'],
342
+ convertSet: async (entity, key, value, meta) => {
343
+ value = value.toLowerCase();
344
+ const lookup = {'10mm': 1, '20mm': 2, '30mm': 3};
345
+ await entity.write('aqaraOpple', {0x010C: {value: lookup[value], type: 0x20}}, {manufacturerCode});
346
+ return {state: {detection_distance: value}};
347
+ },
348
+ convertGet: async (entity, key, meta) => {
349
+ await entity.read('aqaraOpple', [0x010C], {manufacturerCode});
350
+ },
351
+ },
357
352
  aqara_trv: {
358
353
  key: ['system_mode', 'preset', 'window_detection', 'valve_detection', 'child_lock', 'away_preset_temperature',
359
354
  'calibrate', 'sensor', 'sensor_temp', 'identify', 'schedule', 'schedule_settings'],
@@ -743,10 +738,12 @@ module.exports = [
743
738
  vendor: 'Xiaomi',
744
739
  description: 'Aqara P1 door & window contact sensor',
745
740
  fromZigbee: [fz.xiaomi_contact, fz.ias_contact_alarm_1, fz.aqara_opple],
746
- toZigbee: [],
741
+ toZigbee: [tzLocal.aqara_detection_distance],
747
742
  meta: {battery: {voltageToPercentage: '3V_2850_3000'}},
748
743
  exposes: [e.contact(), e.battery(), e.battery_voltage(),
749
744
  exposes.binary('battery_cover', ea.STATE, 'OPEN', 'CLOSE'),
745
+ exposes.enum('detection_distance', ea.ALL, ['10mm', '20mm', '30mm'])
746
+ .withDescription('The sensor will be considered "off" within the set distance. Please press the device button before setting'),
750
747
  ],
751
748
  },
752
749
  {
package/lib/xiaomi.js CHANGED
@@ -374,6 +374,8 @@ const numericAttributes2Payload = async (msg, meta, model, options, dataObject)
374
374
  case '159':
375
375
  if (['JT-BZ-01AQ/A'].includes(model.model)) {
376
376
  payload.gas_sensitivity = {1: '15%LEL', 2: '10%LEL'}[value];
377
+ } else if (['MCCGQ13LM'].includes(model.model)) {
378
+ payload.detection_distance = {1: '10mm', 2: '20mm', 3: '30mm'}[value];
377
379
  }
378
380
  break;
379
381
  case '160':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "15.0.111",
3
+ "version": "15.0.112",
4
4
  "description": "Collection of device converters to be used with zigbee-herdsman",
5
5
  "main": "index.js",
6
6
  "files": [