zigbee-herdsman-converters 14.0.324 → 14.0.328

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.
@@ -128,6 +128,10 @@ const converters = {
128
128
  value = value < -250 ? 0 : value;
129
129
  result[postfixWithEndpointName('abs_max_heat_setpoint_limit', msg, model)] = value;
130
130
  }
131
+ if (msg.data.hasOwnProperty('acLouverPosition')) {
132
+ result[postfixWithEndpointName('ac_louver_position', msg, model)] =
133
+ constants.thermostatAcLouverPositions[msg.data['acLouverPosition']];
134
+ }
131
135
  return result;
132
136
  },
133
137
  },
@@ -4862,7 +4866,7 @@ const converters = {
4862
4866
  }
4863
4867
  },
4864
4868
  },
4865
- xiaomi_switch_opple_basic: {
4869
+ aqara_opple: {
4866
4870
  cluster: 'aqaraOpple',
4867
4871
  type: ['attributeReport', 'readResponse'],
4868
4872
  options: [exposes.options.precision('temperature'), exposes.options.calibration('temperature')],
@@ -4872,11 +4876,9 @@ const converters = {
4872
4876
  const data = msg.data['247'];
4873
4877
  // Xiaomi struct parsing
4874
4878
  const length = data.length;
4875
- // if (meta.logger) meta.logger.debug(`${model.zigbeeModel}: Xiaomi struct: length ${length}`);
4876
4879
  for (let i=0; i < length; i++) {
4877
4880
  const index = data[i];
4878
4881
  let value = null;
4879
- // if (meta.logger) meta.logger.debug(`${model.zigbeeModel}: pos=${i}, ind=${data[i]}, vtype=${data[i+1]}`);
4880
4882
  switch (data[i+1]) {
4881
4883
  case 16:
4882
4884
  // 0x10 ZclBoolean
@@ -4936,7 +4938,11 @@ const converters = {
4936
4938
  default:
4937
4939
  if (meta.logger) meta.logger.debug(`${model.zigbeeModel}: unknown vtype=${data[i+1]}, pos=${i+1}`);
4938
4940
  }
4939
- if (index === 3) payload.temperature = calibrateAndPrecisionRoundOptions(value, options, 'temperature'); // 0x03
4941
+
4942
+ if (index == 1) {
4943
+ payload.voltage = value;
4944
+ payload.battery = batteryVoltageToPercentage(value, '3V_2100');
4945
+ } else if (index === 3) payload.temperature = calibrateAndPrecisionRoundOptions(value, options, 'temperature'); // 0x03
4940
4946
  else if (index === 100) payload.state = value === 1 ? 'ON' : 'OFF'; // 0x64
4941
4947
  else if (index === 149) {
4942
4948
  payload.energy = precisionRound(value, 2); // 0x95
@@ -4948,34 +4954,26 @@ const converters = {
4948
4954
  else if (meta.logger) meta.logger.debug(`${model.zigbeeModel}: unknown index ${index} with value ${value}`);
4949
4955
  }
4950
4956
  }
4951
- if (msg.data.hasOwnProperty('4')) {
4952
- const lookup = {4: 'anti_flicker_mode', 1: 'quick_mode'};
4953
- payload.mode_switch = lookup[msg.data['4']];
4954
- }
4955
- if (msg.data.hasOwnProperty('10')) {
4956
- const lookup = {1: 'toggle', 2: 'momentary'};
4957
- payload.switch_type = lookup[msg.data['10']];
4958
- }
4957
+
4958
+ if (msg.data.hasOwnProperty('0')) payload.detection_period = msg.data['0'];
4959
+ if (msg.data.hasOwnProperty('4')) payload.mode_switch = {4: 'anti_flicker_mode', 1: 'quick_mode'}[msg.data['4']];
4960
+ if (msg.data.hasOwnProperty('10')) payload.switch_type = {1: 'toggle', 2: 'momentary'}[msg.data['10']];
4961
+ if (msg.data.hasOwnProperty('268')) payload.motion_sensitivity = {1: 'low', 2: 'medium', 3: 'high'}[msg.data['268']];
4959
4962
  if (msg.data.hasOwnProperty('512')) {
4960
4963
  if (['ZNCZ15LM', 'QBCZ14LM', 'QBCZ15LM'].includes(model.model)) {
4961
4964
  payload.button_lock = msg.data['512'] === 1 ? 'OFF' : 'ON';
4962
4965
  } else {
4963
- const mappingMode = {
4964
- 0x01: 'control_relay',
4965
- 0x00: 'decoupled',
4966
- };
4967
- const mode = mappingMode[msg.data['512']];
4968
- const payload = {};
4966
+ const mode = {0x01: 'control_relay', 0x00: 'decoupled'}[msg.data['512']];
4969
4967
  payload[postfixWithEndpointName('operation_mode', msg, model)] = mode;
4970
- return payload;
4971
4968
  }
4972
4969
  }
4973
- if (msg.data.hasOwnProperty('513')) payload.power_outage_memory = msg.data['513'] === 1; // 0x0201
4974
- if (msg.data.hasOwnProperty('514')) payload.auto_off = msg.data['514'] === 1; // 0x0202
4975
- if (msg.data.hasOwnProperty('515')) payload.led_disabled_night = msg.data['515'] === 1; // 0x0203
4976
- if (msg.data.hasOwnProperty('519')) payload.consumer_connected = msg.data['519'] === 1; // 0x0207
4977
- if (msg.data.hasOwnProperty('523')) payload.overload_protection = precisionRound(msg.data['523'], 2); // 0x020B
4978
- if (msg.data.hasOwnProperty('550')) payload.button_switch_mode = msg.data['550'] === 1 ? 'relay_and_usb' : 'relay'; // 0x0226
4970
+ if (msg.data.hasOwnProperty('513')) payload.power_outage_memory = msg.data['513'] === 1;
4971
+ if (msg.data.hasOwnProperty('514')) payload.auto_off = msg.data['514'] === 1;
4972
+ if (msg.data.hasOwnProperty('515')) payload.led_disabled_night = msg.data['515'] === 1;
4973
+ if (msg.data.hasOwnProperty('519')) payload.consumer_connected = msg.data['519'] === 1;
4974
+ if (msg.data.hasOwnProperty('523')) payload.overload_protection = precisionRound(msg.data['523'], 2);
4975
+ if (msg.data.hasOwnProperty('550')) payload.button_switch_mode = msg.data['550'] === 1 ? 'relay_and_usb' : 'relay';
4976
+ if (msg.data['mode'] !== undefined) payload.operation_mode = ['command', 'event'][msg.data['mode']];
4979
4977
  return payload;
4980
4978
  },
4981
4979
  },
@@ -5047,11 +5045,11 @@ const converters = {
5047
5045
  let buttonLookup = null;
5048
5046
  if (['WXKG02LM_rev2', 'WXKG07LM', 'WXKG17LM'].includes(model.model)) buttonLookup = {1: 'left', 2: 'right', 3: 'both'};
5049
5047
  if (['QBKG12LM', 'QBKG24LM'].includes(model.model)) buttonLookup = {5: 'left', 6: 'right', 7: 'both'};
5050
- if (['QBKG25LM', 'QBKG26LM'].includes(model.model)) buttonLookup = {41: 'left', 42: 'center', 43: 'right'};
5048
+ if (['QBKG25LM'].includes(model.model)) buttonLookup = {41: 'left', 42: 'center', 43: 'right'};
5051
5049
  if (['QBKG39LM', 'QBKG41LM', 'WS-EUK02', 'WS-EUK04', 'QBKG20LM', 'QBKG31LM'].includes(model.model)) {
5052
5050
  buttonLookup = {41: 'left', 42: 'right', 51: 'both'};
5053
5051
  }
5054
- if (['QBKG34LM'].includes(model.model)) {
5052
+ if (['QBKG26LM', 'QBKG34LM'].includes(model.model)) {
5055
5053
  buttonLookup = {
5056
5054
  41: 'left', 42: 'center', 43: 'right',
5057
5055
  51: 'left_center', 52: 'left_right', 53: 'center_right',
@@ -5415,23 +5413,6 @@ const converters = {
5415
5413
  return payload;
5416
5414
  },
5417
5415
  },
5418
- xiaomi_operation_mode_opple: {
5419
- cluster: 'aqaraOpple',
5420
- type: ['attributeReport', 'readResponse'],
5421
- convert: (model, msg, publish, options, meta) => {
5422
- if (!msg.data.hasOwnProperty('512')) {
5423
- return;
5424
- }
5425
- const mappingMode = {
5426
- 0x01: 'control_relay',
5427
- 0x00: 'decoupled',
5428
- };
5429
- const mode = mappingMode[msg.data['512']];
5430
- const payload = {};
5431
- payload[postfixWithEndpointName('operation_mode', msg, model)] = mode;
5432
- return payload;
5433
- },
5434
- },
5435
5416
  qlwz_letv8key_switch: {
5436
5417
  cluster: 'genMultistateInput',
5437
5418
  type: ['attributeReport', 'readResponse'],
@@ -5445,27 +5426,6 @@ const converters = {
5445
5426
  }
5446
5427
  },
5447
5428
  },
5448
- aqara_opple_report: {
5449
- cluster: 'aqaraOpple',
5450
- type: ['attributeReport', 'readResponse'],
5451
- convert: (model, msg, publish, options, meta) => {
5452
- // it is like xiaomi_battery_3v, but not parsed
5453
- // https://github.com/Koenkk/zigbee-herdsman/blob/master/src/zcl/buffaloZcl.ts#L93
5454
- // data: { '247': <Buffer 01 21 b8 0b 03 28 19 04 21 a8 13 05 21 44 01 06 24 02
5455
- // 00 00 00 00 08 21 11 01 0a 21 00 00 0c 20 01 64 10 00> }
5456
- if (msg.data['247']) {
5457
- const voltage = msg.data['247'][2] + msg.data['247'][3]*256;
5458
- if (voltage) {
5459
- return {battery: batteryVoltageToPercentage(voltage, '3V_2100'), voltage: voltage};
5460
- }
5461
- }
5462
-
5463
- if (msg.data['mode'] !== undefined) {
5464
- const lookup = ['command', 'event'];
5465
- return {operation_mode: lookup[msg.data['mode']]};
5466
- }
5467
- },
5468
- },
5469
5429
  aqara_opple_multistate: {
5470
5430
  cluster: 'genMultistateInput',
5471
5431
  type: ['attributeReport', 'readResponse'],
@@ -5576,26 +5536,6 @@ const converters = {
5576
5536
  return result;
5577
5537
  },
5578
5538
  },
5579
- xiaomi_switch_type: {
5580
- cluster: 'aqaraOpple',
5581
- type: ['attributeReport', 'readResponse'],
5582
- convert: (model, msg, publish, options, meta) => {
5583
- if (msg.data.hasOwnProperty(0x000A)) {
5584
- const lookup = {1: 'toggle', 2: 'momentary'};
5585
- return {switch_type: lookup[msg.data[0x000A]]};
5586
- }
5587
- },
5588
- },
5589
- xiaomi_switch_power_outage_memory: {
5590
- cluster: 'aqaraOpple',
5591
- type: ['attributeReport', 'readResponse'],
5592
- convert: (model, msg, publish, options, meta) => {
5593
- if (msg.data.hasOwnProperty(0x0201)) {
5594
- const lookup = [false, true];
5595
- return {power_outage_memory: lookup[msg.data[0x0201]]};
5596
- }
5597
- },
5598
- },
5599
5539
  keen_home_smart_vent_pressure: {
5600
5540
  cluster: 'msPressureMeasurement',
5601
5541
  type: ['attributeReport', 'readResponse'],
@@ -6489,16 +6429,6 @@ const converters = {
6489
6429
  }
6490
6430
  },
6491
6431
  },
6492
- RTCGQ13LM_motion_sensitivity: {
6493
- cluster: 'aqaraOpple',
6494
- type: ['attributeReport', 'readResponse'],
6495
- convert: (model, msg, publish, options, meta) => {
6496
- if (msg.data.hasOwnProperty(0x010c)) {
6497
- const lookup = {1: 'low', 2: 'medium', 3: 'high'};
6498
- return {motion_sensitivity: lookup[msg.data[0x010c]]};
6499
- }
6500
- },
6501
- },
6502
6432
  CCTSwitch_D0001_levelctrl: {
6503
6433
  cluster: 'genLevelCtrl',
6504
6434
  options: [exposes.options.legacy()],
@@ -7226,15 +7156,6 @@ const converters = {
7226
7156
  return {voc: msg.data.presentValue};
7227
7157
  },
7228
7158
  },
7229
- GZCGQ11LM_detection_period: {
7230
- cluster: 'aqaraOpple',
7231
- type: ['attributeReport', 'readResponse'],
7232
- convert: (model, msg, publish, options, meta) => {
7233
- if (msg.data.hasOwnProperty(0x0000)) {
7234
- return {detection_period: msg.data[0x0000]};
7235
- }
7236
- },
7237
- },
7238
7159
  heiman_doorbell_button: {
7239
7160
  cluster: 'ssIasZone',
7240
7161
  type: 'commandStatusChangeNotification',
@@ -1364,6 +1364,20 @@ const converters = {
1364
1364
  await entity.read('hvacThermostat', ['maxHeatSetpointLimit']);
1365
1365
  },
1366
1366
  },
1367
+ thermostat_ac_louver_position: {
1368
+ key: ['ac_louver_position'],
1369
+ convertSet: async (entity, key, value, meta) => {
1370
+ let acLouverPosition = utils.getKey(constants.thermostatAcLouverPositions, value, undefined, Number);
1371
+ if (acLouverPosition === undefined) {
1372
+ acLouverPosition = utils.getKey(constants.thermostatAcLouverPositions, value, value, Number);
1373
+ }
1374
+ await entity.write('hvacThermostat', {acLouverPosition});
1375
+ return {state: {ac_louver_position: value}};
1376
+ },
1377
+ convertGet: async (entity, key, meta) => {
1378
+ await entity.read('hvacThermostat', ['acLouverPosition']);
1379
+ },
1380
+ },
1367
1381
  electrical_measurement_power: {
1368
1382
  key: ['power'],
1369
1383
  convertGet: async (entity, key, meta) => {
@@ -1,10 +1,29 @@
1
1
  const exposes = require('../lib/exposes');
2
2
  const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/legacy').fromZigbee};
3
+ const tz = require('../converters/toZigbee');
3
4
  const reporting = require('../lib/reporting');
4
5
  const extend = require('../lib/extend');
5
6
  const e = exposes.presets;
6
7
 
7
8
  module.exports = [
9
+ {
10
+ zigbeeModel: ['AD-SmartPlug3001'],
11
+ model: '81848',
12
+ vendor: 'AduroSmart',
13
+ description: 'ERIA smart plug (with power measurements)',
14
+ fromZigbee: [fz.on_off, fz.electrical_measurement],
15
+ toZigbee: [tz.on_off],
16
+ exposes: [e.switch(), e.power(), e.current(), e.voltage()],
17
+ configure: async (device, coordinatorEndpoint, logger) => {
18
+ const endpoint = device.getEndpoint(1);
19
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'haElectricalMeasurement']);
20
+ await reporting.onOff(endpoint);
21
+ await reporting.readEletricalMeasurementMultiplierDivisors(endpoint);
22
+ await reporting.rmsVoltage(endpoint);
23
+ await reporting.rmsCurrent(endpoint);
24
+ await reporting.activePower(endpoint);
25
+ },
26
+ },
8
27
  {
9
28
  zigbeeModel: ['ZLL-ExtendedColo', 'ZLL-ExtendedColor', 'AD-RGBW3001'],
10
29
  model: '81809/81813',
@@ -466,6 +466,20 @@ module.exports = [
466
466
  description: 'Zigbee 12W Downlight RGB+CCT (pro)',
467
467
  extend: gledoptoExtend.light_onoff_brightness_colortemp_color(),
468
468
  },
469
+ {
470
+ zigbeeModel: ['GL-D-006P'],
471
+ model: 'GL-D-006P',
472
+ vendor: 'Gledopto',
473
+ description: 'Zigbee 6W anti-glare downlight RGB+CCT (pro)',
474
+ extend: gledoptoExtend.light_onoff_brightness_colortemp_color({colorTempRange: [158, 495]}),
475
+ },
476
+ {
477
+ zigbeeModel: ['GL-D-007P'],
478
+ model: 'GL-D-007P',
479
+ vendor: 'Gledopto',
480
+ description: 'Zigbee 12W anti-glare downlight RGB+CCT (pro)',
481
+ extend: gledoptoExtend.light_onoff_brightness_colortemp_color({colorTempRange: [158, 495]}),
482
+ },
469
483
  {
470
484
  zigbeeModel: ['GL-FL-004TZ'],
471
485
  model: 'GL-FL-004TZ',
package/devices/ikea.js CHANGED
@@ -760,7 +760,7 @@ module.exports = [
760
760
  extend: tradfriExtend.light_onoff_brightness_colortemp_color(),
761
761
  },
762
762
  {
763
- zigbeeModel: ['TRADFRI bulb E14 CWS 470lm'],
763
+ zigbeeModel: ['TRADFRI bulb E14 CWS 470lm', 'TRADFRI bulb E12 CWS 450lm'],
764
764
  model: 'LED1925G6',
765
765
  vendor: 'IKEA',
766
766
  description: 'TRADFRI LED bulb E14 470 lumen, opal, dimmable, white spectrum, color spectrum',