zigbee-herdsman-converters 14.0.473 → 14.0.476

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.
@@ -2491,7 +2491,6 @@ const converters = {
2491
2491
  const dpValue = tuya.firstDpValue(msg, meta, 'neo_nas_pd07');
2492
2492
  const dp = dpValue.dp;
2493
2493
  const value = tuya.getDataValue(dpValue);
2494
-
2495
2494
  if (dp === 101) return {occupancy: value > 0 ? true : false};
2496
2495
  else if (dp === 102) {
2497
2496
  return {
@@ -2504,8 +2503,19 @@ const converters = {
2504
2503
  return {temperature: calibrateAndPrecisionRoundOptions(value / 10, options, 'temperature')};
2505
2504
  } else if (dp === 105) {
2506
2505
  return {humidity: calibrateAndPrecisionRoundOptions(value, options, 'humidity')};
2506
+ } else if (dp === tuya.dataPoints.neoMinTemp) {
2507
+ return {temperature_min: value};
2508
+ } else if (dp === tuya.dataPoints.neoMaxTemp) {
2509
+ return {temperature_max: value};
2510
+ } else if (dp === tuya.dataPoints.neoMinHumidity) {
2511
+ return {humidity_min: value};
2512
+ } else if (dp === tuya.dataPoints.neoMaxHumidity) {
2513
+ return {humidity_max: value};
2514
+ } else if (dp === 113) {
2515
+ return {alarm: {0: 'over_temperature', 1: 'over_humidity',
2516
+ 2: 'below_min_temperature', 3: 'below_min_humdity', 4: 'off'}[value]};
2507
2517
  } else {
2508
- meta.logger.warn(`zigbee-herdsman-converters:NEO-PD07: NOT RECOGNIZED DP #${dp} with data ${JSON.stringify(dpValue)}`);
2518
+ meta.logger.warn(`fromZigbee.neo_nas_pd07: Unrecognized DP #${dp} with data ${JSON.stringify(dpValue)}`);
2509
2519
  }
2510
2520
  },
2511
2521
  },
@@ -7194,6 +7204,27 @@ const converters = {
7194
7204
  return {occupancy: (zoneStatus & 1) > 0, tamper: (zoneStatus & 4) > 0};
7195
7205
  },
7196
7206
  },
