zigbee-herdsman-converters 15.0.90 → 15.0.91

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.
package/devices/bosch.js CHANGED
@@ -4,6 +4,7 @@ const fz = require('../converters/fromZigbee');
4
4
  const tz = require('../converters/toZigbee');
5
5
  const reporting = require('../lib/reporting');
6
6
  const utils = require('../lib/utils');
7
+ const extend = require('../lib/extend');
7
8
  const constants = require('../lib/constants');
8
9
  const ota = require('../lib/ota');
9
10
  const e = exposes.presets;
@@ -737,6 +738,32 @@ const definition = [
737
738
  },
738
739
  exposes: [e.switch(), e.power_on_behavior(), e.power(), e.energy()],
739
740
  },
741
+ {
742
+ zigbeeModel: ['RBSH-MMS-ZB-EU'],
743
+ model: 'BMCT-SLZ',
744
+ vendor: 'Bosch',
745
+ description: 'Light/shutter control II',
746
+ extend: extend.switch(),
747
+ exposes: [e.switch().withEndpoint('l1'), e.switch().withEndpoint('l2')],
748
+ endpoint: (device) => {
749
+ return {'l1': 2, 'l2': 3};
750
+ },
751
+ meta: {multiEndpoint: true},
752
+ configure: async (device, coordinatorEndpoint, logger) => {
753
+ // Configuration values:
754
+ // 0x0000 0x0001
755
+ // Roller Shutter 1 3
756
+ // Window Blind 2 3
757
+ // Light Switch 4 3
758
+
759
+ // Configure device as dual switch.
760
+ // Device will perform a rejoin after this write
761
+ await device.getEndpoint(1).write(0xfca0, {0x0000: {value: 0x04, type: 0x30}, 0x0001: {value: 0x03, type: 0x30}});
762
+
763
+ await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
764
+ await reporting.bind(device.getEndpoint(3), coordinatorEndpoint, ['genOnOff']);
765
+ },
766
+ },
740
767
  ];
741
768
 
742
769
  module.exports = definition;
@@ -0,0 +1,79 @@
1
+ const exposes = require('../lib/exposes');
2
+ const fz = require('../converters/fromZigbee');
3
+ const tz = require('../converters/toZigbee');
4
+ const reporting = require('../lib/reporting');
5
+ const e = exposes.presets;
6
+ const ota = require('../lib/ota');
7
+
8
+ module.exports = [
9
+ {
10
+ zigbeeModel: ['HC-SLM-1'],
11
+ model: 'HC-SLM-1',
12
+ vendor: 'Heimgard Technologies',
13
+ description: 'Wattle door lock pro',
14
+ fromZigbee: [fz.lock, fz.battery],
15
+ toZigbee: [tz.lock, tz.lock_auto_relock_time, tz.lock_sound_volume],
16
+ ota: ota.zigbeeOTA,
17
+ configure: async (device, coordinatorEndpoint, logger) => {
18
+ const endpoint = device.getEndpoint(1);
19
+ await reporting.bind(endpoint, coordinatorEndpoint, ['closuresDoorLock', 'genPowerCfg']);
20
+ await reporting.lockState(endpoint);
21
+ await reporting.batteryPercentageRemaining(endpoint);
22
+ await endpoint.read('closuresDoorLock', ['lockState', 'soundVolume']);
23
+ },
24
+ exposes: [
25
+ e.lock(), e.battery(), e.auto_relock_time().withValueMin(0).withValueMax(3600), e.sound_volume()],
26
+ },
27
+ {
28
+ zigbeeModel: ['HC-IWDIM-1'],
29
+ model: 'HC-IWDIM-1',
30
+ vendor: 'Heimgard Technologies',
31
+ description: 'Dimmer',
32
+ fromZigbee: [fz.on_off, fz.brightness, fz.electrical_measurement, fz.metering],
33
+ toZigbee: [tz.on_off, tz.light_brightness_move, tz.light_onoff_brightness],
34
+ ota: ota.zigbeeOTA,
35
+ exposes: [e.light_brightness(), e.power(), e.current(), e.voltage(), e.energy()],
36
+ configure: async (device, coordinatorEndpoint, logger) => {
37
+ const endpoint = device.getEndpoint(1);
38
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl', 'haElectricalMeasurement', 'seMetering']);
39
+ await reporting.rmsVoltage(endpoint, {change: 2});
40
+ await reporting.rmsCurrent(endpoint, {change: 5});
41
+ await reporting.activePower(endpoint, {change: 2});
42
+ await reporting.currentSummDelivered(endpoint, 2);
43
+ await reporting.onOff(endpoint);
44
+ await endpoint.read('haElectricalMeasurement', ['acVoltageMultiplier', 'acVoltageDivisor']);
45
+ await endpoint.read('haElectricalMeasurement', ['acCurrentMultiplier', 'acCurrentDivisor']);
46
+ await endpoint.read('haElectricalMeasurement', ['acPowerMultiplier', 'acPowerDivisor']);
47
+ await endpoint.read('seMetering', ['unitOfMeasure', 'multiplier', 'divisor']);
48
+ device.save();
49
+ },
50
+ },
51
+ {
52
+ zigbeeModel: ['HT-MOT-2'],
53
+ model: 'HT-MOT-2',
54
+ vendor: 'Heimgard Technologies',
55
+ description: 'Motion sensor',
56
+ fromZigbee: [fz.ias_occupancy_alarm_1, fz.ias_occupancy_alarm_1_report, fz.battery],
57
+ toZigbee: [tz.identify],
58
+ exposes: [e.battery(), e.tamper(), e.occupancy()],
59
+ configure: async (device, coordinatorEndpoint, logger) => {
60
+ const endpoint = device.getEndpoint(1);
61
+ await reporting.batteryPercentageRemaining(endpoint);
62
+ await reporting.batteryVoltage(endpoint);
63
+ },
64
+ },
65
+ {
66
+ zigbeeModel: ['HC-IWSWI-1'],
67
+ model: 'HC-IWSWI-1',
68
+ vendor: 'Heimgard Technologies',
69
+ description: 'In wall light switch',
70
+ fromZigbee: [fz.on_off],
71
+ toZigbee: [tz.identify, tz.on_off],
72
+ exposes: [e.switch()],
73
+ configure: async (device, coordinatorEndpoint, logger) => {
74
+ const endpoint = device.getEndpoint(1);
75
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
76
+ await reporting.onOff(endpoint);
77
+ },
78
+ },
79
+ ];
package/devices/tuya.js CHANGED
@@ -721,6 +721,24 @@ const fzLocal = {
721
721
  return result;
722
722
  },
