zigbee-herdsman-converters 14.0.391 → 14.0.395

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.
@@ -699,6 +699,8 @@ const converters = {
699
699
  */
700
700
  cluster: 'haElectricalMeasurement',
701
701
  type: ['attributeReport', 'readResponse'],
702
+ options: [exposes.options.calibration('power', 'percentual'), exposes.options.calibration('current', 'percentual'),
703
+ exposes.options.calibration('voltage', 'percentual')],
702
704
  convert: (model, msg, publish, options, meta) => {
703
705
  const getFactor = (key) => {
704
706
  const multiplier = msg.endpoint.getClusterAttributeValue('haElectricalMeasurement', `${key}Multiplier`);
@@ -724,7 +726,8 @@ const converters = {
724
726
  if (msg.data.hasOwnProperty(entry.key)) {
725
727
  const factor = getFactor(entry.factor);
726
728
  const property = postfixWithEndpointName(entry.name, msg, model);
727
- payload[property] = precisionRound(msg.data[entry.key] * factor, 2);
729
+ const value = msg.data[entry.key] * factor;
730
+ payload[property] = calibrateAndPrecisionRoundOptions(value, options, entry.name);
728
731
  }
729
732
  }
730
733
  return payload;
@@ -2498,6 +2501,30 @@ const converters = {
2498
2501
  }
2499
2502
  },
2500
2503
  },
2504
+ neo_alarm: {
2505
+ cluster: 'manuSpecificTuya',
2506
+ type: ['commandDataReport', 'commandDataResponse'],
2507
+ convert: (model, msg, publish, options, meta) => {
2508
+ const dpValue = tuya.firstDpValue(msg, meta, 'neo_alarm');
2509
+ const dp = dpValue.dp;
2510
+ const value = tuya.getDataValue(dpValue);
2511
+
2512
+ switch (dp) {
2513
+ case tuya.dataPoints.neoAOAlarm: // 0x13 [TRUE,FALSE]
2514
+ return {alarm: value};
2515
+ case tuya.dataPoints.neoAODuration: // 0x7 [0,0,0,10] duration alarm in second
2516
+ return {duration: value};
2517
+ case tuya.dataPoints.neoAOBattPerc: // 0x15 [0,0,0,100] battery percentage
2518
+ return {battpercentage: value};
2519
+ case tuya.dataPoints.neoAOMelody: // 0x21 [5] Melody
2520
+ return {melody: value};
2521
+ case tuya.dataPoints.neoAOVolume: // 0x5 [0]/[1]/[2] Volume 0-max, 2-low
2522
+ return {volume: {2: 'low', 1: 'medium', 0: 'high'}[value]};
2523
+ default: // Unknown code
2524
+ meta.logger.warn(`Unhandled DP #${dp}: ${JSON.stringify(msg.data)}`);
2525
+ }
2526
+ },
2527
+ },
2501
2528
  terncy_contact: {
2502
2529
  cluster: 'genBinaryInput',
2503
2530
  type: 'attributeReport',
@@ -5268,6 +5295,7 @@ const converters = {
5268
5295
  payload.gas_sensitivity = {1: '15%LEL', 2: '10%LEL'}[msg.data['268']];
5269
5296
  }
5270
5297
  }
5298
+ if (msg.data.hasOwnProperty('293')) payload.click_mode = {1: 'fast', 2: 'multi'}[msg.data['293']];
5271
5299
  if (msg.data.hasOwnProperty('294')) payload.mute = msg.data['294'] === 1; // JT-BZ-01AQ/A
5272
5300
  if (msg.data.hasOwnProperty('295')) payload.test = msg.data['295'] === 1; // JT-BZ-01AQ/A
5273
5301
  if (msg.data.hasOwnProperty('313')) payload.state = msg.data['313'] === 1 ? 'preparation' : 'work'; // JT-BZ-01AQ/A
@@ -7694,7 +7722,7 @@ const converters = {
7694
7722
  result = {tumble_switch: {false: 'OFF', true: 'ON'}[value]};
7695
7723
  break;
7696
7724
  case tuya.dataPoints.trsfFallDownStatus:
7697
- result = {fall_down_status: {0: false, 1: true}[value]};
7725
+ result = {fall_down_status: tuya.tuyaRadar.fallDown[value]};
7698
7726
  break;
7699
7727
  case tuya.dataPoints.trsfStaticDwellAlarm:
7700
7728
  result = {static_dwell_alarm: value};
@@ -7733,6 +7761,31 @@ const converters = {
7733
7761
  return result;
7734
7762
  },
7735
7763
  },
7764
+ matsee_garage_door_opener: {
7765
+ cluster: 'manuSpecificTuya',
7766
+ type: ['commandDataReport', 'raw'],
7767
+ convert: (model, msg, publish, options, meta) => {
7768
+ const result = {};
7769
+ for (const dpValue of msg.data.dpValues) {
7770
+ const value = tuya.getDataValue(dpValue);
7771
+ switch (dpValue.dp) {
7772
+ case tuya.dataPoints.garageDoorTrigger:
7773
+ result.action = 'trigger';
7774
+ break;
7775
+ case tuya.dataPoints.garageDoorContact:
7776
+ result.garage_door_contact = Boolean(!value);
7777
+ break;
7778
+ case tuya.dataPoints.garageDoorStatus:
7779
+ // This reports a garage door status (open, closed), but it is very naive and misleading
7780
+ break;
7781
+ default:
7782
+ meta.logger.debug(`zigbee-herdsman-converters:matsee_garage_door_opener: NOT RECOGNIZED ` +
7783
+ `DP #${dpValue.dp} with data ${JSON.stringify(dpValue)}`);
7784
+ }
7785
+ }
7786
+ return result;
7787
+ },
7788
+ },
7736
7789
  moes_thermostat_tv: {
7737
7790
  cluster: 'manuSpecificTuya',
7738
7791
  type: ['commandDataResponse', 'commandDataReport', 'raw'],
@@ -2333,6 +2333,12 @@ const converters = {
2333
2333
  tuya.sendDataPointRaw(entity, tuya.dataPoints.lidlTimer, tuya.convertDecimalValueTo4ByteHexArray(value));
2334
2334
  },
2335
2335
  },
2336
+ matsee_garage_door_opener: {
2337
+ key: ['trigger'],
2338
+ convertSet: (entity, key, value, meta) => {
2339
+ tuya.sendDataPointBool(entity, tuya.dataPoints.action, true);
2340
+ },
2341
+ },
2336
2342
  SPZ01_power_outage_memory: {
2337
2343
  key: ['power_outage_memory'],
2338
2344
  convertSet: async (entity, key, value, meta) => {
@@ -5074,6 +5080,32 @@ const converters = {
5074
5080
  }
5075
5081
  },
5076
5082
  },
5083
+ neo_alarm: {
5084
+ key: [
5085
+ 'alarm', 'melody', 'volume', 'duration',
5086
+ ],
5087
+ convertSet: async (entity, key, value, meta) => {
5088
+ switch (key) {
5089
+ case 'alarm':
5090
+ await tuya.sendDataPointBool(entity, tuya.dataPoints.neoAOAlarm, value);
5091
+ break;
5092
+ case 'melody':
5093
+ await tuya.sendDataPointEnum(entity, tuya.dataPoints.neoAOMelody, parseInt(value, 10));
5094
+ break;
5095
+ case 'volume':
5096
+ await tuya.sendDataPointEnum(
5097
+ entity,
5098
+ tuya.dataPoints.neoAOVolume,
5099
+ {'low': 2, 'medium': 1, 'high': 0}[value]);
5100
+ break;
5101
+ case 'duration':
5102
+ await tuya.sendDataPointValue(entity, tuya.dataPoints.neoAODuration, value);
5103
+ break;
5104
+ default: // Unknown key
5105
+ throw new Error(`Unhandled key ${key}`);
5106
+ }
5107
+ },
5108
+ },
5077
5109
  nous_lcd_temperature_humidity_sensor: {
5078
5110
  key: ['min_temperature', 'max_temperature', 'temperature_sensitivity', 'temperature_unit_convert'],
5079
5111
  convertSet: async (entity, key, value, meta) => {
@@ -6548,6 +6580,9 @@ const converters = {
6548
6580
  await entity.write('aqaraOpple', {0x0125: {value: lookupState[value], type: 0x20}}, manufacturerOptions.xiaomi);
6549
6581
  return {state: {click_mode: value}};
6550
6582
  },
6583
+ convertGet: async (entity, key, meta) => {
6584
+ await entity.read('aqaraOpple', [0x125], manufacturerOptions.xiaomi);
6585
+ },
6551
6586
  },
6552
6587
  tuya_light_wz5: {
6553
6588
  key: ['color', 'color_temp', 'brightness', 'white_brightness'],
@@ -332,4 +332,25 @@ module.exports = [
332
332
  },
333
333
  exposes: [e.soil_moisture(), e.battery(), e.illuminance(), e.temperature(), e.humidity()],
334
334
  },
335
+ {
336
+ zigbeeModel: ['EFEKTA_PWS_MaxPro'],
337
+ model: 'EFEKTA_PWS_MaxPro',
338
+ vendor: 'Custom devices (DiY)',
339
+ description: '[Plant watering sensor EFEKTA PWS Max Pro, long battery life](http://efektalab.com/PWS_MaxPro)',
340
+ fromZigbee: [fz.temperature, fz.humidity, fz.illuminance, fz.soil_moisture, fz.battery],
341
+ toZigbee: [tz.factory_reset],
342
+ configure: async (device, coordinatorEndpoint, logger) => {
343
+ const firstEndpoint = device.getEndpoint(1);
344
+ await reporting.bind(firstEndpoint, coordinatorEndpoint, [
345
+ 'genPowerCfg', 'msTemperatureMeasurement', 'msRelativeHumidity', 'msIlluminanceMeasurement', 'msSoilMoisture']);
346
+ const overides = {min: 0, max: 21600, change: 0};
347
+ await reporting.batteryVoltage(firstEndpoint, overides);
348
+ await reporting.batteryPercentageRemaining(firstEndpoint, overides);
349
+ await reporting.temperature(firstEndpoint, overides);
350
+ await reporting.humidity(firstEndpoint, overides);
351
+ await reporting.illuminance(firstEndpoint, overides);
352
+ await reporting.soil_moisture(firstEndpoint, overides);
353
+ },
354
+ exposes: [e.soil_moisture(), e.battery(), e.illuminance(), e.temperature(), e.humidity()],
355
+ },
335
356
  ];
@@ -5,6 +5,7 @@ const reporting = require('../lib/reporting');
5
5
  const extend = require('../lib/extend');
6
6
  const e = exposes.presets;
7
7
  const ea = exposes.access;
8
+ const ota = require('../lib/ota');
8
9
 
9
10
  const readInitialBatteryState = async (type, data, device) => {
10
11
  if (['deviceAnnounce'].includes(type)) {
@@ -63,6 +64,7 @@ module.exports = [
63
64
  fromZigbee: [fz.identify, fz.ignore_basic_report, fz.command_cover_open, fz.command_cover_close, fz.command_cover_stop, fz.battery,
64
65
  fz.legrand_binary_input_moving],
65
66
  toZigbee: [],
67
+ ota: ota.zigbeeOTA,
66
68
  exposes: [e.battery(), e.action(['identify', 'open', 'close', 'stop', 'moving', 'stopped'])],
67
69
  configure: async (device, coordinatorEndpoint, logger) => {
68
70
  const endpoint = device.getEndpoint(1);
@@ -182,6 +184,7 @@ module.exports = [
182
184
  zigbeeModel: [' Connected outlet\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000'],
183
185
  model: '067775/741811',
184
186
  vendor: 'Legrand',
187
+ ota: ota.zigbeeOTA,
185
188
  description: 'Power socket with power consumption monitoring',
186
189
  fromZigbee: [fz.identify, fz.on_off, fz.electrical_measurement],
187
190
  toZigbee: [tz.on_off, tz.legrand_settingAlwaysEnableLed, tz.legrand_identify],
@@ -200,6 +203,7 @@ module.exports = [
200
203
  vendor: 'Legrand',
201
204
  description: 'Wired micromodule switch',
202
205
  extend: extend.switch(),
206
+ ota: ota.zigbeeOTA,
203
207
  fromZigbee: [fz.identify, fz.on_off],
204
208
  toZigbee: [tz.on_off, tz.legrand_identify],
205
209
  configure: async (device, coordinatorEndpoint, logger) => {
package/devices/lg.js ADDED
@@ -0,0 +1,18 @@
1
+ const extend = require('../lib/extend');
2
+
3
+ module.exports = [
4
+ {
5
+ zigbeeModel: ['B1027EB0Z01'],
6
+ model: 'B1027EB0Z01',
7
+ vendor: 'LG Electronics',
8
+ description: 'Smart bulb 1',
9
+ extend: extend.light_onoff_brightness(),
10
+ },
11
+ {
12
+ zigbeeModel: ['B1027EB0Z02'],
13
+ model: 'B1027EB0Z02',
14
+ vendor: 'LG Electronics',
15
+ description: 'Smart bulb 2',
16
+ extend: extend.light_onoff_brightness(),
17
+ },
18
+ ];
@@ -0,0 +1,31 @@
1
+ const fz = require('../converters/fromZigbee');
2
+ const exposes = require('../lib/exposes');
3
+ const reporting = require('../lib/reporting');
4
+ const extend = require('../lib/extend');
5
+ const e = exposes.presets;
6
+ const ea = exposes.access;
7
+
8
+
9
+ module.exports = [
10
+ {
11
+ zigbeeModel: ['SZ1000'],
12
+ model: 'ZB250',
13
+ vendor: 'Micro Matic Norge AS',
14
+ description: 'Zigbee dimmer for LED',
15
+ fromZigbee: extend.light_onoff_brightness().fromZigbee.concat([fz.electrical_measurement, fz.metering]),
16
+ toZigbee: extend.light_onoff_brightness().toZigbee,
17
+ configure: async (device, coordinatorEndpoint, logger) => {
18
+ await extend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger);
19
+ const endpoint = device.getEndpoint(1);
20
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl', 'haElectricalMeasurement', 'seMetering']);
21
+ await reporting.brightness(endpoint);
22
+ await reporting.readEletricalMeasurementMultiplierDivisors(endpoint);
23
+ await reporting.rmsVoltage(endpoint, {min: 10, change: 20}); // Voltage - Min change of 2V
24
+ await reporting.rmsCurrent(endpoint, {min: 10, change: 10}); // A - z2m displays only the first decimals, change of 10 / 0,01A
25
+ await reporting.activePower(endpoint, {min: 10, change: 15}); // W - Min change of 1,5W
26
+ await reporting.currentSummDelivered(endpoint, {min: 300}); // Report KWH every 5min
27
+ },
28
+ exposes: [e.light_brightness(), e.power(), e.current(), e.voltage().withAccess(ea.STATE), e.energy()],
29
+ },
30
+ ];
31
+
package/devices/neo.js CHANGED
@@ -34,6 +34,29 @@ module.exports = [
34
34
  await endpoint.command('manuSpecificTuya', 'mcuVersionRequest', {'seq': 0x0002});
35
35
  },
36
36
  },
37
+ {
38
+ fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_t1blo2bj'}],
39
+ zigbeeModel: ['1blo2bj'],
40
+ model: 'NAS-AB02B2',
41
+ vendor: 'Neo',
42
+ description: 'Alarm',
43
+ fromZigbee: [fz.neo_alarm, fz.ignore_basic_report],
44
+ toZigbee: [tz.neo_alarm],
45
+ exposes: [
46
+ e.battery_low(),
47
+ exposes.binary('alarm', ea.STATE_SET, true, false),
48
+ exposes.enum('melody', ea.STATE_SET, Array.from(Array(18).keys()).map((x)=>(x+1).toString())),
49
+ exposes.numeric('duration', ea.STATE_SET).withUnit('second').withValueMin(0).withValueMax(1800),
50
+ exposes.enum('volume', ea.STATE_SET, ['low', 'medium', 'high']),
51
+ exposes.numeric('battpercentage', ea.STATE).withUnit('%'),
52
+ ],
53
+ onEvent: tuya.onEventSetLocalTime,
54
+ configure: async (device, coordinatorEndpoint, logger) => {
55
+ const endpoint = device.getEndpoint(1);
56
+ await endpoint.command('manuSpecificTuya', 'dataQuery', {});
57
+ await endpoint.command('manuSpecificTuya', 'mcuVersionRequest', {'seq': 0x0002});
58
+ },
59
+ },
37
60
  {
38
61
  fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_7hfcudw5'}],
39
62
  model: 'NAS-PD07',
@@ -29,6 +29,13 @@ const hueExtend = {
29
29
  };
30
30
 
31
31
  module.exports = [
32
+ {
33
+ zigbeeModel: ['929003055801'],
34
+ model: '929003055801',
35
+ vendor: 'Philips',
36
+ description: 'Hue white ambiance bathroom ceiling light Adore with Bluetooth',
37
+ extend: extend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
38
+ },
32
39
  {
33
40
  zigbeeModel: ['929003056901'],
34
41
  model: '929003056901',
@@ -66,7 +73,7 @@ module.exports = [
66
73
  ota: ota.zigbeeOTA,
67
74
  },
68
75
  {
69
- zigbeeModel: ['915005996401'],
76
+ zigbeeModel: ['915005996401', '915005996501'],
70
77
  model: '915005996401',
71
78
  vendor: 'Philips',
72
79
  description: 'Hue white ambiance ceiling light Enrave S with Bluetooth',
@@ -261,7 +268,7 @@ module.exports = [
261
268
  ota: ota.zigbeeOTA,
262
269
  },
263
270
  {
264
- zigbeeModel: ['LLC012', 'LLC011'],
271
+ zigbeeModel: ['LLC012', 'LLC011', 'LLC013'],
265
272
  model: '7299760PH',
266
273
  vendor: 'Philips',
267
274
  description: 'Hue Bloom',
@@ -494,6 +501,15 @@ module.exports = [
494
501
  extend: hueExtend.light_onoff_brightness(),
495
502
  ota: ota.zigbeeOTA,
496
503
  },
504
+ {
505
+ zigbeeModel: ['1746630V7'],
506
+ model: '1746630V7',
507
+ vendor: 'Philips',
508
+ description: 'Amarant linear outdoor light',
509
+ meta: {turnsOffAtBrightness1: true},
510
+ extend: hueExtend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
511
+ ota: ota.zigbeeOTA,
512
+ },
497
513
  {
498
514
  zigbeeModel: ['LCC001'],
499
515
  model: '4090531P7',
@@ -1005,7 +1021,7 @@ module.exports = [
1005
1021
  ota: ota.zigbeeOTA,
1006
1022
  },
1007
1023
  {
1008
- zigbeeModel: ['3417931P6'],
1024
+ zigbeeModel: ['3417931P6', '929003056201'],
1009
1025
  model: '3417931P6',
1010
1026
  vendor: 'Philips',
1011
1027
  description: 'Hue white ambiance Adore GU10 with Bluetooth (2 spots)',
@@ -2627,4 +2643,13 @@ module.exports = [
2627
2643
  extend: hueExtend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
2628
2644
  ota: ota.zigbeeOTA,
2629
2645
  },
2646
+ {
2647
+ zigbeeModel: ['929003045001_01', '929003045001_02', '929003045001_03'],
2648
+ model: '9290019533',
2649
+ vendor: 'Philips',
2650
+ description: 'Hue white ambiance GU10 with Bluetooth',
2651
+ meta: {turnsOffAtBrightness1: true},
2652
+ extend: extend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
2653
+ ota: ota.zigbeeOTA,
2654
+ },
2630
2655
  ];
@@ -0,0 +1,20 @@
1
+ const reporting = require('../lib/reporting');
2
+ const extend = require('../lib/extend');
3
+
4
+ module.exports = [
5
+ {
6
+ zigbeeModel: ['12501'],
7
+ model: '12501',
8
+ vendor: 'Scan Products',
9
+ description: 'Zigbee push dimmer',
10
+ fromZigbee: extend.light_onoff_brightness().fromZigbee,
11
+ toZigbee: extend.light_onoff_brightness().toZigbee,
12
+ extend: extend.light_onoff_brightness({noConfigure: true}),
13
+ configure: async (device, coordinatorEndpoint, logger) => {
14
+ await extend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger);
15
+ const endpoint = device.getEndpoint(1);
16
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl']);
17
+ await reporting.onOff(endpoint);
18
+ },
19
+ },
20
+ ];
@@ -37,6 +37,22 @@ module.exports = [
37
37
  endpoint.saveClusterAttributeKeyValue('seMetering', {divisor: 1000000, multiplier: 1});
38
38
  },
39
39
  },
40
+ {
41
+ zigbeeModel: ['SZ-ESW02'],
42
+ model: 'SZ-ESW02',
43
+ vendor: 'Sercomm',
44
+ description: 'Telstra smart plug 2',
45
+ fromZigbee: [fz.on_off, fz.metering],
46
+ exposes: [e.switch(), e.power()],
47
+ toZigbee: [tz.on_off],
48
+ configure: async (device, coordinatorEndpoint, logger) => {
49
+ const endpoint = device.getEndpoint(1);
50
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'seMetering']);
51
+ await reporting.onOff(endpoint);
52
+ await reporting.instantaneousDemand(endpoint);
53
+ endpoint.saveClusterAttributeKeyValue('seMetering', {divisor: 1000000, multiplier: 1});
54
+ },
55
+ },
40
56
  {
41
57
  zigbeeModel: ['XHS2-SE'],
42
58
  model: 'XHS2-SE',
@@ -46,7 +46,7 @@ module.exports = [
46
46
  toZigbee: [tz.tuya_dimmer_state, tz.tuya_light_wz5],
47
47
  exposes: [
48
48
  exposes.light().withBrightness().setAccess('state', ea.STATE_SET).setAccess('brightness',
49
- ea.STATE_SET).withColor('hs'),
49
+ ea.STATE_SET).withColor(['hs']),
50
50
  ],
51
51
  },
52
52
  {
@@ -61,7 +61,7 @@ module.exports = [
61
61
  toZigbee: [tz.tuya_dimmer_state, tz.tuya_light_wz5],
62
62
  exposes: [
63
63
  exposes.light().withBrightness().setAccess('state', ea.STATE_SET).setAccess('brightness',
64
- ea.STATE_SET).withColor('hs'),
64
+ ea.STATE_SET).withColor(['hs']),
65
65
  exposes.numeric('white_brightness', ea.STATE_SET).withValueMin(0).withValueMax(254).withDescription(
66
66
  'White brightness of this light'),
67
67
  ],
@@ -79,7 +79,7 @@ module.exports = [
79
79
  toZigbee: [tz.tuya_dimmer_state, tz.tuya_light_wz5],
80
80
  exposes: [
81
81
  exposes.light().withBrightness().setAccess('state', ea.STATE_SET).setAccess('brightness',
82
- ea.STATE_SET).withColor('hs').withColorTemp([250, 454]).setAccess('color_temp',
82
+ ea.STATE_SET).withColor(['hs']).withColorTemp([250, 454]).setAccess('color_temp',
83
83
  ea.STATE_SET),
84
84
  exposes.numeric('white_brightness', ea.STATE_SET).withValueMin(0).withValueMax(254).withDescription(
85
85
  'White brightness of this light'),
package/devices/tuya.js CHANGED
@@ -206,7 +206,8 @@ module.exports = [
206
206
  {modelID: 'TS0501B', manufacturerName: '_TZ3210_4whigl8i'},
207
207
  {modelID: 'TS0501B', manufacturerName: '_TZ3210_9q49basr'},
208
208
  {modelID: 'TS0501B', manufacturerName: '_TZ3210_grnwgegn'},
209
- {modelID: 'TS0501B', manufacturerName: '_TZ3210_wuheofsg'}],
209
+ {modelID: 'TS0501B', manufacturerName: '_TZ3210_wuheofsg'},
210
+ {modelID: 'TS0501B', manufacturerName: '_TZ3210_e5t9bfdv'}],
210
211
  model: 'TS0501B',
211
212
  description: 'Zigbee light',
212
213
  vendor: 'TuYa',
@@ -509,6 +510,7 @@ module.exports = [
509
510
  {modelID: 'TS0502B', manufacturerName: '_TZ3000_zw7wr5uo'},
510
511
  {modelID: 'TS0502B', manufacturerName: '_TZ3210_pz9zmxjj'},
511
512
  {modelID: 'TS0502B', manufacturerName: '_TZ3000_fzwhym79'},
513
+ {modelID: 'TS0502B', manufacturerName: '_TZ3210_rm0hthdo'},
512
514
  ],
513
515
  model: 'TS0502B',
514
516
  vendor: 'TuYa',
@@ -839,6 +841,7 @@ module.exports = [
839
841
  {modelID: 'TS0601', manufacturerName: '_TZE200_sbordckq'},
840
842
  {modelID: 'TS0601', manufacturerName: '_TZE200_fctwhugx'},
841
843
  {modelID: 'TS0601', manufacturerName: '_TZE200_zah67ekd'},
844
+ {modelID: 'TS0601', manufacturerName: '_TZE200_hsgrhjpf'},
842
845
  // Window pushers:
843
846
  {modelID: 'TS0601', manufacturerName: '_TZE200_g5wdnuow'},
844
847
  // Tubular motors:
@@ -1663,6 +1666,21 @@ module.exports = [
1663
1666
  e.energy(), exposes.enum('power_outage_memory', ea.STATE_SET, ['on', 'off', 'restore'])
1664
1667
  .withDescription('Recover state after power outage')],
1665
1668
  },
1669
+ {
1670
+ fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_nklqjk62'}],
1671
+ model: 'PJ-ZGD01',
1672
+ vendor: 'TuYa',
1673
+ description: 'Garage door opener',
1674
+ fromZigbee: [fz.matsee_garage_door_opener, fz.ignore_basic_report],
1675
+ toZigbee: [tz.matsee_garage_door_opener, tz.tuya_data_point_test],
1676
+ whiteLabel: [{vendor: 'MatSee Plus', model: 'PJ-ZGD01'}],
1677
+ configure: async (device, coordinatorEndpoint, logger) => {
1678
+ const endpoint = device.getEndpoint(1);
1679
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genBasic']);
1680
+ },
1681
+ exposes: [exposes.binary('trigger', ea.STATE_SET, true, false).withDescription('Trigger the door movement'),
1682
+ e.action(['trigger']), exposes.binary('garage_door_contact', ea.STATE, true, false)],
1683
+ },
1666
1684
  {
1667
1685
  fingerprint: [{modelID: 'TS0201', manufacturerName: '_TZ3000_qaaysllp'}],
1668
1686
  model: 'LCZ030',
@@ -1755,7 +1773,8 @@ module.exports = [
1755
1773
  .withDescription('fall sensitivity of the radar'),
1756
1774
  exposes.numeric('tumble_alarm_time', ea.STATE_SET).withValueMin(1).withValueMax(5).withValueStep(1)
1757
1775
  .withUnit('min').withDescription('tumble alarm time'),
1758
- exposes.binary('fall_down_status', ea.STATE).withDescription('fall down status'),
1776
+ exposes.enum('fall_down_status', ea.STATE, Object.values(tuya.tuyaRadar.fallDown))
1777
+ .withDescription('fall down status'),
1759
1778
  exposes.text('static_dwell_alarm', ea.STATE).withDescription('static dwell alarm'),
1760
1779
  ],
1761
1780
  configure: async (device, coordinatorEndpoint, logger) => {
@@ -22,6 +22,21 @@ module.exports = [
22
22
  return {'l1': 1, 'l2': 2, 'l3': 3, 'l4': 4, 'l5': 5};
23
23
  },
24
24
  },
25
+ {
26
+ fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3000_cfnprab5'}],
27
+ model: 'SM-0306E-2W',
28
+ vendor: 'UseeLink',
29
+ description: '4 gang switch, with USB',
30
+ exposes: [e.switch().withEndpoint('l1'), e.switch().withEndpoint('l2'), e.switch().withEndpoint('l3'),
31
+ e.switch().withEndpoint('l4'), e.switch().withEndpoint('l5')],
32
+ extend: extend.switch(),
33
+ meta: {multiEndpoint: true},
34
+ configure: async (device, coordinatorEndpoint, logger) => {
35
+ for (const ID of [1, 2, 3, 4, 5]) {
36
+ await reporting.bind(device.getEndpoint(ID), coordinatorEndpoint, ['genOnOff']);
37
+ }
38
+ },
39
+ },
25
40
  {
26
41
  fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3000_tvuarksa'}],
27
42
  model: 'SM-AZ713',
package/devices/xiaomi.js CHANGED
@@ -1448,6 +1448,7 @@ module.exports = [
1448
1448
  await reporting.onOff(endpoint);
1449
1449
  await reporting.deviceTemperature(endpoint);
1450
1450
  device.powerSource = 'Mains (single phase)';
1451
+ device.type = 'Router';
1451
1452
  device.save();
1452
1453
  },
1453
1454
  },
@@ -1654,6 +1655,7 @@ module.exports = [
1654
1655
  const payload = reporting.payload('presentValue', 10, constants.repInterval.HOUR, 5);
1655
1656
  await endpoint.configureReporting('genAnalogInput', payload);
1656
1657
  },
1658
+ ota: ota.zigbeeOTA,
1657
1659
  },
1658
1660
  {
1659
1661
  zigbeeModel: ['lumi.switch.b2nc01'],
@@ -1837,7 +1839,7 @@ module.exports = [
1837
1839
  fromZigbee: [fz.xiaomi_multistate_action, fz.aqara_opple],
1838
1840
  toZigbee: [tz.xiaomi_switch_click_mode],
1839
1841
  exposes: [e.battery(), e.battery_voltage(), e.action(['single', 'double', 'hold']),
1840
- exposes.enum('click_mode', ea.SET, ['fast', 'multi'])
1842
+ exposes.enum('click_mode', ea.ALL, ['fast', 'multi'])
1841
1843
  .withDescription('Click mode, fast: only supports single click which will be send immediately after clicking.' +
1842
1844
  'multi: supports more events like double and hold')],
1843
1845
  configure: async (device, coordinatorEndpoint, logger) => {
@@ -1853,7 +1855,7 @@ module.exports = [
1853
1855
  exposes: [e.battery(), e.battery_voltage(),
1854
1856
  e.action(['single_left', 'single_right', 'single_both', 'double_left', 'double_right', 'hold_left', 'hold_right']),
1855
1857
  // eslint-disable-next-line max-len
1856
- exposes.enum('click_mode', ea.SET, ['fast', 'multi']).withDescription('Click mode, fast: only supports single click which will be send immediately after clicking, multi: supports more events like double and hold'),
1858
+ exposes.enum('click_mode', ea.ALL, ['fast', 'multi']).withDescription('Click mode, fast: only supports single click which will be send immediately after clicking, multi: supports more events like double and hold'),
1857
1859
  ],
1858
1860
  fromZigbee: [fz.xiaomi_multistate_action, fz.aqara_opple],
1859
1861
  toZigbee: [tz.xiaomi_switch_click_mode],
@@ -1864,4 +1866,23 @@ module.exports = [
1864
1866
  await endpoint1.write('aqaraOpple', {0x0125: {value: 0x02, type: 0x20}}, {manufacturerCode: 0x115f});
1865
1867
  },
1866
1868
  },
1869
+ {
1870
+ zigbeeModel: ['lumi.remote.b18ac1'],
1871
+ model: 'WXKG14LM',
1872
+ vendor: 'Xiaomi',
1873
+ description: 'Aqara wireless remote switch H1 (single rocker)',
1874
+ fromZigbee: [fz.xiaomi_multistate_action, fz.aqara_opple],
1875
+ toZigbee: [tz.xiaomi_switch_click_mode, tz.aqara_opple_operation_mode],
1876
+ exposes: [e.battery(), e.battery_voltage(), e.action(['single', 'double', 'triple', 'hold']),
1877
+ exposes.enum('click_mode', ea.ALL, ['fast', 'multi'])
1878
+ .withDescription('Click mode, fast: only supports single click which will be send immediately after clicking.' +
1879
+ 'multi: supports more events like double and hold'),
1880
+ exposes.enum('operation_mode', ea.ALL, ['command', 'event'])
1881
+ .withDescription('Operation mode, select "command" to enable bindings (wake up the device before changing modes!)')],
1882
+ configure: async (device, coordinatorEndpoint, logger) => {
1883
+ const endpoint1 = device.getEndpoint(1);
1884
+ await endpoint1.write('aqaraOpple', {'mode': 1}, {manufacturerCode: 0x115f, disableResponse: true});
1885
+ await endpoint1.read('aqaraOpple', [0x0125], {manufacturerCode: 0x115f});
1886
+ },
1887
+ },
1867
1888
  ];
package/lib/exposes.js CHANGED
@@ -294,20 +294,22 @@ class Light extends Base {
294
294
 
295
295
  withColor(types) {
296
296
  assert(!this.endpoint, 'Cannot add feature after adding endpoint');
297
- if (types.includes('xy')) {
298
- const colorXY = new Composite('color_xy', 'color')
299
- .withFeature(new Numeric('x', access.ALL))
300
- .withFeature(new Numeric('y', access.ALL))
301
- .withDescription('Color of this light in the CIE 1931 color space (x/y)');
302
- this.features.push(colorXY);
303
- }
304
-
305
- if (types.includes('hs')) {
306
- const colorHS = new Composite('color_hs', 'color')
307
- .withFeature(new Numeric('hue', access.ALL))
308
- .withFeature(new Numeric('saturation', access.ALL))
309
- .withDescription('Color of this light expressed as hue/saturation');
310
- this.features.push(colorHS);
297
+ for (const type of types) {
298
+ if (type === 'xy') {
299
+ const colorXY = new Composite('color_xy', 'color')
300
+ .withFeature(new Numeric('x', access.ALL))
301
+ .withFeature(new Numeric('y', access.ALL))
302
+ .withDescription('Color of this light in the CIE 1931 color space (x/y)');
303
+ this.features.push(colorXY);
304
+ } else if (type === 'hs') {
305
+ const colorHS = new Composite('color_hs', 'color')
306
+ .withFeature(new Numeric('hue', access.ALL))
307
+ .withFeature(new Numeric('saturation', access.ALL))
308
+ .withDescription('Color of this light expressed as hue/saturation');
309
+ this.features.push(colorHS);
310
+ } else {
311
+ assert(false, `Unsupported color type ${type}`);
312
+ }
311
313
  }
312
314
 
313
315
  return this;
@@ -547,10 +549,10 @@ module.exports = {
547
549
  keypad_lockout: () => new Enum('keypad_lockout', access.ALL, ['unlock', 'lock1', 'lock2']).withDescription('Enables/disables physical input on the device'),
548
550
  led_disabled_night: () => new Binary('led_disabled_night', access.ALL, true, false).withDescription('Enable/disable the LED at night'),
549
551
  light_brightness: () => new Light().withBrightness(),
550
- light_brightness_color: () => new Light().withBrightness().withColor((['xy', 'hs'])),
552
+ light_brightness_color: (preferHS) => new Light().withBrightness().withColor((preferHS ? ['hs', 'xy'] : ['xy', 'hs'])),
551
553
  light_brightness_colorhs: () => new Light().withBrightness().withColor(['hs']),
552
554
  light_brightness_colortemp: (colorTempRange) => new Light().withBrightness().withColorTemp(colorTempRange).withColorTempStartup(colorTempRange),
553
- light_brightness_colortemp_color: (colorTempRange) => new Light().withBrightness().withColorTemp(colorTempRange).withColorTempStartup(colorTempRange).withColor(['xy', 'hs']),
555
+ light_brightness_colortemp_color: (colorTempRange, preferHS) => new Light().withBrightness().withColorTemp(colorTempRange).withColorTempStartup(colorTempRange).withColor(preferHS ? ['hs', 'xy'] : ['xy', 'hs']),
554
556
  light_brightness_colortemp_colorhs: (colorTempRange) => new Light().withBrightness().withColorTemp(colorTempRange).withColorTempStartup(colorTempRange).withColor(['hs']),
555
557
  light_brightness_colortemp_colorxy: (colorTempRange) => new Light().withBrightness().withColorTemp(colorTempRange).withColorTempStartup(colorTempRange).withColor(['xy']),
556
558
  light_brightness_colorxy: () => new Light().withBrightness().withColor((['xy'])),
package/lib/extend.js CHANGED
@@ -50,8 +50,8 @@ const extend = {
50
50
  return result;
51
51
  },
52
52
  light_onoff_brightness_color: (options={}) => {
53
- options = {disableEffect: false, supportsHS: false, ...options};
54
- const exposes = [(options.supportsHS ? e.light_brightness_color() : e.light_brightness_colorxy()),
53
+ options = {disableEffect: false, supportsHS: false, preferHS: false, ...options};
54
+ const exposes = [(options.supportsHS ? e.light_brightness_color(options.preferHS) : e.light_brightness_colorxy()),
55
55
  ...(!options.disableEffect ? [e.effect()] : [])];
56
56
  const fromZigbee = [fz.color_colortemp, fz.on_off, fz.brightness, fz.level_config, fz.power_on_behavior, fz.ignore_basic_report];
57
57
  const toZigbee = [tz.light_onoff_brightness, tz.light_color, tz.ignore_transition, tz.ignore_rate, tz.light_brightness_move,
@@ -66,8 +66,8 @@ const extend = {
66
66
  };
67
67
  },
68
68
  light_onoff_brightness_colortemp_color: (options={}) => {
69
- options = {disableEffect: false, supportsHS: false, disableColorTempStartup: false, ...options};
70
- const exposes = [(options.supportsHS ? e.light_brightness_colortemp_color(options.colorTempRange) :
69
+ options = {disableEffect: false, supportsHS: false, disableColorTempStartup: false, preferHS: false, ...options};
70
+ const exposes = [(options.supportsHS ? e.light_brightness_colortemp_color(options.colorTempRange, options.preferHS) :
71
71
  e.light_brightness_colortemp_colorxy(options.colorTempRange)), ...(!options.disableEffect ? [e.effect()] : [])];
72
72
  const fromZigbee = [fz.color_colortemp, fz.on_off, fz.brightness, fz.level_config, fz.power_on_behavior, fz.ignore_basic_report];
73
73
  const toZigbee = [
package/lib/tuya.js CHANGED
@@ -314,6 +314,12 @@ const dataPoints = {
314
314
  neoHumidityAlarm: 114,
315
315
  neoUnknown3: 115,
316
316
  neoVolume: 116,
317
+ // Neo AlarmOnly
318
+ neoAOBattPerc: 15,
319
+ neoAOMelody: 21,
320
+ neoAODuration: 7,
321
+ neoAOAlarm: 13,
322
+ neoAOVolume: 5,
317
323
  // Saswell TRV
318
324
  saswellHeating: 3,
319
325
  saswellWindowDetection: 8,
@@ -565,6 +571,10 @@ const dataPoints = {
565
571
  AM02Border: 16,
566
572
  AM02MotorWorkingMode: 20,
567
573
  AM02AddRemoter: 101,
574
+ // Matsee Tuya Garage Door Opener
575
+ garageDoorTrigger: 1,
576
+ garageDoorContact: 3,
577
+ garageDoorStatus: 12,
568
578
  };
569
579
 
570
580
  const thermostatWeekFormat = {
@@ -644,6 +654,11 @@ const tuyaRadar = {
644
654
  1: 'moving_forward',
645
655
  2: 'moving_backward',
646
656
  },
657
+ fallDown: {
658
+ 0: 'none',
659
+ 1: 'maybe_fall',
660
+ 2: 'fall',
661
+ },
647
662
  };
648
663
 
649
664
  // Motion sensor lookups
package/lib/utils.js CHANGED
@@ -72,12 +72,12 @@ function hasAlreadyProcessedMessage(msg, ID=null, key=null) {
72
72
  return false;
73
73
  }
74
74
 
75
- const defaultPrecision = {temperature: 2, humidity: 2, pressure: 1, pm25: 0};
75
+ const defaultPrecision = {temperature: 2, humidity: 2, pressure: 1, pm25: 0, power: 2, voltage: 2, current: 2};
76
76
  function calibrateAndPrecisionRoundOptions(number, options, type) {
77
77
  // Calibrate
78
78
  const calibrateKey = `${type}_calibration`;
79
79
  let calibrationOffset = options && options.hasOwnProperty(calibrateKey) ? options[calibrateKey] : 0;
80
- if (type == 'illuminance' || type === 'illuminance_lux') {
80
+ if (['illuminance', 'illuminance_lux', 'power', 'current', 'voltage'].includes(type)) {
81
81
  // linear calibration because measured value is zero based
82
82
  // +/- percent
83
83
  calibrationOffset = Math.round(number * calibrationOffset / 100);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "14.0.391",
3
+ "version": "14.0.395",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "14.0.391",
3
+ "version": "14.0.395",
4
4
  "description": "Collection of device converters to be used with zigbee-herdsman",
5
5
  "main": "index.js",
6
6
  "files": [