zigbee-herdsman-converters 14.0.603 → 14.0.606

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.
@@ -4839,7 +4839,8 @@ const converters = {
4839
4839
  }
4840
4840
  return {brightness: mapNumberRange(value, 10, 1000, 0, 254)};
4841
4841
  }
4842
- } else if (['_TZE200_3p5ydos3', '_TZE200_9i9dt8is', '_TZE200_dfxkcots'].includes(meta.device.manufacturerName)) {
4842
+ } else if (['_TZE200_3p5ydos3', '_TZE200_9i9dt8is', '_TZE200_dfxkcots', '_TZE200_w4cryh2i']
4843
+ .includes(meta.device.manufacturerName)) {
4843
4844
  if (dpValue.dp === tuya.dataPoints.eardaDimmerLevel) {
4844
4845
  return {brightness: mapNumberRange(value, 0, 1000, 0, 254)};
4845
4846
  } else if (dpValue.dp === tuya.dataPoints.dimmerMinLevel) {
@@ -3825,7 +3825,7 @@ const converters = {
3825
3825
  // upscale to 1000
3826
3826
  let newValue;
3827
3827
  let dp = tuya.dataPoints.dimmerLevel;
3828
- if (['_TZE200_3p5ydos3', '_TZE200_9i9dt8is', '_TZE200_dfxkcots'].includes(meta.device.manufacturerName)) {
3828
+ if (['_TZE200_3p5ydos3', '_TZE200_9i9dt8is', '_TZE200_dfxkcots', '_TZE200_w4cryh2i'].includes(meta.device.manufacturerName)) {
3829
3829
  dp = tuya.dataPoints.eardaDimmerLevel;
3830
3830
  }
3831
3831
  if (key === 'brightness_min') {
@@ -0,0 +1,11 @@
1
+ const extend = require('../lib/extend');
2
+
3
+ module.exports = [
4
+ {
5
+ fingerprint: [{modelID: 'TS0505B', manufacturerName: '_TZ3210_mcm6m1ma'}],
6
+ model: 'DL41-03-10-R-ZB',
7
+ vendor: 'Oz Smart Things',
8
+ description: 'Oz Smart RGBW Zigbee downlight 10w',
9
+ extend: extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
10
+ },
11
+ ];
@@ -336,6 +336,13 @@ module.exports = [
336
336
  description: 'Hue Iris rose limited edition (generation 4) ',
337
337
  extend: hueExtend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
338
338
  },
339
+ {
340
+ zigbeeModel: ['929002401201'],
341
+ model: '929002401201',
342
+ vendor: 'Philips',
343
+ description: 'Hue Iris copper special edition (generation 4) ',
344
+ extend: hueExtend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
345
+ },
339
346
  {
340
347
  zigbeeModel: ['5063130P7'],
341
348
  model: '5063130P7',
@@ -2734,4 +2741,11 @@ module.exports = [
2734
2741
  description: 'Hue White E26 806 lumen',
2735
2742
  extend: hueExtend.light_onoff_brightness(),
2736
2743
  },
2744
+ {
2745
+ zigbeeModel: ['3402931P7'],
2746
+ model: '3402931P7',
2747
+ vendor: 'Philips',
2748
+ description: 'Philips Hue Adore Bathroom Mirror Light',
2749
+ extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
2750
+ },
2737
2751
  ];
@@ -4,9 +4,41 @@ const tz = require('../converters/toZigbee');
4
4
  const reporting = require('../lib/reporting');
5
5
  const extend = require('../lib/extend');
6
6
  const ota = require('../lib/ota');
7
+ const globalStore = require('../lib/store');
7
8
  const e = exposes.presets;
8
9
  const ea = exposes.access;
9
10
 
11
+ const fzLocal = {
12
+ DMS300_IN: {
13
+ cluster: 'msOccupancySensing',
14
+ type: ['attributeReport', 'readResponse'],
15
+ options: [exposes.options.no_occupancy_since_false()],
16
+ convert: (model, msg, publish, options, meta) => {
17
+ const occupancyIn = msg.data.occupancy;
18
+ globalStore.putValue(msg.endpoint, 'occupancy_in', occupancyIn);
19
+ const occupancy = occupancyIn | globalStore.getValue(msg.endpoint, 'occupancy_out', 0);
20
+ return {
21
+ occupancy_in: (occupancyIn & 1) > 0,
22
+ occupancy: (occupancy & 1) > 0,
23
+ };
24
+ },
25
+ },
26
+ DMS300_OUT: {
27
+ cluster: 'ssIasZone',
28
+ type: 'commandStatusChangeNotification',
29
+ convert: (model, msg, publish, options, meta) => {
30
+ const occupancyOut = msg.data.zonestatus;
31
+ globalStore.putValue(msg.endpoint, 'occupancy_out', occupancyOut);
32
+ const occupancy = occupancyOut | globalStore.getValue(msg.endpoint, 'occupancy_in', 0);
33
+ return {
34
+ occupancy_out: (occupancyOut & 1) > 0,
35
+ occupancy: (occupancy & 1) > 0,
36
+ };
37
+ },
38
+ },
39
+ };
40
+
41
+
10
42
  module.exports = [
11
43
  {
12
44
  fingerprint: [
@@ -397,18 +429,27 @@ module.exports = [
397
429
  ota: ota.zigbeeOTA,
398
430
  description: 'SiHAS dual motion sensor',
399
431
  meta: {battery: {voltageToPercentage: '3V_2100'}},
400
- fromZigbee: [fz.battery, fz.occupancy, fz.occupancy_timeout],
432
+ fromZigbee: [fz.battery, fzLocal.DMS300_OUT, fzLocal.DMS300_IN, fz.occupancy_timeout],
401
433
  toZigbee: [tz.occupancy_timeout],
402
434
  configure: async (device, coordinatorEndpoint, logger) => {
403
435
  const endpoint = device.getEndpoint(1);
404
- const binds = ['genPowerCfg', 'msOccupancySensing'];
436
+ const binds = ['genPowerCfg', 'msOccupancySensing', 'ssIasZone'];
405
437
  await reporting.bind(endpoint, coordinatorEndpoint, binds);
406
438
  await reporting.batteryVoltage(endpoint, {min: 30, max: 21600, change: 1});
407
439
  await reporting.occupancy(endpoint, {min: 1, max: 600, change: 1});
440
+ const payload = [{
441
+ attribute: 'zoneStatus', minimumReportInterval: 1, maximumReportInterval: 600, reportableChange: 1}];
442
+ await endpoint.configureReporting('ssIasZone', payload);
408
443
  await endpoint.read('msOccupancySensing', ['pirOToUDelay']);
409
444
  },
410
- exposes: [e.battery(), e.battery_voltage(), e.occupancy(),
411
- exposes.numeric('occupancy_timeout', ea.ALL).withUnit('second').withValueMin(0).withValueMax(65535)],
445
+ exposes: [e.battery(), e.battery_voltage(),
446
+ exposes.binary('occupancy_in', ea.STATE, true, false)
447
+ .withDescription('Indicates whether "IN" Sensor of the device detected occupancy'),
448
+ exposes.binary('occupancy_out', ea.STATE, true, false)
449
+ .withDescription('Indicates whether "OUT" Sensor of the device detected occupancy'),
450
+ exposes.binary('occupancy', ea.STATE, true, false)
451
+ .withDescription('Indicates whether "IN or OUT" Sensor of the device detected occupancy'),
452
+ exposes.numeric('occupancy_timeout', ea.ALL).withUnit('second').withValueMin(0).withValueMax(3600)],
412
453
  },
413
454
  {
414
455
  zigbeeModel: ['ISM300Z3'],
package/devices/sonoff.js CHANGED
@@ -7,6 +7,19 @@ const extend = require('../lib/extend');
7
7
  const e = exposes.presets;
8
8
  const ota = require('../lib/ota');
9
9
 
10
+ const fzLocal = {
11
+ // SNZB-02 reports stranges values sometimes
12
+ // https://github.com/Koenkk/zigbee2mqtt/issues/13640
13
+ SNZB02_temperature: {
14
+ ...fz.temperature,
15
+ convert: (model, msg, publish, options, meta) => {
16
+ if (msg.data.measuredValue > -10000 && msg.data.measuredValue < 10000) {
17
+ return fz.temperature.convert(model, msg, publish, options, meta);
18
+ }
19
+ },
20
+ },
21
+ };
22
+
10
23
  module.exports = [
11
24
  {
12
25
  zigbeeModel: ['BASICZBR3'],
@@ -119,7 +132,7 @@ module.exports = [
119
132
  whiteLabel: [{vendor: 'eWeLink', model: 'RHK08'}],
120
133
  description: 'Temperature and humidity sensor',
121
134
  exposes: [e.battery(), e.temperature(), e.humidity(), e.battery_voltage()],
122
- fromZigbee: [fz.temperature, fz.humidity, fz.battery],
135
+ fromZigbee: [fzLocal.SNZB02_temperature, fz.humidity, fz.battery],
123
136
  toZigbee: [],
124
137
  configure: async (device, coordinatorEndpoint, logger) => {
125
138
  try {
package/devices/tuya.js CHANGED
@@ -23,6 +23,18 @@ const TS011Fplugs = ['_TZ3000_5f43h46b', '_TZ3000_cphmq0q7', '_TZ3000_dpo1ysak',
23
23
  '_TZ3000_ss98ec5d', '_TZ3000_gznh2xla'];
24
24
 
25
25
  const tzLocal = {
26
+ hpsz: {
27
+ key: ['led_state'],
28
+ convertSet: async (entity, key, value, meta) => {
29
+ switch (key) {
30
+ case 'led_state': {
31
+ const ledState = value.toUpperCase() === 'ON' ? true : false;
32
+ await tuya.sendDataPointBool(entity, tuya.dataPoints.HPSZLEDState, ledState);
33
+ return {led_state: value};
34
+ }
35
+ }
36
+ },
37
+ },
26
38
  TS0504B_color: {
27
39
  key: ['color'],
28
40
  convertSet: async (entity, key, value, meta) => {
@@ -271,6 +283,34 @@ const tzLocal = {
271
283
  };
272
284
 
273
285
  const fzLocal = {
286
+ hpsz: {
287
+ cluster: 'manuSpecificTuya',
288
+ type: ['commandDataResponse', 'commandDataReport'],
289
+ convert: (model, msg, publish, options, meta) => {
290
+ const dpValue = tuya.firstDpValue(msg, meta, 'hpsz');
291
+ const dp = dpValue.dp;
292
+ const value = tuya.getDataValue(dpValue);
293
+ let result = null;
294
+ switch (dp) {
295
+ case tuya.dataPoints.HPSZInductionState:
296
+ result = {presence: value === 1};
297
+ break;
298
+ case tuya.dataPoints.HPSZPresenceTime:
299
+ result = {duration_of_attendance: value};
300
+ break;
301
+ case tuya.dataPoints.HPSZLeavingTime:
302
+ result = {duration_of_absence: value};
303
+ break;
304
+ case tuya.dataPoints.HPSZLEDState:
305
+ result = {state: value};
306
+ break;
307
+ default:
308
+ meta.logger.warn(`zigbee-herdsman-converters:hpsz: NOT RECOGNIZED DP #${
309
+ dp} with data ${JSON.stringify(dpValue)}`);
310
+ }
311
+ return result;
312
+ },
313
+ },
274
314
  metering_skip_duplicate: {
275
315
  ...fz.metering,
276
316
  convert: (model, msg, publish, options, meta) => {
@@ -278,6 +318,13 @@ const fzLocal = {
278
318
  return fz.metering.convert(model, msg, publish, options, meta);
279
319
  },
280
320
  },
321
+ electrical_measurement_skip_duplicate: {
322
+ ...fz.electrical_measurement,
323
+ convert: (model, msg, publish, options, meta) => {
324
+ if (utils.hasAlreadyProcessedMessage(msg)) return;
325
+ return fz.electrical_measurement.convert(model, msg, publish, options, meta);
326
+ },
327
+ },
281
328
  scenes_recall_scene_65029: {
282
329
  cluster: '65029',
283
330
  type: ['raw', 'attributeReport'],
@@ -984,6 +1031,7 @@ module.exports = [
984
1031
  {modelID: 'TS0601', manufacturerName: '_TZE200_ebwgzdqq'},
985
1032
  {modelID: 'TS0601', manufacturerName: '_TZE200_9i9dt8is'},
986
1033
  {modelID: 'TS0601', manufacturerName: '_TZE200_dfxkcots'},
1034
+ {modelID: 'TS0601', manufacturerName: '_TZE200_w4cryh2i'},
987
1035
  {modelID: 'TS0601', manufacturerName: '_TZE200_ojzhk75b'},
988
1036
  {modelID: 'TS0601', manufacturerName: '_TZE200_swaamsoy'},
989
1037
  {modelID: 'TS0601', manufacturerName: '_TZE200_3p5ydos3'},
@@ -1744,6 +1792,7 @@ module.exports = [
1744
1792
  {modelID: 'TS0601', manufacturerName: '_TZE200_e9ba97vf'}, /* model: 'TV01-ZB', vendor: 'Moes' */
1745
1793
  {modelID: 'TS0601', manufacturerName: '_TZE200_husqqvux'}, /* model: 'TSL-TRV-TV01ZG', vendor: 'Tesla Smart' */
1746
1794
  {modelID: 'TS0601', manufacturerName: '_TZE200_lllliz3p'}, /* model: 'TV02-Zigbee', vendor: 'TuYa' */
1795
+ {modelID: 'TS0601', manufacturerName: '_TZE200_mudxchsu'}, /* model: 'TV05-ZG curve', vendor: 'TuYa' */
1747
1796
  ],
1748
1797
  model: 'TV02-Zigbee',
1749
1798
  vendor: 'TuYa',
@@ -1938,7 +1987,7 @@ module.exports = [
1938
1987
  {vendor: 'BlitzWolf', model: 'BW-SHP15'}, {vendor: 'Nous', model: 'A1Z'}, {vendor: 'BlitzWolf', model: 'BW-SHP13'},
1939
1988
  {vendor: 'MatSee Plus', model: 'PJ-ZSW01'}],
1940
1989
  ota: ota.zigbeeOTA,
1941
- fromZigbee: [fz.on_off, fz.electrical_measurement, fzLocal.metering_skip_duplicate, fz.ignore_basic_report,
1990
+ fromZigbee: [fz.on_off, fzLocal.electrical_measurement_skip_duplicate, fzLocal.metering_skip_duplicate, fz.ignore_basic_report,
1942
1991
  fz.tuya_switch_power_outage_memory, fz.ts011f_plug_indicator_mode, fz.ts011f_plug_child_mode],
1943
1992
  toZigbee: [tz.on_off, tz.tuya_switch_power_outage_memory, tz.ts011f_plug_indicator_mode, tz.ts011f_plug_child_mode],
1944
1993
  configure: async (device, coordinatorEndpoint, logger) => {
@@ -1992,7 +2041,7 @@ module.exports = [
1992
2041
  whiteLabel: [{vendor: 'VIKEFON', model: 'TS011F'}, {vendor: 'BlitzWolf', model: 'BW-SHP15'},
1993
2042
  {vendor: 'Avatto', model: 'MIUCOT10Z'}, {vendor: 'Neo', model: 'NAS-WR01B'}],
1994
2043
  ota: ota.zigbeeOTA,
1995
- fromZigbee: [fz.on_off, fz.electrical_measurement, fzLocal.metering_skip_duplicate, fz.ignore_basic_report,
2044
+ fromZigbee: [fz.on_off, fzLocal.electrical_measurement_skip_duplicate, fzLocal.metering_skip_duplicate, fz.ignore_basic_report,
1996
2045
  fz.tuya_switch_power_outage_memory, fz.ts011f_plug_indicator_mode, fz.ts011f_plug_child_mode],
1997
2046
  toZigbee: [tz.on_off, tz.tuya_switch_power_outage_memory, tz.ts011f_plug_indicator_mode, tz.ts011f_plug_child_mode],
1998
2047
  configure: async (device, coordinatorEndpoint, logger) => {
@@ -3073,4 +3122,21 @@ module.exports = [
3073
3122
  await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg', 'msTemperatureMeasurement', 'msRelativeHumidity']);
3074
3123
  },
3075
3124
  },
3125
+ {
3126
+ fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_0u3bj3rc'}],
3127
+ model: 'TS0601_human_presence_sensor',
3128
+ vendor: 'TuYa',
3129
+ description: 'Human presence sensor Zigbee',
3130
+ fromZigbee: [fzLocal.hpsz],
3131
+ toZigbee: [tzLocal.hpsz],
3132
+ onEvent: tuya.onEventSetLocalTime,
3133
+ exposes: [e.presence(),
3134
+ exposes.numeric('duration_of_attendance', ea.STATE).withUnit('minutes')
3135
+ .withDescription('Shows the presence duration in minutes'),
3136
+ exposes.numeric('duration_of_absence', ea.STATE).withUnit('minutes')
3137
+ .withDescription('Shows the duration of the absence in minutes'),
3138
+ exposes.enum('led_state', ea.STATE_SET, ['on', 'off'])
3139
+ .withDescription('Turns the onboard LED on or off'),
3140
+ ],
3141
+ },
3076
3142
  ];
package/devices/yale.js CHANGED
@@ -129,7 +129,7 @@ module.exports = [
129
129
  model: 'YDF40',
130
130
  vendor: 'Yale',
131
131
  description: 'Real living lock / Intelligent biometric digital lock',
132
- extend: lockExtend({}, {max: 900}, ['closuresDoorLock']),
132
+ extend: lockExtend({battery: {dontDividePercentage: true}}, {max: 900}, ['closuresDoorLock']),
133
133
  },
134
134
  {
135
135
  zigbeeModel: ['06ffff2027'],
package/lib/tuya.js CHANGED
@@ -842,6 +842,11 @@ const dataPoints = {
842
842
  alectoSilence: 16,
843
843
  // BAC-002-ALZB - Moes like thermostat with Fan control
844
844
  bacFanMode: 28,
845
+ // Human Presence Sensor Zigbee Radiowave Tuya
846
+ HPSZInductionState: 1,
847
+ HPSZPresenceTime: 101,
848
+ HPSZLeavingTime: 102,
849
+ HPSZLEDState: 103,
845
850
  };
846
851
 
847
852
  const thermostatWeekFormat = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "14.0.603",
3
+ "version": "14.0.606",
4
4
  "description": "Collection of device converters to be used with zigbee-herdsman",
5
5
  "main": "index.js",
6
6
  "files": [