7207
+ ZB006X_settings: {
7208
+ cluster: 'manuSpecificTuya',
7209
+ type: ['commandDataResponse'],
7210
+ convert: (model, msg, publish, options, meta) => {
7211
+ const dpValue = tuya.firstDpValue(msg, meta, 'ZB006X_settings');
7212
+ const dp = dpValue.dp;
7213
+ const value = tuya.getDataValue(dpValue);
7214
+ if (dp === 103) {
7215
+ meta.logger.debug(`fromZigbee.ZB006X_settings: Found DP #${dp} with data ${JSON.stringify(dpValue)}`);
7216
+ return {ext_switch_type: {0: 'unknown', 1: 'toggle_sw', 2: 'momentary_sw', 3: 'rotary_sw', 4: 'auto_config'}[value]};
7217
+ } else if (dp === 105) {
7218
+ meta.logger.debug(`fromZigbee.ZB006X_settings: Found DP #${dp} with data ${JSON.stringify(dpValue)}`);
7219
+ return {load_detection_mode: {0: 'none', 1: 'first_power_on', 2: 'every_power_on'}[value]};
7220
+ } else if (dp === 109) {
7221
+ meta.logger.debug(`fromZigbee.ZB006X_settings: Found DP #${dp} with data ${JSON.stringify(dpValue)}`);
7222
+ return {control_mode: {0: 'local', 1: 'remote', 2: 'both'}[value]};
7223
+ } else {
7224
+ meta.logger.warn(`fromZigbee.ZB006X_settings: Unrecognized DP #${dp} with data ${JSON.stringify(dpValue)}`);
7225
+ }
7226
+ },
7227
+ },
7197
7228
  ZM35HQ_attr: {
7198
7229
  cluster: 'ssIasZone',
7199
7230
  type: ['attributeReport', 'readResponse'],
@@ -7534,11 +7565,11 @@ const converters = {
7534
7565
  if (0x8000 in msg.data) {
7535
7566
  const firmware = msg.data[0x8000].join('.');
7536
7567
  result.current_firmware = firmware;
7537
- msg.device.zhDevice.softwareBuildID = firmware;
7568
+ meta.device.softwareBuildID = firmware;
7538
7569
  }
7539
7570
 
7540
7571
  if (0x8020 in msg.data) {
7541
- msg.device.zhDevice.hardwareVersion = msg.data[0x8020].join('.');
7572
+ meta.device.hardwareVersion = msg.data[0x8020].join('.');
7542
7573
  }
7543
7574
 
7544
7575
  return result;
@@ -5332,6 +5332,27 @@ const converters = {
5332
5332
  await entity.read(payloads[key][0], [payloads[key][1]]);
5333
5333
  },
5334
5334
  },
5335
+ neo_nas_pd07: {
5336
+ key: ['temperature_max', 'temperature_min', 'humidity_max', 'humidity_min'],
5337
+ convertSet: async (entity, key, value, meta) => {
5338
+ switch (key) {
5339
+ case 'temperature_max':
5340
+ await tuya.sendDataPointValue(entity, tuya.dataPoints.neoMaxTemp, value);
5341
+ break;
5342
+ case 'temperature_min':
5343
+ await tuya.sendDataPointValue(entity, tuya.dataPoints.neoMinTemp, value);
5344
+ break;
5345
+ case 'humidity_max':
5346
+ await tuya.sendDataPointValue(entity, tuya.dataPoints.neoMaxHumidity, value);
5347
+ break;
5348
+ case 'humidity_min':
5349
+ await tuya.sendDataPointValue(entity, tuya.dataPoints.neoMinHumidity, value);
5350
+ break;
5351
+ default: // Unknown key
5352
+ throw new Error(`toZigbee.neo_nas_pd07: Unhandled key ${key}`);
5353
+ }
5354
+ },
5355
+ },
5335
5356
  neo_t_h_alarm: {
5336
5357
  key: [
5337
5358
  'alarm', 'melody', 'volume', 'duration',
@@ -6285,6 +6306,28 @@ const converters = {
6285
6306
  }
6286
6307
  },
6287
6308
  },
6309
+ ZB006X_settings: {
6310
+ key: ['ext_switch_type', 'load_detection_mode', 'control_mode'],
6311
+ convertSet: async (entity, key, value, meta) => {
6312
+ switch (key) {
6313
+ case 'ext_switch_type':
6314
+ meta.logger.debug(`toZigbee.ZB006X_settings: Send key/value [${key}|${value}]`);
6315
+ await tuya.sendDataPointEnum(entity, 103, {'unknown': 0, 'toggle_sw': 1,
6316
+ 'momentary_sw': 2, 'rotary_sw': 3, 'auto_config': 4}[value]);
6317
+ break;
6318
+ case 'load_detection_mode':
6319
+ meta.logger.debug(`toZigbee.ZB006X_settings: Send key/value [${key}|${value}]`);
6320
+ await tuya.sendDataPointEnum(entity, 105, {'none': 0, 'first_power_on': 1, 'every_power_on': 2}[value]);
6321
+ break;
6322
+ case 'control_mode':
6323
+ meta.logger.debug(`toZigbee.ZB006X_settings: Send key/value [${key}|${value}]`);
6324
+ await tuya.sendDataPointEnum(entity, 109, {'local': 0, 'remote': 1, 'both': 2}[value]);
6325
+ break;
6326
+ default: // Unknown key
6327
+ throw new Error(`toZigbee.ZB006X_settings: Unhandled key ${key}`);
6328
+ }
6329
+ },
6330
+ },
6288
6331
  ZM35HQ_attr: {
6289
6332
  key: [
6290
6333
  'sensitivity', 'keep_time',
package/devices/adeo.js CHANGED
@@ -8,7 +8,7 @@ const e = exposes.presets;
8
8
  module.exports = [
9
9
  {
10
10
  zigbeeModel: ['ZBEK-4'],
11
- model: 'IM-CDZDGAAA0005KA8MAN',
11
+ model: 'IM-CDZDGAAA0005KA_MAN',
12
12
  vendor: 'ADEO',
13
13
  description: 'ENKI LEXMAN RGBTW GU10 Bulb',
14
14
  extend: extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 370]}),
@@ -27,6 +27,13 @@ module.exports = [
27
27
  description: 'ENKI LEXMAN E27 LED white',
28
28
  extend: extend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
29
29
  },
30
+ {
31
+ zigbeeModel: ['ZBEK-5'],
32
+ model: 'IST-CDZFB2AS007NA-MZN-01',
33
+ vendor: 'ADEO',
34
+ description: 'ENKI LEXMAN E27 LED white',
35
+ extend: extend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
36
+ },
30
37
  {
31
38
  zigbeeModel: ['ZBEK-3'],
32
39
  model: 'IP-CDZOTAAP005JA-MAN',
@@ -46,7 +46,8 @@ module.exports = [
46
46
  await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'haElectricalMeasurement', 'seMetering', 'genDeviceTempCfg']);
47
47
  await reporting.onOff(endpoint);
48
48
  await reporting.deviceTemperature(endpoint);
49
- await reporting.readEletricalMeasurementMultiplierDivisors(endpoint);
49
+ // Set to true, to access the acFrequencyDivisor and acFrequencyMultiplier attribute. Not all devices support this.
50
+ await reporting.readEletricalMeasurementMultiplierDivisors(endpoint, true);
50
51
  await reporting.activePower(endpoint, {change: 10}); // Power reports with every 10W change
51
52
  await reporting.rmsCurrent(endpoint, {change: 20}); // Current reports with every 20mA change
52
53
  await reporting.rmsVoltage(endpoint, {min: constants.repInterval.MINUTES_5, change: 400}); // Limit reports to every 5m, or 4V
@@ -0,0 +1,11 @@
1
+ const extend = require('../lib/extend');
2
+
3
+ module.exports = [
4
+ {
5
+ zigbeeModel: ['CS-Z-CZ-2402'],
6
+ model: 'CS-Z-CZ-2402',
7
+ vendor: 'DNAKE',
8
+ description: 'Smart socket',
9
+ extend: extend.switch(),
10
+ },
11
+ ];
package/devices/fantem.js CHANGED
@@ -13,7 +13,15 @@ module.exports = [
13
13
  vendor: 'Fantem',
14
14
  description: 'Smart dimmer module without neutral',
15
15
  extend: extend.light_onoff_brightness({noConfigure: true}),
16
- exposes: [e.light_brightness()],
16
+ fromZigbee: [...extend.light_onoff_brightness({noConfigure: true}).fromZigbee, fz.ZB006X_settings],
17
+ toZigbee: [...extend.light_onoff_brightness({noConfigure: true}).toZigbee, tz.ZB006X_settings],
18
+ exposes: [e.light_brightness(),
19
+ exposes.enum('ext_switch_type', ea.STATE_SET, ['unknown', 'toggle_sw', 'momentary_sw', 'rotary_sw', 'auto_config'])
20
+ .withDescription('External switch type'),
21
+ exposes.enum('load_detection_mode', ea.STATE_SET, ['none', 'first_power_on', 'every_power_on'])
22
+ .withDescription('Load detection mode'),
23
+ exposes.enum('control_mode', ea.STATE_SET, ['local', 'remote', 'both']).withDescription('Control mode'),
24
+ ],
17
25
  configure: async (device, coordinatorEndpoint, logger) => {
18
26
  await extend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger);
19
27
  const endpoint = device.getEndpoint(1);
package/devices/feibit.js CHANGED
@@ -93,7 +93,7 @@ module.exports = [
93
93
  description: 'Combustible gas sensor',
94
94
  fromZigbee: [fz.ias_gas_alarm_2],
95
95
  toZigbee: [],
96
- exposes: [e.gas(), e.battery_low(), e.tamper()],
96
+ exposes: [e.gas()],
97
97
  },
98
98
  {
99
99
  zigbeeModel: ['FNB56-WTS05FB2.0'],
package/devices/heiman.js CHANGED
@@ -287,7 +287,7 @@ module.exports = [
287
287
  description: 'Smart motion sensor',
288
288
  fromZigbee: [fz.ias_occupancy_alarm_1],
289
289
  toZigbee: [],
290
- exposes: [e.occupancy(), e.battery_low(), e.tamper()],
290
+ exposes: [e.occupancy(), e.battery_low()],
291
291
  },
292
292
  {
293
293
  zigbeeModel: ['HT-EM', 'TH-EM', 'TH-T_V14'],
File without changes
package/devices/neo.js CHANGED
@@ -63,9 +63,15 @@ module.exports = [
63
63
  vendor: 'Neo',
64
64
  description: 'Motion, temperature & humidity sensor',
65
65
  fromZigbee: [fz.neo_nas_pd07],
66
- toZigbee: [],
66
+ toZigbee: [tz.neo_nas_pd07],
67
67
  onEvent: tuya.onEventSetTime,
68
68
  exposes: [e.occupancy(), e.humidity(), e.temperature(), e.tamper(), e.battery_low(),
69
- exposes.enum('power_type', ea.STATE, ['battery_full', 'battery_high', 'battery_medium', 'battery_low', 'usb'])],
69
+ exposes.enum('power_type', ea.STATE, ['battery_full', 'battery_high', 'battery_medium', 'battery_low', 'usb']),
70
+ exposes.enum('alarm', ea.STATE, ['over_temperature', 'over_humidity', 'below_min_temperature', 'below_min_humdity', 'off'])
71
+ .withDescription('Temperature/humidity alarm status'),
72
+ exposes.numeric('temperature_min', ea.STATE_SET).withUnit('°C').withValueMin(-40).withValueMax(40),
73
+ exposes.numeric('temperature_max', ea.STATE_SET).withUnit('°C').withValueMin(-40).withValueMax(40),
74
+ exposes.numeric('humidity_min', ea.STATE_SET).withUnit('%').withValueMin(0).withValueMax(100),
75
+ exposes.numeric('humidity_max', ea.STATE_SET).withUnit('%').withValueMin(0).withValueMax(100)],
70
76
  },
71
77
  ];
package/devices/orvibo.js CHANGED
@@ -7,7 +7,7 @@ const e = exposes.presets;
7
7
 
8
8
  module.exports = [
9
9
  {
10
- zigbeeModel: ['ORVIBO Socket'],
10
+ zigbeeModel: ['ORVIBO Socket', '93e29b89b2ee45bea5bdbb7679d75d24'],
11
11
  model: 'OR-ZB-S010-3C',
12
12
  vendor: 'ORVIBO',
13
13
  description: 'Smart socket',
@@ -73,17 +73,30 @@ module.exports = [
73
73
  model: '3321-S',
74
74
  vendor: 'SmartThings',
75
75
  description: 'Multi Sensor (2015 model)',
76
- fromZigbee: [fz.temperature, fz.ias_contact_alarm_1_report, fz.ias_contact_alarm_1, fz.battery],
76
+ fromZigbee: [fz.temperature, fz.ias_contact_alarm_1_report, fz.ias_contact_alarm_1, fz.battery, fz.smartthings_acceleration],
77
77
  toZigbee: [],
78
78
  meta: {battery: {voltageToPercentage: '3V_2100'}},
79
79
  configure: async (device, coordinatorEndpoint, logger) => {
80
80
  const endpoint = device.getEndpoint(1);
81
- await reporting.bind(endpoint, coordinatorEndpoint, ['msTemperatureMeasurement']);
82
- await endpoint.read('genPowerCfg', ['batteryVoltage']);
81
+ const options = {manufacturerCode: 0x104E};
82
+ await reporting.bind(endpoint, coordinatorEndpoint,
83
+ ['msTemperatureMeasurement', 'genPowerCfg', 'manuSpecificSamsungAccelerometer']);
83
84
  await reporting.temperature(endpoint);
84
85
  await reporting.batteryVoltage(endpoint);
86
+ const payloadA = reporting.payload('acceleration', 10, constants.repInterval.MINUTE, 1);
87
+ await endpoint.configureReporting('manuSpecificSamsungAccelerometer', payloadA, options);
88
+ const payloadX = reporting.payload('x_axis', 10, constants.repInterval.MINUTE, 1);
89
+ await endpoint.configureReporting('manuSpecificSamsungAccelerometer', payloadX, options);
90
+ const payloadY = reporting.payload('y_axis', 10, constants.repInterval.MINUTE, 1);
91
+ await endpoint.configureReporting('manuSpecificSamsungAccelerometer', payloadY, options);
92
+ const payloadZ = reporting.payload('z_axis', 10, constants.repInterval.MINUTE, 1);
93
+ await endpoint.configureReporting('manuSpecificSamsungAccelerometer', payloadZ, options);
94
+ // Has Unknown power source, force it.
95
+ device.powerSource = 'Battery';
96
+ device.save();
85
97
  },
86
- exposes: [e.temperature(), e.contact(), e.battery_low(), e.tamper(), e.battery()],
98
+ exposes: [e.temperature(), e.contact(), e.battery_low(), e.tamper(), e.battery(),
99
+ e.moving(), e.x_axis(), e.y_axis(), e.z_axis()],
87
100
  },
88
101
  {
89
102
  zigbeeModel: ['3200-Sgb'],
package/devices/tuya.js CHANGED
@@ -215,7 +215,7 @@ module.exports = [
215
215
  {
216
216
  fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3000_mvn6jl7x'},
217
217
  {modelID: 'TS011F', manufacturerName: '_TZ3000_raviyuvk'}, {modelID: 'TS011F', manufacturerName: '_TYZB01_hlla45kx'},
218
- {modelID: 'TS011F', manufacturerName: '_TZ3000_92qd4sqa'}],
218
+ {modelID: 'TS011F', manufacturerName: '_TZ3000_92qd4sqa'}, {modelID: 'TS011F', manufacturerName: '_TZ3000_zwaadvus'}],
219
219
  model: 'TS011F_2_gang_wall',
220
220
  vendor: 'TuYa',
221
221
  description: '2 gang wall outlet',
@@ -682,6 +682,7 @@ module.exports = [
682
682
  {modelID: 'TS0502B', manufacturerName: '_TZ3210_rm0hthdo'},
683
683
  {modelID: 'TS0502B', manufacturerName: '_TZ3210_zwqnazkb'},
684
684
  {modelID: 'TS0502B', manufacturerName: '_TZ3210_ijsj2evj'},
685
+ {modelID: 'TS0502B', manufacturerName: '_TZ3210_pgq2qvyv'},
685
686
  ],
686
687
  model: 'TS0502B',
687
688
  vendor: 'TuYa',
package/lib/reporting.js CHANGED
@@ -18,11 +18,17 @@ function payload(attribute, min, max, change, overrides) {
18
18
  return [payload];
19
19
  }
20
20
 
21
- async function readEletricalMeasurementMultiplierDivisors(endpoint) {
21
+ // Fix the problem that commit #3839 introduced.
22
+ // You can set readFrequencyAttrs = true if the device support acFrequencyDivisor and acFrequencyMultiplier
23
+ // See Develco.js SPLZB-132 for example
24
+ async function readEletricalMeasurementMultiplierDivisors(endpoint, readFrequencyAttrs = false) {
22
25
  // Split into three chunks, some devices fail to respond when reading too much attributes at once.
23
26
  await endpoint.read('haElectricalMeasurement', ['acVoltageMultiplier', 'acVoltageDivisor', 'acCurrentMultiplier']);
24
27
  await endpoint.read('haElectricalMeasurement', ['acCurrentDivisor', 'acPowerMultiplier', 'acPowerDivisor']);
25
- await endpoint.read('haElectricalMeasurement', ['acFrequencyDivisor', 'acFrequencyMultiplier']);
28
+ // Only read frequency multiplier/devisor when enabled as not all devices support this.
29
+ if (readFrequencyAttrs) {
30
+ await endpoint.read('haElectricalMeasurement', ['acFrequencyDivisor', 'acFrequencyMultiplier']);
31
+ }
26
32
  }
27
33
 
28
34
  async function readMeteringMultiplierDivisor(endpoint) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "14.0.473",
3
+ "version": "14.0.476",
4
4
  "description": "Collection of device converters to be used with zigbee-herdsman",
5
5
  "main": "index.js",
6
6
  "files": [