matterbridge-zigbee2mqtt 3.0.9 → 3.0.10

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/CHANGELOG.md CHANGED
@@ -26,6 +26,14 @@ If you like this project and find it useful, please consider giving it a star on
26
26
 
27
27
  <a href="https://www.buymeacoffee.com/luligugithub"><img src="https://matterbridge.io/assets/bmc-button.svg" alt="Buy me a coffee" width="120"></a>
28
28
 
29
+ ## [3.0.10] - 2026-03-23
30
+
31
+ ### Fixed
32
+
33
+ - [cover]: Fix command handlers for Matterbridge v.3.7.0. Thanks Henrik (https://github.com/Luligu/matterbridge-zigbee2mqtt/issues/161).
34
+
35
+ <a href="https://www.buymeacoffee.com/luligugithub"><img src="https://matterbridge.io/assets/bmc-button.svg" alt="Buy me a coffee" width="80"></a>
36
+
29
37
  ## [3.0.9] - 2026-03-21
30
38
 
31
39
  ### Added
package/dist/entity.js CHANGED
@@ -770,24 +770,43 @@ export class ZigbeeGroup extends ZigbeeEntity {
770
770
  }
771
771
  if (isCover) {
772
772
  await zigbeeGroup.bridgedDevice.addFixedLabel('type', 'cover');
773
- zigbeeGroup.bridgedDevice.addCommandHandler('upOrOpen', async () => {
773
+ zigbeeGroup.bridgedDevice.addCommandHandler('upOrOpen', async ({ attributes }) => {
774
774
  zigbeeGroup.log.debug(`Command upOrOpen called for ${zigbeeGroup.ien}${group.friendly_name}${rs}${db}`);
775
- await zigbeeGroup.bridgedDevice?.setWindowCoveringCurrentTargetStatus(0, 0, WindowCovering.MovementStatus.Stopped);
775
+ attributes.currentPositionLiftPercent100ths = 0;
776
+ attributes.operationalStatus = {
777
+ global: WindowCovering.MovementStatus.Stopped,
778
+ lift: WindowCovering.MovementStatus.Stopped,
779
+ tilt: WindowCovering.MovementStatus.Stopped,
780
+ };
776
781
  zigbeeGroup.publishCommand('upOrOpen', group.friendly_name, { state: 'OPEN' });
777
782
  });
778
- zigbeeGroup.bridgedDevice.addCommandHandler('downOrClose', async () => {
783
+ zigbeeGroup.bridgedDevice.addCommandHandler('downOrClose', async ({ attributes }) => {
779
784
  zigbeeGroup.log.debug(`Command downOrClose called for ${zigbeeGroup.ien}${group.friendly_name}${rs}${db}`);
780
- await zigbeeGroup.bridgedDevice?.setWindowCoveringCurrentTargetStatus(10000, 10000, WindowCovering.MovementStatus.Stopped);
785
+ attributes.currentPositionLiftPercent100ths = 10000;
786
+ attributes.operationalStatus = {
787
+ global: WindowCovering.MovementStatus.Stopped,
788
+ lift: WindowCovering.MovementStatus.Stopped,
789
+ tilt: WindowCovering.MovementStatus.Stopped,
790
+ };
781
791
  zigbeeGroup.publishCommand('downOrClose', group.friendly_name, { state: 'CLOSE' });
782
792
  });
783
- zigbeeGroup.bridgedDevice.addCommandHandler('stopMotion', async () => {
793
+ zigbeeGroup.bridgedDevice.addCommandHandler('stopMotion', async ({ attributes }) => {
784
794
  zigbeeGroup.log.debug(`Command stopMotion called for ${zigbeeGroup.ien}${group.friendly_name}${rs}${db}`);
785
- await zigbeeGroup.bridgedDevice?.setWindowCoveringTargetAsCurrentAndStopped();
795
+ attributes.operationalStatus = {
796
+ global: WindowCovering.MovementStatus.Stopped,
797
+ lift: WindowCovering.MovementStatus.Stopped,
798
+ tilt: WindowCovering.MovementStatus.Stopped,
799
+ };
786
800
  zigbeeGroup.publishCommand('stopMotion', group.friendly_name, { state: 'STOP' });
787
801
  });
788
- zigbeeGroup.bridgedDevice.addCommandHandler('goToLiftPercentage', async ({ request: { liftPercent100thsValue } }) => {
802
+ zigbeeGroup.bridgedDevice.addCommandHandler('goToLiftPercentage', async ({ request: { liftPercent100thsValue }, attributes }) => {
789
803
  zigbeeGroup.log.debug(`Command goToLiftPercentage called for ${zigbeeGroup.ien}${group.friendly_name}${rs}${db} liftPercent100thsValue: ${liftPercent100thsValue}`);
790
- await zigbeeGroup.bridgedDevice?.setWindowCoveringCurrentTargetStatus(liftPercent100thsValue, liftPercent100thsValue, WindowCovering.MovementStatus.Stopped);
804
+ attributes.currentPositionLiftPercent100ths = liftPercent100thsValue;
805
+ attributes.operationalStatus = {
806
+ global: WindowCovering.MovementStatus.Stopped,
807
+ lift: WindowCovering.MovementStatus.Stopped,
808
+ tilt: WindowCovering.MovementStatus.Stopped,
809
+ };
791
810
  zigbeeGroup.publishCommand('goToLiftPercentage', group.friendly_name, { position: 100 - liftPercent100thsValue / 100 });
792
811
  });
793
812
  }
@@ -926,12 +945,10 @@ export class ZigbeeDevice extends ZigbeeEntity {
926
945
  });
927
946
  zigbeeDevice.bridgedDevice.addCommandHandler('lockDoor', async () => {
928
947
  zigbeeDevice.log.debug(`Command permit_join false called for ${zigbeeDevice.ien}${device.friendly_name}${rs}${db}`);
929
- await zigbeeDevice.bridgedDevice?.setAttribute(DoorLockCluster.id, 'lockState', DoorLock.LockState.Locked, zigbeeDevice.log);
930
948
  zigbeeDevice.publishCommand('permit_join false', 'bridge/request/permit_join', { value: false });
931
949
  });
932
950
  zigbeeDevice.bridgedDevice.addCommandHandler('unlockDoor', async () => {
933
951
  zigbeeDevice.log.debug(`Command permit_join true called for ${zigbeeDevice.ien}${device.friendly_name}${rs}${db}`);
934
- await zigbeeDevice.bridgedDevice?.setAttribute(DoorLockCluster.id, 'lockState', DoorLock.LockState.Unlocked, zigbeeDevice.log);
935
952
  zigbeeDevice.publishCommand('permit_join true', 'bridge/request/permit_join', { value: true });
936
953
  });
937
954
  return zigbeeDevice;
@@ -1351,45 +1368,53 @@ export class ZigbeeDevice extends ZigbeeEntity {
1351
1368
  }
1352
1369
  }
1353
1370
  if (zigbeeDevice.bridgedDevice.hasClusterServer(WindowCoveringCluster.id)) {
1354
- zigbeeDevice.bridgedDevice.addCommandHandler('upOrOpen', async () => {
1371
+ zigbeeDevice.bridgedDevice.addCommandHandler('upOrOpen', async ({ attributes }) => {
1355
1372
  zigbeeDevice.log.debug(`Command upOrOpen called for ${zigbeeDevice.ien}${device.friendly_name}${rs}${db}`);
1356
- if (zigbeeDevice.propertyMap.has('position'))
1357
- await zigbeeDevice.bridgedDevice?.setAttribute(WindowCoveringCluster.id, 'targetPositionLiftPercent100ths', 0, zigbeeDevice.log);
1358
- else
1359
- await zigbeeDevice.bridgedDevice?.setWindowCoveringTargetAndCurrentPosition(0);
1373
+ attributes.currentPositionLiftPercent100ths = 0;
1374
+ attributes.operationalStatus = {
1375
+ global: WindowCovering.MovementStatus.Stopped,
1376
+ lift: WindowCovering.MovementStatus.Stopped,
1377
+ tilt: WindowCovering.MovementStatus.Stopped,
1378
+ };
1360
1379
  zigbeeDevice.publishCommand('upOrOpen', device.friendly_name, { state: 'OPEN' });
1361
1380
  });
1362
- zigbeeDevice.bridgedDevice.addCommandHandler('downOrClose', async () => {
1381
+ zigbeeDevice.bridgedDevice.addCommandHandler('downOrClose', async ({ attributes }) => {
1363
1382
  zigbeeDevice.log.debug(`Command downOrClose called for ${zigbeeDevice.ien}${device.friendly_name}${rs}${db}`);
1364
- if (zigbeeDevice.propertyMap.has('position'))
1365
- await zigbeeDevice.bridgedDevice?.setAttribute(WindowCoveringCluster.id, 'targetPositionLiftPercent100ths', 10000, zigbeeDevice.log);
1366
- else
1367
- await zigbeeDevice.bridgedDevice?.setWindowCoveringTargetAndCurrentPosition(10000);
1383
+ attributes.currentPositionLiftPercent100ths = 10000;
1384
+ attributes.operationalStatus = {
1385
+ global: WindowCovering.MovementStatus.Stopped,
1386
+ lift: WindowCovering.MovementStatus.Stopped,
1387
+ tilt: WindowCovering.MovementStatus.Stopped,
1388
+ };
1368
1389
  zigbeeDevice.publishCommand('downOrClose', device.friendly_name, { state: 'CLOSE' });
1369
1390
  });
1370
- zigbeeDevice.bridgedDevice.addCommandHandler('stopMotion', async () => {
1391
+ zigbeeDevice.bridgedDevice.addCommandHandler('stopMotion', async ({ attributes }) => {
1371
1392
  zigbeeDevice.log.debug(`Command stopMotion called for ${zigbeeDevice.ien}${device.friendly_name}${rs}${db}`);
1372
- await zigbeeDevice.bridgedDevice?.setWindowCoveringTargetAsCurrentAndStopped();
1393
+ attributes.operationalStatus = {
1394
+ global: WindowCovering.MovementStatus.Stopped,
1395
+ lift: WindowCovering.MovementStatus.Stopped,
1396
+ tilt: WindowCovering.MovementStatus.Stopped,
1397
+ };
1373
1398
  zigbeeDevice.publishCommand('stopMotion', device.friendly_name, { state: 'STOP' });
1374
1399
  });
1375
- zigbeeDevice.bridgedDevice.addCommandHandler('goToLiftPercentage', async ({ request: { liftPercent100thsValue } }) => {
1400
+ zigbeeDevice.bridgedDevice.addCommandHandler('goToLiftPercentage', async ({ request: { liftPercent100thsValue }, attributes }) => {
1376
1401
  zigbeeDevice.log.debug(`Command goToLiftPercentage called for ${zigbeeDevice.ien}${device.friendly_name}${rs}${db} request liftPercent100thsValue: ${liftPercent100thsValue}`);
1377
- if (zigbeeDevice.propertyMap.has('position'))
1378
- await zigbeeDevice.bridgedDevice?.setAttribute(WindowCoveringCluster.id, 'targetPositionLiftPercent100ths', liftPercent100thsValue, zigbeeDevice.log);
1379
- else
1380
- await zigbeeDevice.bridgedDevice?.setWindowCoveringTargetAndCurrentPosition(liftPercent100thsValue);
1402
+ attributes.currentPositionLiftPercent100ths = liftPercent100thsValue;
1403
+ attributes.operationalStatus = {
1404
+ global: WindowCovering.MovementStatus.Stopped,
1405
+ lift: WindowCovering.MovementStatus.Stopped,
1406
+ tilt: WindowCovering.MovementStatus.Stopped,
1407
+ };
1381
1408
  zigbeeDevice.publishCommand('goToLiftPercentage', device.friendly_name, { position: (10000 - liftPercent100thsValue) / 100 });
1382
1409
  });
1383
1410
  }
1384
1411
  if (zigbeeDevice.bridgedDevice.hasClusterServer(DoorLockCluster.id)) {
1385
1412
  zigbeeDevice.bridgedDevice.addCommandHandler('lockDoor', async ({ request: request }) => {
1386
1413
  zigbeeDevice.log.debug(`Command lockDoor called for ${zigbeeDevice.ien}${device.friendly_name}${rs}${db}`, request);
1387
- await zigbeeDevice.bridgedDevice?.setAttribute(DoorLockCluster.id, 'lockState', DoorLock.LockState.Locked, zigbeeDevice.log);
1388
1414
  zigbeeDevice.publishCommand('lockDoor', device.friendly_name, { state: 'LOCK' });
1389
1415
  });
1390
1416
  zigbeeDevice.bridgedDevice.addCommandHandler('unlockDoor', async ({ request: request }) => {
1391
1417
  zigbeeDevice.log.debug(`Command unlockDoor called for ${zigbeeDevice.ien}${device.friendly_name}${rs}${db}`, request);
1392
- await zigbeeDevice.bridgedDevice?.setAttribute(DoorLockCluster.id, 'lockState', DoorLock.LockState.Unlocked, zigbeeDevice.log);
1393
1418
  zigbeeDevice.publishCommand('unlockDoor', device.friendly_name, { state: 'UNLOCK' });
1394
1419
  });
1395
1420
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "matterbridge-zigbee2mqtt",
3
- "version": "3.0.9",
3
+ "version": "3.0.10",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "matterbridge-zigbee2mqtt",
9
- "version": "3.0.9",
9
+ "version": "3.0.10",
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
12
  "moment": "2.30.1",
@@ -602,9 +602,9 @@
602
602
  }
603
603
  },
604
604
  "node_modules/ws": {
605
- "version": "8.19.0",
606
- "resolved": "https://registry.npmjs.org/ws/-/ws-8.19.0.tgz",
607
- "integrity": "sha512-blAT2mjOEIi0ZzruJfIhb3nps74PRWTCz1IjglWEEpQl5XS/UNama6u2/rjFkDDouqr4L67ry+1aGIALViWjDg==",
605
+ "version": "8.20.0",
606
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.20.0.tgz",
607
+ "integrity": "sha512-sAt8BhgNbzCtgGbt2OxmpuryO63ZoDk/sqaB/znQm94T4fCEsy/yV+7CdC1kJhOU9lboAEU7R3kquuycDoibVA==",
608
608
  "license": "MIT",
609
609
  "engines": {
610
610
  "node": ">=10.0.0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "matterbridge-zigbee2mqtt",
3
- "version": "3.0.9",
3
+ "version": "3.0.10",
4
4
  "description": "Matterbridge zigbee2mqtt plugin",
5
5
  "author": "https://github.com/Luligu",
6
6
  "license": "Apache-2.0",