zigbee-herdsman-converters 15.0.114 → 15.0.115

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.
@@ -171,10 +171,10 @@ module.exports = [
171
171
  model: '3RSP02028BZ',
172
172
  vendor: 'Third Reality',
173
173
  description: 'Zigbee / BLE smart plug with power',
174
- fromZigbee: [fz.on_off, fz.electrical_measurement, fz.metering],
175
- toZigbee: [tz.on_off],
174
+ fromZigbee: [fz.on_off, fz.electrical_measurement, fz.metering, fz.power_on_behavior],
175
+ toZigbee: [tz.on_off, tz.power_on_behavior],
176
176
  ota: ota.zigbeeOTA,
177
- exposes: [e.switch(), e.ac_frequency(), e.power(), e.power_factor(), e.energy(), e.current(), e.voltage()],
177
+ exposes: [e.switch(), e.power_on_behavior(), e.ac_frequency(), e.power(), e.power_factor(), e.energy(), e.current(), e.voltage()],
178
178
  configure: async (device, coordinatorEndpoint, logger) => {
179
179
  const endpoint = device.getEndpoint(1);
180
180
  await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'haElectricalMeasurement', 'seMetering']);
package/devices/tuya.js CHANGED
@@ -5197,4 +5197,66 @@ module.exports = [
5197
5197
  ],
5198
5198
  },
5199
5199
  },
5200
+ {
5201
+ fingerprint: [
5202
+ {modelID: 'TS0601', manufacturerName: '_TZE200_vmcgja59'},
5203
+ ],
5204
+ model: 'TS0601_switch_8',
5205
+ vendor: 'TuYa',
5206
+ description: '8 Gang switch',
5207
+ fromZigbee: [tuya.fz.datapoints],
5208
+ toZigbee: [tuya.tz.datapoints],
5209
+ configure: tuya.configureMagicPacket,
5210
+ exposes: [
5211
+ tuya.exposes.switch().withEndpoint('l1'),
5212
+ tuya.exposes.switch().withEndpoint('l2'),
5213
+ tuya.exposes.switch().withEndpoint('l3'),
5214
+ tuya.exposes.switch().withEndpoint('l4'),
5215
+ tuya.exposes.switch().withEndpoint('l5'),
5216
+ tuya.exposes.switch().withEndpoint('l6'),
5217
+ tuya.exposes.switch().withEndpoint('l7'),
5218
+ tuya.exposes.switch().withEndpoint('l8'),
5219
+ ],
5220
+ endpoint: (device) => {
5221
+ return {'l1': 1, 'l2': 1, 'l3': 1, 'l4': 1, 'l5': 1, 'l6': 1, 'l7': 1, 'l8': 1};
5222
+ },
5223
+ meta: {
5224
+ multiEndpoint: true,
5225
+ tuyaDatapoints: [
5226
+ [1, 'state_l1', tuya.valueConverter.onOff],
5227
+ [2, 'state_l2', tuya.valueConverter.onOff],
5228
+ [3, 'state_l3', tuya.valueConverter.onOff],
5229
+ [4, 'state_l4', tuya.valueConverter.onOff],
5230
+ [5, 'state_l5', tuya.valueConverter.onOff],
5231
+ [6, 'state_l6', tuya.valueConverter.onOff],
5232
+ [0x65, 'state_l7', tuya.valueConverter.onOff],
5233
+ [0x66, 'state_l8', tuya.valueConverter.onOff],
5234
+ ],
5235
+ },
5236
+ whiteLabel: [
5237
+ tuya.whitelabel('ZYXH', 'TS0601_switch_8', '8 Gang switch', ['_TZE200_vmcgja59']),
5238
+ ],
5239
+ },
5240
+ {
5241
+ fingerprint: tuya.fingerprint('TS01FF', ['_TZ3000_rqbjepe8']),
5242
+ model: 'TS011F_4',
5243
+ description: '2 gang plug',
5244
+ vendor: 'TuYa',
5245
+ ota: ota.zigbeeOTA,
5246
+ extend: tuya.extend.switch({
5247
+ electricalMeasurements: true, powerOutageMemory: true, indicatorMode: true, childLock: true, endpoints: ['l1', 'l2']}),
5248
+ endpoint: (device) => {
5249
+ return {l1: 1, l2: 2};
5250
+ },
5251
+ meta: {multiEndpoint: true, multiEndpointSkip: ['energy', 'current', 'voltage', 'power']},
5252
+ configure: async (device, coordinatorEndpoint, logger) => {
5253
+ await tuya.configureMagicPacket(device, coordinatorEndpoint, logger);
5254
+ const endpoint = device.getEndpoint(1);
5255
+ endpoint.saveClusterAttributeKeyValue('haElectricalMeasurement', {acCurrentDivisor: 1000, acCurrentMultiplier: 1});
5256
+ endpoint.saveClusterAttributeKeyValue('seMetering', {divisor: 100, multiplier: 1});
5257
+ device.save();
5258
+ },
5259
+ options: [exposes.options.measurement_poll_interval()],
5260
+ onEvent: (type, data, device, options) => tuya.onEventMeasurementPoll(type, data, device, options, true, false),
5261
+ },
5200
5262
  ];
package/lib/tuya.js CHANGED
@@ -1663,11 +1663,12 @@ const tuyaTz = {
1663
1663
  const state = {};
1664
1664
  const datapoints = utils.getMetaValue(entity, meta.mapped, 'tuyaDatapoints', undefined, undefined);
1665
1665
  if (!datapoints) throw new Error('No datapoints map defined');
1666
- for (const [key, value] of Object.entries(meta.message)) {
1667
- const convertedKey = meta.mapped.meta.multiEndpoint && meta.endpoint_name ? `${key}_${meta.endpoint_name}` : key;
1666
+ for (const [attr, value] of Object.entries(meta.message)) {
1667
+ const convertedKey = meta.mapped.meta.multiEndpoint && meta.endpoint_name && !attr.startsWith(`${key}_`) ?
1668
+ `${attr}_${meta.endpoint_name}` : attr;
1668
1669
  const dpEntry = datapoints.find((d) => d[1] === convertedKey);
1669
1670
  if (!dpEntry || !dpEntry[1]) {
1670
- throw new Error(`No datapoint defined for '${key}'`);
1671
+ throw new Error(`No datapoint defined for '${attr}'`);
1671
1672
  }
1672
1673
  if (dpEntry[3] && dpEntry[3].skip && dpEntry[3].skip(meta)) continue;
1673
1674
  const dpId = dpEntry[0];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "15.0.114",
3
+ "version": "15.0.115",
4
4
  "description": "Collection of device converters to be used with zigbee-herdsman",
5
5
  "main": "index.js",
6
6
  "files": [