zigbee-herdsman-converters 14.0.539 → 14.0.540

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.
@@ -2257,9 +2257,7 @@ const converters = {
2257
2257
  const value = tuya.getDataValue(dpValue);
2258
2258
 
2259
2259
  switch (dp) {
2260
- case tuya.dataPoints.coverPosition: { // Started moving to position (triggered from Zigbee)
2261
- return {running: true};
2262
- }
2260
+ case tuya.dataPoints.coverPosition: // Started moving to position (triggered from Zigbee)
2263
2261
  case tuya.dataPoints.coverArrived: { // Arrived at position
2264
2262
  const running = dp === tuya.dataPoints.coverArrived ? false : true;
2265
2263
  const invert = tuya.isCoverInverted(meta.device.manufacturerName) ? !options.invert_cover : options.invert_cover;
@@ -7308,7 +7306,7 @@ const converters = {
7308
7306
  case 4:
7309
7307
  return {battery: value};
7310
7308
  case 1:
7311
- return {battery_low: value.toFixed(1)};
7309
+ return {battery_low: value === 1};
7312
7310
  default:
7313
7311
  meta.logger.warn(`s_lux_zb_illuminance: NOT RECOGNIZED DP #${dp} with data ${JSON.stringify(dpValue)}`);
7314
7312
  }
package/devices/owon.js CHANGED
@@ -4,7 +4,78 @@ const tz = require('../converters/toZigbee');
4
4
  const constants = require('../lib/constants');
5
5
  const reporting = require('../lib/reporting');
6
6
  const e = exposes.presets;
7
+ const ea = exposes.access;
7
8
 
9
+ const fzLocal = {
10
+ PC321_metering: {
11
+ cluster: 'seMetering',
12
+ type: ['attributeReport', 'readResponse'],
13
+ convert: (model, msg, publish, options, meta) => {
14
+ const payload = {};
15
+ if (msg.data.hasOwnProperty('owonL1Energy')) {
16
+ payload.energy_l1 = msg.data['owonL1Energy'][1] / 1000.0;
17
+ }
18
+ if (msg.data.hasOwnProperty('owonL2Energy')) {
19
+ payload.energy_l2 = msg.data['owonL2Energy'][1] / 1000.0;
20
+ }
21
+ if (msg.data.hasOwnProperty('owonL3Energy')) {
22
+ payload.energy_l3 = msg.data['owonL3Energy'][1] / 1000.0;
23
+ }
24
+ if (msg.data.hasOwnProperty('owonL1ReactiveEnergy')) {
25
+ payload.reactive_energy_l1 = msg.data['owonL1ReactiveEnergy'][1] / 1000.0;
26
+ }
27
+ if (msg.data.hasOwnProperty('owonL2ReactiveEnergy')) {
28
+ payload.reactive_energy_l2 = msg.data['owonL2ReactiveEnergy'][1] / 1000.0;
29
+ }
30
+ if (msg.data.hasOwnProperty('owonL3ReactiveEnergy')) {
31
+ payload.reactive_energy_l3 = msg.data['owonL3ReactiveEnergy'][1] / 1000.0;
32
+ }
33
+ if (msg.data.hasOwnProperty('owonL1PhasePower')) {
34
+ payload.power_l1 = msg.data['owonL1PhasePower'];
35
+ }
36
+ if (msg.data.hasOwnProperty('owonL2PhasePower')) {
37
+ payload.power_l2 = msg.data['owonL2PhasePower'];
38
+ }
39
+ if (msg.data.hasOwnProperty('owonL3PhasePower')) {
40
+ payload.power_l3 = msg.data['owonL3PhasePower'];
41
+ }
42
+ if (msg.data.hasOwnProperty('owonL1PhaseReactivePower')) {
43
+ payload.reactive_power_l1 = msg.data['owonL1PhaseReactivePower'];
44
+ }
45
+ if (msg.data.hasOwnProperty('owonL2PhaseReactivePower')) {
46
+ payload.reactive_power_l2 = msg.data['owonL2PhaseReactivePower'];
47
+ }
48
+ if (msg.data.hasOwnProperty('owonL3PhaseReactivePower')) {
49
+ payload.reactive_power_l3 = msg.data['owonL3PhaseReactivePower'];
50
+ }
51
+ if (msg.data.hasOwnProperty('owonL1PhaseVoltage')) {
52
+ payload.voltage_l1 = msg.data['owonL1PhaseVoltage'] / 10.0;
53
+ }
54
+ if (msg.data.hasOwnProperty('owonL2PhaseVoltage')) {
55
+ payload.voltage_l2 = msg.data['owonL2PhaseVoltage'] / 10.0;
56
+ }
57
+ if (msg.data.hasOwnProperty('owonL3PhaseVoltage')) {
58
+ payload.voltage_l3 = msg.data['owonL3PhaseVoltage'] / 10.0;
59
+ }
60
+ if (msg.data.hasOwnProperty('owonL1PhaseCurrent')) {
61
+ payload.current_l1 = msg.data['owonL1PhaseCurrent'] / 1000.0;
62
+ }
63
+ if (msg.data.hasOwnProperty('owonL2PhaseCurrent')) {
64
+ payload.current_l2 = msg.data['owonL2PhaseCurrent'] / 1000.0;
65
+ }
66
+ if (msg.data.hasOwnProperty('owonL3PhaseCurrent')) {
67
+ payload.current_l3 = msg.data['owonL3PhaseCurrent'] / 1000.0;
68
+ }
69
+ if (msg.data.hasOwnProperty('owonFrequency')) {
70
+ payload.frequency = msg.data['owonFrequency'];
71
+ }
72
+ if (msg.data.hasOwnProperty('owonReactiveEnergySum')) {
73
+ payload.reactive_energy_sum = msg.data['owonReactiveEnergySum'];
74
+ }
75
+ return payload;
76
+ },
77
+ },
78
+ };
8
79
  module.exports = [
9
80
  {
10
81
  zigbeeModel: ['WSP404'],
@@ -119,4 +190,41 @@ module.exports = [
119
190
  device.save();
120
191
  },
121
192
  },
193
+ {
194
+ zigbeeModel: ['PC321'],
195
+ model: 'PC321',
196
+ vendor: 'OWON',
197
+ description: '3-Phase clamp power meter',
198
+ fromZigbee: [fz.metering, fzLocal.PC321_metering],
199
+ toZigbee: [],
200
+ configure: async (device, coordinatorEndpoint, logger) => {
201
+ const endpoint = device.getEndpoint(1);
202
+ await reporting.bind(endpoint, coordinatorEndpoint, ['seMetering']);
203
+ await reporting.readMeteringMultiplierDivisor(endpoint);
204
+ if (device.powerSource === 'Unknown') {
205
+ device.powerSource = 'Mains (single phase)';
206
+ device.save();
207
+ }
208
+ },
209
+ exposes: [e.energy(),
210
+ exposes.numeric('voltage_l1', ea.STATE).withUnit('V').withDescription('Phase 1 voltage'),
211
+ exposes.numeric('voltage_l2', ea.STATE).withUnit('V').withDescription('Phase 2 voltage'),
212
+ exposes.numeric('voltage_l3', ea.STATE).withUnit('V').withDescription('Phase 3 voltage'),
213
+ exposes.numeric('current_l1', ea.STATE).withUnit('A').withDescription('Phase 1 current'),
214
+ exposes.numeric('current_l2', ea.STATE).withUnit('A').withDescription('Phase 2 current'),
215
+ exposes.numeric('current_l3', ea.STATE).withUnit('A').withDescription('Phase 3 current'),
216
+ exposes.numeric('energy_l1', ea.STATE).withUnit('kWh').withDescription('Phase 1 energy'),
217
+ exposes.numeric('energy_l2', ea.STATE).withUnit('kWh').withDescription('Phase 2 energy'),
218
+ exposes.numeric('energy_l3', ea.STATE).withUnit('kWh').withDescription('Phase 3 energy'),
219
+ exposes.numeric('reactive_energy_l1', ea.STATE).withUnit('kVArh').withDescription('Phase 1 reactive energy'),
220
+ exposes.numeric('reactive_energy_l2', ea.STATE).withUnit('kVArh').withDescription('Phase 2 reactive energy'),
221
+ exposes.numeric('reactive_energy_l3', ea.STATE).withUnit('kVArh').withDescription('Phase 3 reactive energy'),
222
+ exposes.numeric('power_l1', ea.STATE).withUnit('W').withDescription('Phase 1 power'),
223
+ exposes.numeric('power_l2', ea.STATE).withUnit('W').withDescription('Phase 2 power'),
224
+ exposes.numeric('power_l3', ea.STATE).withUnit('W').withDescription('Phase 3 power'),
225
+ exposes.numeric('reactive_power_l1', ea.STATE).withUnit('VAr').withDescription('Phase 1 reactive power'),
226
+ exposes.numeric('reactive_power_l2', ea.STATE).withUnit('VAr').withDescription('Phase 2 reactive power'),
227
+ exposes.numeric('reactive_power_l3', ea.STATE).withUnit('VAr').withDescription('Phase 3 reactive power'),
228
+ ],
229
+ },
122
230
  ];
@@ -1671,9 +1671,9 @@ module.exports = [
1671
1671
  zigbeeModel: ['929002376801'],
1672
1672
  model: '929002376801',
1673
1673
  vendor: 'Philips',
1674
- description: 'Hue Iris (generation 4)',
1674
+ description: 'Hue Iris kobber limited edition (generation 4)',
1675
1675
  meta: {turnsOffAtBrightness1: true},
1676
- extend: hueExtend.light_onoff_brightness_color(),
1676
+ extend: hueExtend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
1677
1677
  ota: ota.zigbeeOTA,
1678
1678
  },
1679
1679
  {
package/devices/tuya.js CHANGED
@@ -716,13 +716,7 @@ module.exports = [
716
716
  const endpoint = device.getEndpoint(1);
717
717
  await reporting.bind(endpoint, coordinatorEndpoint, ['genBasic']);
718
718
  },
719
- exposes: (device, options) => {
720
- if (device && device.manufacturerName === '_TZE200_pisltm67') {
721
- return [e.illuminance_lux(), e.linkquality()];
722
- } else {
723
- return [e.battery(), e.illuminance_lux(), e.battery_low(), e.linkquality()];
724
- }
725
- },
719
+ exposes: [e.battery(), e.illuminance_lux(), e.battery_low(), e.linkquality()],
726
720
  },
727
721
  {
728
722
  zigbeeModel: ['TS130F'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "14.0.539",
3
+ "version": "14.0.540",
4
4
  "description": "Collection of device converters to be used with zigbee-herdsman",
5
5
  "main": "index.js",
6
6
  "files": [