zigbee-herdsman-converters 14.0.604 → 14.0.605

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') {
@@ -2741,4 +2741,11 @@ module.exports = [
2741
2741
  description: 'Hue White E26 806 lumen',
2742
2742
  extend: hueExtend.light_onoff_brightness(),
2743
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
+ },
2744
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) => {
@@ -991,6 +1031,7 @@ module.exports = [
991
1031
  {modelID: 'TS0601', manufacturerName: '_TZE200_ebwgzdqq'},
992
1032
  {modelID: 'TS0601', manufacturerName: '_TZE200_9i9dt8is'},
993
1033
  {modelID: 'TS0601', manufacturerName: '_TZE200_dfxkcots'},
1034
+ {modelID: 'TS0601', manufacturerName: '_TZE200_w4cryh2i'},
994
1035
  {modelID: 'TS0601', manufacturerName: '_TZE200_ojzhk75b'},
995
1036
  {modelID: 'TS0601', manufacturerName: '_TZE200_swaamsoy'},
996
1037
  {modelID: 'TS0601', manufacturerName: '_TZE200_3p5ydos3'},
@@ -3081,4 +3122,21 @@ module.exports = [
3081
3122
  await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg', 'msTemperatureMeasurement', 'msRelativeHumidity']);
3082
3123
  },
3083
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
+ },
3084
3142
  ];
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.604",
3
+ "version": "14.0.605",
4
4
  "description": "Collection of device converters to be used with zigbee-herdsman",
5
5
  "main": "index.js",
6
6
  "files": [