zigbee-herdsman-converters 14.0.520 → 14.0.521

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.
@@ -2727,6 +2727,17 @@ const converters = {
2727
2727
  await entity.read('aqaraOpple', [0x0002], manufacturerOptions.xiaomi);
2728
2728
  },
2729
2729
  },
2730
+ RTCGQ14LM_trigger_indicator: {
2731
+ key: ['trigger_indicator'],
2732
+ convertSet: async (entity, key, value, meta) => {
2733
+ const lookup = {true: 1, false: 0};
2734
+ await entity.write('aqaraOpple', {0x0152: {value: lookup[value], type: 0x20}}, manufacturerOptions.xiaomi);
2735
+ return {state: {trigger_indicator: value}};
2736
+ },
2737
+ convertGet: async (entity, key, meta) => {
2738
+ await entity.read('aqaraOpple', [0x0152], manufacturerOptions.xiaomi);
2739
+ },
2740
+ },
2730
2741
  LLKZMK11LM_interlock: {
2731
2742
  key: ['interlock'],
2732
2743
  convertSet: async (entity, key, value, meta) => {
package/devices/sonoff.js CHANGED
@@ -5,6 +5,7 @@ const constants = require('../lib/constants');
5
5
  const reporting = require('../lib/reporting');
6
6
  const extend = require('../lib/extend');
7
7
  const e = exposes.presets;
8
+ const ota = require('../lib/ota');
8
9
 
9
10
  module.exports = [
10
11
  {
@@ -20,6 +21,7 @@ module.exports = [
20
21
  model: 'ZBMINI-L',
21
22
  vendor: 'SONOFF',
22
23
  description: 'Zigbee smart switch (no neutral)',
24
+ ota: ota.zigbeeOTA,
23
25
  extend: extend.switch(),
24
26
  toZigbee: extend.switch().toZigbee.concat([tz.power_on_behavior]),
25
27
  fromZigbee: extend.switch().fromZigbee.concat([fz.power_on_behavior]),
@@ -1,10 +1,34 @@
1
1
  const exposes = require('../lib/exposes');
2
- const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/legacy').fromZigbee};
2
+ const fz = require('../converters/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: ['S24019'],
11
+ model: 'S24019',
12
+ vendor: 'The Light Group',
13
+ description: 'SLC SmartOne led dimmer',
14
+ fromZigbee: [fz.on_off, fz.brightness, fz.metering, fz.electrical_measurement],
15
+ toZigbee: [tz.light_onoff_brightness, tz.level_config],
16
+ exposes: [e.light_brightness().withLevelConfig()],
17
+ configure: async (device, coordinatorEndpoint, logger) => {
18
+ // Endpoint 1
19
+ const endpoint1 = device.getEndpoint(1);
20
+ const binds1 = ['genOnOff', 'genLevelCtrl', 'haElectricalMeasurement', 'seMetering'];
21
+ await reporting.bind(endpoint1, coordinatorEndpoint, binds1);
22
+ await reporting.onOff(endpoint1);
23
+ await reporting.brightness(endpoint1);
24
+ await reporting.readEletricalMeasurementMultiplierDivisors(endpoint1);
25
+ await reporting.activePower(endpoint1, {min: 5, max: 3600, change: 1000});
26
+ await reporting.rmsCurrent(endpoint1, {min: 5, max: 3600, change: 100});
27
+ await reporting.rmsVoltage(endpoint1, {min: 5, max: 3600, change: 100});
28
+ // read switch state
29
+ await endpoint1.read('genOnOff', ['onOff']);
30
+ },
31
+ },
8
32
  {
9
33
  zigbeeModel: ['S57003'],
10
34
  model: 'S57003',
package/devices/tuya.js CHANGED
@@ -247,7 +247,7 @@ module.exports = [
247
247
  fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3000_rk2yzt0u'},
248
248
  {modelID: 'TS0001', manufacturerName: '_TZ3000_o4cjetlm'}, {manufacturerName: '_TZ3000_o4cjetlm'},
249
249
  {modelID: 'TS0001', manufacturerName: '_TZ3000_iedbgyxt'}, {modelID: 'TS0001', manufacturerName: '_TZ3000_h3noz0a5'},
250
- {modelID: 'TS0001', manufacturerName: '_TYZB01_4tlksk8a'}],
250
+ {modelID: 'TS0001', manufacturerName: '_TYZB01_4tlksk8a'}, {modelID: 'TS0011', manufacturerName: '_TYZB01_rifa0wlb'}],
251
251
  model: 'ZN231392',
252
252
  vendor: 'TuYa',
253
253
  description: 'Smart water/gas valve',
package/devices/xiaomi.js CHANGED
@@ -177,7 +177,8 @@ module.exports = [
177
177
  vendor: 'Xiaomi',
178
178
  description: 'Aqara wireless switch',
179
179
  meta: {battery: {voltageToPercentage: '3V_2850_3000_log'}},
180
- exposes: [e.battery(), e.battery_voltage(), e.action(['single', 'double', 'triple', 'quadruple', 'hold', 'release'])],
180
+ exposes: [e.battery(), e.battery_voltage(), e.action(['single', 'double', 'triple', 'quadruple', 'hold', 'release']),
181
+ e.temperature(), e.power_outage_count()],
181
182
  fromZigbee: [fz.xiaomi_multistate_action, fz.xiaomi_WXKG11LM_action, fz.xiaomi_basic,
182
183
  fz.legacy.WXKG11LM_click, fz.legacy.xiaomi_action_click_multistate],
183
184
  toZigbee: [],
@@ -925,18 +926,21 @@ module.exports = [
925
926
  whiteLabel: [{vendor: 'Xiaomi', model: 'MS-S02'}],
926
927
  description: 'Aqara P1 human body movement and illuminance sensor',
927
928
  fromZigbee: [fz.aqara_occupancy_illuminance, fz.aqara_opple, fz.battery],
928
- toZigbee: [tz.aqara_detection_interval, tz.aqara_motion_sensitivity],
929
+ toZigbee: [tz.aqara_detection_interval, tz.aqara_motion_sensitivity, tz.RTCGQ14LM_trigger_indicator],
929
930
  exposes: [e.occupancy(), e.illuminance_lux().withProperty('illuminance'),
930
931
  e.illuminance().withUnit('lx').withDescription('Measured illuminance in lux'),
931
932
  exposes.enum('motion_sensitivity', ea.ALL, ['low', 'medium', 'high']),
932
933
  exposes.numeric('detection_interval', ea.ALL).withValueMin(2).withValueMax(65535).withUnit('s')
933
- .withDescription('Time interval for detecting actions'), e.temperature(), e.battery()],
934
+ .withDescription('Time interval for detecting actions'),
935
+ exposes.binary('trigger_indicator', ea.ALL, true, false).withDescription('When this option is enabled then ' +
936
+ 'blue LED will blink once when motion is detected'), e.temperature(), e.battery(), e.battery_voltage()],
934
937
  meta: {battery: {voltageToPercentage: '3V_2850_3000_log'}},
935
938
  configure: async (device, coordinatorEndpoint, logger) => {
936
939
  const endpoint = device.getEndpoint(1);
937
940
  await endpoint.read('genPowerCfg', ['batteryVoltage']);
938
941
  await endpoint.read('aqaraOpple', [0x0102], {manufacturerCode: 0x115f});
939
942
  await endpoint.read('aqaraOpple', [0x010c], {manufacturerCode: 0x115f});
943
+ await endpoint.read('aqaraOpple', [0x0152], {manufacturerCode: 0x115f});
940
944
  },
941
945
  ota: ota.zigbeeOTA,
942
946
  },
@@ -1286,7 +1290,7 @@ module.exports = [
1286
1290
  fromZigbee: [fz.xiaomi_basic, fz.DJT11LM_vibration],
1287
1291
  toZigbee: [tz.DJT11LM_vibration_sensitivity],
1288
1292
  exposes: [
1289
- e.battery(), e.vibration(), e.action(['vibration', 'tilt', 'drop']),
1293
+ e.battery(), e.temperature(), e.vibration(), e.action(['vibration', 'tilt', 'drop']),
1290
1294
  exposes.numeric('strength', ea.STATE), exposes.enum('sensitivity', ea.STATE_SET, ['low', 'medium', 'high']),
1291
1295
  e.angle_axis('angle_x'), e.angle_axis('angle_y'), e.angle_axis('angle_z'), e.battery_voltage(),
1292
1296
  ],
@@ -1568,7 +1572,7 @@ module.exports = [
1568
1572
  fromZigbee: [fz.on_off, fz.device_temperature, fz.aqara_opple, fz.ignore_metering, fz.ignore_electrical_measurement,
1569
1573
  fz.xiaomi_power],
1570
1574
  exposes: [e.switch(), e.energy(), e.power(), e.device_temperature(), e.power_outage_memory(), e.power_outage_count(),
1571
- e.switch_type(), e.voltage(), e.temperature(), e.current(),
1575
+ e.switch_type(), e.voltage(), e.current(),
1572
1576
  ],
1573
1577
  toZigbee: [tz.xiaomi_switch_type, tz.on_off, tz.xiaomi_switch_power_outage_memory, tz.xiaomi_led_disabled_night],
1574
1578
  configure: async (device, coordinatorEndpoint, logger) => {
@@ -1602,7 +1606,7 @@ module.exports = [
1602
1606
  vendor: 'Xiaomi',
1603
1607
  description: 'Aqara single switch module T1 (without neutral). Doesn\'t work as a router and doesn\'t support power meter',
1604
1608
  fromZigbee: [fz.on_off, fz.aqara_opple],
1605
- exposes: [e.switch(), e.power_outage_memory(), e.switch_type()],
1609
+ exposes: [e.switch(), e.power_outage_memory(), e.switch_type(), e.power_outage_count(), e.device_temperature()],
1606
1610
  toZigbee: [tz.xiaomi_switch_type, tz.on_off, tz.xiaomi_switch_power_outage_memory],
1607
1611
  configure: async (device, coordinatorEndpoint, logger) => {
1608
1612
  const endpoint = device.getEndpoint(1);
package/lib/xiaomi.js CHANGED
@@ -160,6 +160,8 @@ const numericAttributes2Payload = (msg, meta, model, options, dataObject) => {
160
160
  case '3':
161
161
  if (['WSDCGQ12LM'].includes(model.model)) {
162
162
  // This temperature value is ignored because with greater accuracy it is reported in key №100
163
+ } else if (['SSM-U01'].includes(model.model)) {
164
+ payload.device_temperature = value;
163
165
  } else if (!['WXCJKG11LM', 'WXCJKG12LM', 'WXCJKG13LM'].includes(model.model)) {
164
166
  payload.temperature = calibrateAndPrecisionRoundOptions(value, options, 'temperature'); // 0x03
165
167
  }
@@ -202,7 +204,7 @@ const numericAttributes2Payload = (msg, meta, model, options, dataObject) => {
202
204
  payload[`state_${mapping}`] = value === 1 ? 'ON' : 'OFF';
203
205
  } else if (['WXKG14LM', 'WXKG16LM', 'WXKG17LM'].includes(model.model)) {
204
206
  payload.click_mode = {1: 'fast', 2: 'multi'}[value];
205
- } else if (['WXCJKG11LM', 'WXCJKG12LM', 'WXCJKG13LM', 'ZNMS12LM'].includes(model.model)) {
207
+ } else if (['WXCJKG11LM', 'WXCJKG12LM', 'WXCJKG13LM', 'ZNMS12LM', 'RTCGQ14LM'].includes(model.model)) {
206
208
  // We don't know what the value means for these devices.
207
209
  // https://github.com/Koenkk/zigbee2mqtt/issues/11126
208
210
  // https://github.com/Koenkk/zigbee2mqtt/issues/12279
@@ -297,6 +299,11 @@ const numericAttributes2Payload = (msg, meta, model, options, dataObject) => {
297
299
  payload.motion_sensitivity = {1: 'low', 2: 'medium', 3: 'high'}[value];
298
300
  }
299
301
  break;
302
+ case '107':
303
+ if (['RTCGQ14LM'].includes(model.model)) {
304
+ payload.trigger_indicator = value === 1;
305
+ }
306
+ break;
300
307
  case '149':
301
308
  payload.energy = precisionRound(value, 2); // 0x95
302
309
  // Consumption is deprecated
@@ -383,7 +390,7 @@ const numericAttributes2Payload = (msg, meta, model, options, dataObject) => {
383
390
  payload.detection_interval = value;
384
391
  break;
385
392
  case '268':
386
- if (['RTCGQ13LM', 'RTCZCGQ11LM'].includes(model.model)) {
393
+ if (['RTCGQ13LM', 'RTCGQ14LM', 'RTCZCGQ11LM'].includes(model.model)) {
387
394
  payload.motion_sensitivity = {1: 'low', 2: 'medium', 3: 'high'}[value];
388
395
  } else if (['JT-BZ-01AQ/A'].includes(model.model)) {
389
396
  payload.gas_sensitivity = {1: '15%LEL', 2: '10%LEL'}[value];
@@ -454,6 +461,11 @@ const numericAttributes2Payload = (msg, meta, model, options, dataObject) => {
454
461
  payload.linkage_alarm = value === 1;
455
462
  }
456
463
  break;
464
+ case '338':
465
+ if (['RTCGQ14LM'].includes(model.model)) {
466
+ payload.trigger_indicator = value === 1;
467
+ }
468
+ break;
457
469
  case '512':
458
470
  if (['ZNCZ15LM', 'QBCZ14LM', 'QBCZ15LM'].includes(model.model)) {
459
471
  payload.button_lock = value === 1 ? 'OFF' : 'ON';
@@ -530,6 +542,9 @@ const numericAttributes2Payload = (msg, meta, model, options, dataObject) => {
530
542
  case 'modelId':
531
543
  // We ignore it, but we add it here to not shown an unknown key in the log
532
544
  break;
545
+ case 'illuminance':
546
+ // It contains the illuminance and occupancy, but in z2m we use a custom timer to do it, so we ignore it
547
+ break;
533
548
  default:
534
549
  if (meta.logger) meta.logger.debug(`${model.zigbeeModel}: unknown key ${key} with value ${value}`);
535
550
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "14.0.520",
3
+ "version": "14.0.521",
4
4
  "description": "Collection of device converters to be used with zigbee-herdsman",
5
5
  "main": "index.js",
6
6
  "files": [