723
723
  },
724
+ TS011F_electrical_measurement: {
725
+ ...fz.electrical_measurement,
726
+ convert: (model, msg, publish, options, meta) => {
727
+ const result = fz.electrical_measurement.convert(model, msg, publish, options, meta);
728
+
729
+ // Skip the first reported 0 values as this may be a false measurement
730
+ // https://github.com/Koenkk/zigbee2mqtt/issues/16709#issuecomment-1509599046
731
+ if (['_TZ3000_gvn91tmx', '_TZ3000_amdymr7l'].includes(meta.device.manufacturerName)) {
732
+ for (const key of ['power', 'current', 'voltage']) {
733
+ if (result[key] === 0 && globalStore.getValue(msg.endpoint, key) !== 0) {
734
+ delete result[key];
735
+ }
736
+ globalStore.putValue(msg.endpoint, key, result[key]);
737
+ }
738
+ }
739
+ return result;
740
+ },
741
+ },
724
742
  };
725
743
 
726
744
  module.exports = [
@@ -1537,6 +1555,37 @@ module.exports = [
1537
1555
  ],
1538
1556
  },
1539
1557
  },
1558
+ {
1559
+ fingerprint: tuya.fingerprint('TS0601', ['_TZE200_mwvfvw8g']),
1560
+ model: 'TS0601_switch_6_gang',
1561
+ vendor: 'TuYa',
1562
+ description: '6 gang switch',
1563
+ fromZigbee: [tuya.fz.datapoints],
1564
+ toZigbee: [tuya.tz.datapoints],
1565
+ configure: tuya.configureMagicPacket,
1566
+ exposes: [
1567
+ tuya.exposes.switch().withEndpoint('l1'),
1568
+ tuya.exposes.switch().withEndpoint('l2'),
1569
+ tuya.exposes.switch().withEndpoint('l3'),
1570
+ tuya.exposes.switch().withEndpoint('l4'),
1571
+ tuya.exposes.switch().withEndpoint('l5'),
1572
+ tuya.exposes.switch().withEndpoint('l6'),
1573
+ ],
1574
+ endpoint: (device) => {
1575
+ return {'l1': 1, 'l2': 1, 'l3': 1, 'l4': 1, 'l5': 1, 'l6': 1};
1576
+ },
1577
+ meta: {
1578
+ multiEndpoint: true,
1579
+ tuyaDatapoints: [
1580
+ [1, 'state_l1', tuya.valueConverter.onOff],
1581
+ [2, 'state_l2', tuya.valueConverter.onOff],
1582
+ [3, 'state_l3', tuya.valueConverter.onOff],
1583
+ [4, 'state_l4', tuya.valueConverter.onOff],
1584
+ [5, 'state_l5', tuya.valueConverter.onOff],
1585
+ [6, 'state_l6', tuya.valueConverter.onOff],
1586
+ ],
1587
+ },
1588
+ },
1540
1589
  {
1541
1590
  fingerprint: [
1542
1591
  {modelID: 'TS0601', manufacturerName: '_TZE200_nkjintbl'},
@@ -2069,7 +2118,7 @@ module.exports = [
2069
2118
  },
2070
2119
  },
2071
2120
  {
2072
- fingerprint: [{modelID: 'TS0004', manufacturerName: '_TZ3000_ltt60asa'}],
2121
+ fingerprint: tuya.fingerprint('TS0004', ['_TZ3000_ltt60asa', '_TZ3000_5ajpkyq6']),
2073
2122
  model: 'TS0004_switch_module',
2074
2123
  vendor: 'TuYa',
2075
2124
  description: '4 gang switch module',
@@ -2652,7 +2701,9 @@ module.exports = [
2652
2701
  {vendor: 'MatSee Plus', model: 'PJ-ZSW01'}, {vendor: 'MODEMIX', model: 'MOD037'}, {vendor: 'MODEMIX', model: 'MOD048'},
2653
2702
  {vendor: 'Coswall', model: 'CS-AJ-DE2U-ZG-11'}, {vendor: 'Aubess', model: 'TS011F_plug_1'}, {vendor: 'Immax', model: '07752L'}],
2654
2703
  ota: ota.zigbeeOTA,
2655
- extend: tuya.extend.switch({electricalMeasurements: true, powerOutageMemory: true, indicatorMode: true, childLock: true}),
2704
+ extend: tuya.extend.switch({
2705
+ electricalMeasurements: true, electricalMeasurementsFzConverter: fzLocal.TS011F_electrical_measurement,
2706
+ powerOutageMemory: true, indicatorMode: true, childLock: true}),
2656
2707
  configure: async (device, coordinatorEndpoint, logger) => {
2657
2708
  await tuya.configureMagicPacket(device, coordinatorEndpoint, logger);
2658
2709
  const endpoint = device.getEndpoint(1);
@@ -2724,7 +2775,7 @@ module.exports = [
2724
2775
  },
2725
2776
  },
2726
2777
  {
2727
- fingerprint: tuya.fingerprint('TS0601', ['_TZE200_ntcy3xu1', '_TZE200_ytibqbra']),
2778
+ fingerprint: tuya.fingerprint('TS0601', ['_TZE200_ntcy3xu1']),
2728
2779
  model: 'TS0601_smoke_1',
2729
2780
  vendor: 'TuYa',
2730
2781
  description: 'Smoke sensor',
@@ -2798,7 +2849,7 @@ module.exports = [
2798
2849
  zigbeeModel: ['5p1vj8r'],
2799
2850
  fingerprint: tuya.fingerprint('TS0601', ['_TZE200_t5p1vj8r', '_TZE200_uebojraa', '_TZE200_vzekyi4c', '_TZE200_yh7aoahi',
2800
2851
  '_TZE200_dnz6yvl2', '_TZE200_dq1mfjug']),
2801
- model: 'TS0601_smoke',
2852
+ model: 'TS0601_smoke_4',
2802
2853
  vendor: 'TuYa',
2803
2854
  description: 'Smoke sensor',
2804
2855
  fromZigbee: [tuya.fz.datapoints],
@@ -2812,6 +2863,27 @@ module.exports = [
2812
2863
  ],
2813
2864
  },
2814
2865
  },
2866
+ {
2867
+ fingerprint: tuya.fingerprint('TS0601', ['_TZE200_ytibqbra']),
2868
+ model: 'TS0601_smoke_5',
2869
+ vendor: 'TuYa',
2870
+ description: 'Smoke sensor',
2871
+ fromZigbee: [tuya.fz.datapoints],
2872
+ toZigbee: [tuya.tz.datapoints],
2873
+ configure: tuya.configureMagicPacket,
2874
+ exposes: [e.smoke(), e.tamper(), e.battery(), tuya.exposes.faultAlarm(),
2875
+ tuya.exposes.silence(), exposes.binary('alarm', ea.STATE_SET, 'ON', 'OFF').withDescription('Enable the alarm')],
2876
+ meta: {
2877
+ tuyaDatapoints: [
2878
+ [1, 'smoke', tuya.valueConverter.trueFalse0],
2879
+ [4, 'tamper', tuya.valueConverter.raw],
2880
+ [11, 'fault_alarm', tuya.valueConverter.trueFalse1],
2881
+ [15, 'battery', tuya.valueConverter.raw],
2882
+ [16, 'silence', tuya.valueConverter.raw],
2883
+ [17, 'alarm', tuya.valueConverter.onOff],
2884
+ ],
2885
+ },
2886
+ },
2815
2887
  {
2816
2888
  fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_5d3vhjro'}],
2817
2889
  model: 'SA12IZL',
package/devices/xiaomi.js CHANGED
@@ -3155,6 +3155,24 @@ module.exports = [
3155
3155
  exposes: [e.battery(), e.battery_voltage(), e.action(['single', 'double', 'hold', 'release']),
3156
3156
  e.device_temperature(), e.power_outage_count()],
3157
3157
  },
3158
+ {
3159
+ zigbeeModel: ['lumi.remote.b286acn03'],
3160
+ model: 'WXKG04LM',
3161
+ vendor: 'Xiaomi',
3162
+ description: 'Aqara T1 double rocker wireless remote switch',
3163
+ meta: {battery: {voltageToPercentage: '3V_2850_3000'}},
3164
+ fromZigbee: [fz.xiaomi_basic, fz.aqara_opple_multistate, fz.aqara_opple],
3165
+ toZigbee: [],
3166
+ endpoint: (device) => {
3167
+ return {left: 1, right: 2, both: 3};
3168
+ },
3169
+ exposes: [e.battery(), e.battery_voltage(), e.action([
3170
+ 'button_1_hold', 'button_1_release', 'button_1_single', 'button_1_double', 'button_1_triple',
3171
+ 'button_2_hold', 'button_2_release', 'button_2_single', 'button_2_double', 'button_2_triple',
3172
+ 'button_3_hold', 'button_3_release', 'button_3_single', 'button_3_double', 'button_3_triple',
3173
+ ])],
3174
+ ota: ota.zigbeeOTA,
3175
+ },
3158
3176
  {
3159
3177
  zigbeeModel: ['lumi.remote.cagl02'],
3160
3178
  model: 'CTP-R01',
package/lib/tuya.js CHANGED
@@ -1909,7 +1909,7 @@ const tuyaExtend = {
1909
1909
  }
1910
1910
 
1911
1911
  if (options.electricalMeasurements) {
1912
- fromZigbee.push(fz.electrical_measurement, fz.metering);
1912
+ fromZigbee.push((options.electricalMeasurementsFzConverter || fz.electrical_measurement), fz.metering);
1913
1913
  exposes.push(e.power(), e.current(), e.voltage(), e.energy());
1914
1914
  }
1915
1915
  if (options.childLock) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "15.0.90",
3
+ "version": "15.0.91",
4
4
  "description": "Collection of device converters to be used with zigbee-herdsman",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -38,7 +38,7 @@
38
38
  "buffer-crc32": "^0.2.13",
39
39
  "https-proxy-agent": "^5.0.1",
40
40
  "tar-stream": "^3.0.0",
41
- "zigbee-herdsman": "^0.14.105"
41
+ "zigbee-herdsman": "^0.14.107"
42
42
  },
43
43
  "devDependencies": {
44
44
  "eslint": "*",
@@ -1,27 +0,0 @@
1
- const exposes = require('../lib/exposes');
2
- const fz = require('../converters/fromZigbee');
3
- const tz = require('../converters/toZigbee');
4
- const reporting = require('../lib/reporting');
5
- const e = exposes.presets;
6
- const ota = require('../lib/ota');
7
-
8
- module.exports = [
9
- {
10
- zigbeeModel: ['HC-SLM-1'],
11
- model: 'HC-SLM-1',
12
- vendor: 'Home Control AS',
13
- description: 'Heimgard (Wattle) door lock pro',
14
- fromZigbee: [fz.lock, fz.battery],
15
- toZigbee: [tz.lock, tz.lock_auto_relock_time, tz.lock_sound_volume],
16
- ota: ota.zigbeeOTA,
17
- configure: async (device, coordinatorEndpoint, logger) => {
18
- const endpoint = device.getEndpoint(1);
19
- await reporting.bind(endpoint, coordinatorEndpoint, ['closuresDoorLock', 'genPowerCfg']);
20
- await reporting.lockState(endpoint);
21
- await reporting.batteryPercentageRemaining(endpoint);
22
- await endpoint.read('closuresDoorLock', ['lockState', 'soundVolume']);
23
- },
24
- exposes: [
25
- e.lock(), e.battery(), e.auto_relock_time().withValueMin(0).withValueMax(3600), e.sound_volume()],
26
- },
27
- ];