zigbee-herdsman-converters 14.0.341 → 14.0.342

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.
@@ -20,6 +20,21 @@ module.exports = [
20
20
  device.skipDefaultResponse = true;
21
21
  },
22
22
  },
23
+ {
24
+ zigbeeModel: ['SWITCH-ZR02'],
25
+ model: 'SWITCH-ZR02',
26
+ vendor: 'eWeLink',
27
+ description: 'Zigbee smart switch',
28
+ extend: extend.switch(),
29
+ fromZigbee: [fz.on_off_skip_duplicate_transaction],
30
+ configure: async (device, coordinatorEndpoint, logger) => {
31
+ const endpoint = device.getEndpoint(1);
32
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
33
+ },
34
+ onEvent: async (type, data, device) => {
35
+ device.skipDefaultResponse = true;
36
+ },
37
+ },
23
38
  {
24
39
  zigbeeModel: ['ZB-SW01'],
25
40
  model: 'ZB-SW01',
package/devices/ikea.js CHANGED
@@ -32,6 +32,18 @@ const bulbOnEvent = async (type, data, device) => {
32
32
  }
33
33
  };
34
34
 
35
+ const configureRemote = async (device, coordinatorEndpoint, logger) => {
36
+ // Firmware 2.3.75 >= only supports binding to endpoint, before only to group
37
+ // - https://github.com/Koenkk/zigbee2mqtt/issues/2772#issuecomment-577389281
38
+ // - https://github.com/Koenkk/zigbee2mqtt/issues/7716
39
+ const endpoint = device.getEndpoint(1);
40
+ const version = device.softwareBuildID.split('.').map((n) => Number(n));
41
+ const bindTarget = version[0] >= 2 && version[1] >= 3 && version[2] >= 75 ? coordinatorEndpoint : constants.defaultBindGroup;
42
+ await endpoint.bind('genOnOff', bindTarget);
43
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']);
44
+ await reporting.batteryPercentageRemaining(endpoint);
45
+ };
46
+
35
47
  const tradfriExtend = {
36
48
  light_onoff_brightness: (options = {}) => ({
37
49
  ...extend.light_onoff_brightness(options),
@@ -518,14 +530,7 @@ module.exports = [
518
530
  toZigbee: [],
519
531
  ota: ota.tradfri,
520
532
  meta: {battery: {dontDividePercentage: true}},
521
- configure: async (device, coordinatorEndpoint, logger) => {
522
- const endpoint = device.getEndpoint(1);
523
- // See explanation in E1743, only applies to E1810 (for E1524 it has no effect)
524
- // https://github.com/Koenkk/zigbee2mqtt/issues/2772#issuecomment-577389281
525
- await endpoint.bind('genOnOff', constants.defaultBindGroup);
526
- await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']);
527
- await reporting.batteryPercentageRemaining(endpoint);
528
- },
533
+ configure: configureRemote,
529
534
  },
530
535
  {
531
536
  zigbeeModel: ['Remote Control N2'],
@@ -540,12 +545,7 @@ module.exports = [
540
545
  toZigbee: [],
541
546
  ota: ota.tradfri,
542
547
  meta: {battery: {dontDividePercentage: true}},
543
- configure: async (device, coordinatorEndpoint, logger) => {
544
- const endpoint = device.getEndpoint(1);
545
- await endpoint.bind('genOnOff', constants.defaultBindGroup);
546
- await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']);
547
- await reporting.batteryPercentageRemaining(endpoint);
548
- },
548
+ configure: configureRemote,
549
549
  },
550
550
  {
551
551
  zigbeeModel: ['TRADFRI on/off switch'],
@@ -558,16 +558,7 @@ module.exports = [
558
558
  toZigbee: [],
559
559
  ota: ota.tradfri,
560
560
  meta: {disableActionGroup: true, battery: {dontDividePercentage: true}},
561
- configure: async (device, coordinatorEndpoint, logger) => {
562
- const endpoint = device.getEndpoint(1);
563
- // By default this device controls group 0, some devices are by default in
564
- // group 0 causing the remote to control them.
565
- // By binding it to a random group, e.g. 901, it will send the commands to group 901 instead of 0
566
- // https://github.com/Koenkk/zigbee2mqtt/issues/2772#issuecomment-577389281
567
- await endpoint.bind('genOnOff', constants.defaultBindGroup);
568
- await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']);
569
- await reporting.batteryPercentageRemaining(endpoint);
570
- },
561
+ configure: configureRemote,
571
562
  },
572
563
  {
573
564
  zigbeeModel: ['KNYCKLAN Open/Close remote'],
@@ -579,16 +570,7 @@ module.exports = [
579
570
  toZigbee: [],
580
571
  ota: ota.tradfri,
581
572
  meta: {disableActionGroup: true, battery: {dontDividePercentage: true}},
582
- configure: async (device, coordinatorEndpoint, logger) => {
583
- const endpoint = device.getEndpoint(1);
584
- // By default this device controls group 0, some devices are by default in
585
- // group 0 causing the remote to control them.
586
- // By binding it to a random group, e.g. 901, it will send the commands to group 901 instead of 0
587
- // https://github.com/Koenkk/zigbee2mqtt/issues/2772#issuecomment-577389281
588
- await endpoint.bind('genOnOff', constants.defaultBindGroup);
589
- await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']);
590
- await reporting.batteryPercentageRemaining(endpoint);
591
- },
573
+ configure: configureRemote,
592
574
  },
593
575
  {
594
576
  zigbeeModel: ['KNYCKLAN receiver'],
@@ -613,14 +595,7 @@ module.exports = [
613
595
  toZigbee: [],
614
596
  ota: ota.tradfri,
615
597
  meta: {disableActionGroup: true, battery: {dontDividePercentage: true}},
616
- configure: async (device, coordinatorEndpoint, logger) => {
617
- const endpoint = device.getEndpoint(1);
618
- // By default this device controls group 0, some devices are by default in
619
- // group 0 causing the remote to control them.
620
- // By binding it to a random group, e.g. 901, it will send the commands to group 901 instead of 0
621
- await reporting.bind(endpoint, constants.defaultBindGroup, ['genPowerCfg']);
622
- await reporting.batteryPercentageRemaining(endpoint);
623
- },
598
+ configure: configureRemote,
624
599
  },
625
600
  {
626
601
  zigbeeModel: ['SYMFONISK Sound Controller'],
@@ -722,16 +697,7 @@ module.exports = [
722
697
  toZigbee: [],
723
698
  meta: {battery: {dontDividePercentage: true}},
724
699
  ota: ota.tradfri,
725
- configure: async (device, coordinatorEndpoint, logger) => {
726
- const endpoint = device.getEndpoint(1);
727
- // By default this device controls group 0, some devices are by default in
728
- // group 0 causing the remote to control them.
729
- // By binding it to a random group, e.g. 901, it will send the commands to group 901 instead of 0
730
- // https://github.com/Koenkk/zigbee2mqtt/issues/2772#issuecomment-577389281
731
- await endpoint.bind('genOnOff', constants.defaultBindGroup);
732
- await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']);
733
- await reporting.batteryPercentageRemaining(endpoint);
734
- },
700
+ configure: configureRemote,
735
701
  },
736
702
  {
737
703
  zigbeeModel: ['GUNNARP panel round'],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "14.0.341",
3
+ "version": "14.0.342",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "14.0.341",
3
+ "version": "14.0.342",
4
4
  "description": "Collection of device converters to be used with zigbee-herdsman",
5
5
  "main": "index.js",
6
6
  "files": [