zigbee-herdsman-converters 15.0.104 → 15.0.105

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.
@@ -778,6 +778,7 @@ const converters = {
778
778
  {key: 'activePowerPhB', name: 'power_phase_b', factor: 'acPower'},
779
779
  {key: 'activePowerPhC', name: 'power_phase_c', factor: 'acPower'},
780
780
  {key: 'apparentPower', name: 'power_apparent', factor: 'acPower'},
781
+ {key: 'reactivePower', name: 'power_reactive', factor: 'acPower'},
781
782
  {key: 'rmsCurrent', name: 'current', factor: 'acCurrent'},
782
783
  {key: 'rmsCurrentPhB', name: 'current_phase_b', factor: 'acCurrent'},
783
784
  {key: 'rmsCurrentPhC', name: 'current_phase_c', factor: 'acCurrent'},
@@ -1654,6 +1654,12 @@ const converters = {
1654
1654
  await entity.read('haElectricalMeasurement', ['acFrequency']);
1655
1655
  },
1656
1656
  },
1657
+ electrical_measurement_power_reactive: {
1658
+ key: ['power_reactive'],
1659
+ convertGet: async (entity, key, meta) => {
1660
+ await entity.read('haElectricalMeasurement', ['reactivePower']);
1661
+ },
1662
+ },
1657
1663
  powerfactor: {
1658
1664
  key: ['power_factor'],
1659
1665
  convertGet: async (entity, key, meta) => {
@@ -292,13 +292,14 @@ module.exports = [
292
292
  description: 'Power plug',
293
293
  fromZigbee: [fz.on_off, develco.fz.electrical_measurement, develco.fz.metering],
294
294
  toZigbee: [tz.on_off],
295
- exposes: [e.switch(), e.power(), e.current(), e.voltage(), e.energy(), e.ac_frequency()],
295
+ exposes: [e.switch(), e.power(), e.power_reactive(), e.current(), e.voltage(), e.energy(), e.ac_frequency()],
296
296
  configure: async (device, coordinatorEndpoint, logger) => {
297
297
  const endpoint = device.getEndpoint(2);
298
298
  await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'haElectricalMeasurement', 'seMetering']);
299
299
  await reporting.onOff(endpoint);
300
300
  await reporting.readEletricalMeasurementMultiplierDivisors(endpoint, true);
301
301
  await reporting.activePower(endpoint);
302
+ await reporting.reactivePower(endpoint);
302
303
  await reporting.rmsCurrent(endpoint);
303
304
  await reporting.rmsVoltage(endpoint);
304
305
  await reporting.readMeteringMultiplierDivisor(endpoint);
@@ -11,7 +11,7 @@ module.exports = [
11
11
  {modelID: 'TS0601', manufacturerName: '_TZE200_6qoazbre'},
12
12
  {modelID: 'TS0601', manufacturerName: '_TZE200_fcooykb4'},
13
13
  ],
14
- model: 'WZ5_dim',
14
+ model: 'WZ5_dim_1',
15
15
  vendor: 'Skydance',
16
16
  description: 'Zigbee & RF 5 in 1 LED controller (DIM mode)',
17
17
  fromZigbee: [fz.tuya_light_wz5],
package/devices/tuya.js CHANGED
@@ -899,15 +899,18 @@ const fzLocal = {
899
899
  convert: (model, msg, publish, options, meta) => {
900
900
  const result = fz.electrical_measurement.convert(model, msg, publish, options, meta);
901
901
 
902
- // Skip the first reported 0 values as this may be a false measurement
902
+ // Wait 5 seconds before reporting a 0 value as this could be an invalid measurement.
903
903
  // https://github.com/Koenkk/zigbee2mqtt/issues/16709#issuecomment-1509599046
904
904
  if (['_TZ3000_gvn91tmx', '_TZ3000_amdymr7l'].includes(meta.device.manufacturerName)) {
905
905
  for (const key of ['power', 'current', 'voltage']) {
906
- const value = result[key];
907
- if (value === 0 && globalStore.getValue(msg.endpoint, key) !== 0) {
908
- delete result[key];
906
+ if (key in result) {
907
+ const value = result[key];
908
+ clearTimeout(globalStore.getValue(msg.endpoint, key));
909
+ if (value === 0) {
910
+ globalStore.putValue(msg.endpoint, key, setTimeout(() => publish({[key]: value}), 5 * 1000));
911
+ delete result[key];
912
+ }
909
913
  }
910
- globalStore.putValue(msg.endpoint, key, value);
911
914
  }
912
915
  }
913
916
  return result;
@@ -1287,6 +1290,7 @@ module.exports = [
1287
1290
  tuya.whitelabel('Lidl', 'HG08008', 'Livarno Home LED ceiling light', ['_TZ3210_p9ao60da']),
1288
1291
  tuya.whitelabel('Lidl', 'HG08007', 'Livarno Home outdoor LED band', ['_TZ3210_zbabx9wh']),
1289
1292
  tuya.whitelabel('Lidl', '399629_2110', 'Livarno Lux Ceiling Panel RGB+CCT', ['_TZ3210_c0s1xloa']),
1293
+ tuya.whitelabel('Skydance', 'WZ5_dim_2', 'Zigbee & RF 5 in 1 LED controller (DIM mode)', ['_TZB210_3zfp8mki']),
1290
1294
  ],
1291
1295
  extend: tuya.extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500], noConfigure: true}),
1292
1296
  configure: async (device, coordinatorEndpoint, logger) => {
@@ -1923,6 +1927,7 @@ module.exports = [
1923
1927
  {
1924
1928
  fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_kyfqmmyl'},
1925
1929
  {modelID: 'TS0601', manufacturerName: '_TZE200_2hf7x9n3'},
1930
+ {modelID: 'TS0601', manufacturerName: '_TZE204_atpwqgml'},
1926
1931
  {modelID: 'TS0601', manufacturerName: '_TZE200_bynnczcb'},
1927
1932
  {modelID: 'TS0601', manufacturerName: '_TZE200_atpwqgml'}],
1928
1933
  model: 'TS0601_switch_3_gang',
package/lib/exposes.js CHANGED
@@ -626,6 +626,7 @@ module.exports = {
626
626
  power_on_behavior: (values=['off', 'previous', 'on']) => new Enum('power_on_behavior', access.ALL, values).withDescription('Controls the behavior when the device is powered on after power loss'),
627
627
  power_outage_count: (resetsWhenPairing = true) => new Numeric('power_outage_count', access.STATE).withDescription('Number of power outages' + (resetsWhenPairing ? ' (since last pairing)' : '')),
628
628
  power_outage_memory: () => new Binary('power_outage_memory', access.ALL, true, false).withDescription('Enable/disable the power outage memory, this recovers the on/off mode after power failure'),
629
+ power_reactive: () => new Numeric('power_reactive', access.STATE).withUnit('VAR').withDescription('Instantaneous measured reactive power'),
629
630
  presence: () => new Binary('presence', access.STATE, true, false).withDescription('Indicates whether the device detected presence'),
630
631
  pressure: () => new Numeric('pressure', access.STATE).withUnit('hPa').withDescription('The measured atmospheric pressure'),
631
632
  programming_operation_mode: () => new Enum('programming_operation_mode', access.ALL, ['setpoint', 'schedule', 'schedule_with_preheat', 'eco']).withDescription('Controls how programming affects the thermostat. Possible values: setpoint (only use specified setpoint), schedule (follow programmed setpoint schedule), schedule_with_preheat (follow programmed setpoint schedule with pre-heating). Changing this value does not clear programmed schedules.'),
package/lib/reporting.js CHANGED
@@ -203,6 +203,10 @@ module.exports = {
203
203
  const p = payload('activePower', 5, repInterval.HOUR, 1, overrides);
204
204
  await endpoint.configureReporting('haElectricalMeasurement', p);
205
205
  },
206
+ reactivePower: async (endpoint, overrides) => {
207
+ const p = payload('reactivePower', 5, repInterval.HOUR, 1, overrides);
208
+ await endpoint.configureReporting('haElectricalMeasurement', p);
209
+ },
206
210
  apparentPower: async (endpoint, overrides) => {
207
211
  const p = payload('apparentPower', 5, repInterval.HOUR, 1, overrides);
208
212
  await endpoint.configureReporting('haElectricalMeasurement', p);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "15.0.104",
3
+ "version": "15.0.105",
4
4
  "description": "Collection of device converters to be used with zigbee-herdsman",
5
5
  "main": "index.js",
6
6
  "files": [