matterbridge-zigbee2mqtt 3.0.0-dev-20251104-7b2d54f → 3.0.0-dev-20251104-5e2e4cd

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
@@ -8,11 +8,13 @@ If you like this project and find it useful, please consider giving it a star on
8
8
  <img src="bmc-button.svg" alt="Buy me a coffee" width="120">
9
9
  </a>
10
10
 
11
- ## [3.0.0] - 2025-11-03
11
+ ## [3.0.0] - 2025-11-04
12
12
 
13
13
  ### Added
14
14
 
15
15
  - [tvoc]: Added voc_index to the converter. Thanks Funca (https://github.com/Luligu/matterbridge-zigbee2mqtt/issues/129).
16
+ - [cover]: Added check for reverse_direction === 'back' and reverse_direction === true (https://github.com/Luligu/matterbridge-zigbee2mqtt/issues/121 and https://github.com/Luligu/matterbridge-zigbee2mqtt/issues/131).
17
+ - [test]: Improved test coverage to 85%.
16
18
 
17
19
  ### Changed
18
20
 
package/README.md CHANGED
@@ -125,6 +125,8 @@ matterbridge
125
125
 
126
126
  # Config file
127
127
 
128
+ All configurations can (and should) be done with the frontend.
129
+
128
130
  If needed you can configure the mqtt host, port, topic, username and password.
129
131
 
130
132
  If the whiteList is defined only the devices included are exposed to Matter.
@@ -153,15 +155,16 @@ These are the default vules:
153
155
  {
154
156
  "name": "matterbridge-zigbee2mqtt",
155
157
  "type": "DynamicPlatform",
158
+ "version": "3.0.0",
156
159
  "host": "mqtt://localhost",
157
160
  "port": 1883,
158
161
  "protocolVersion": 5,
159
162
  "topic": "zigbee2mqtt",
160
163
  "username": "",
161
164
  "password": "",
162
- "ca": undefined,
163
- "cert": undefined,
164
- "key": undefined,
165
+ "ca": "",
166
+ "cert": "",
167
+ "key": "",
165
168
  "rejectUnauthorized": true,
166
169
  "whiteList": [],
167
170
  "blackList": [],
package/dist/entity.js CHANGED
@@ -152,7 +152,7 @@ export class ZigbeeEntity extends EventEmitter {
152
152
  this.updateAttributeIfChanged(this.bridgedDevice, undefined, WindowCovering.Cluster.id, 'currentPositionLiftPercent100ths', value * 100);
153
153
  }
154
154
  if (key === 'moving' && this.isDevice) {
155
- const reversed = this.lastPayload.motor_direction === 'reversed';
155
+ const reversed = this.isCoverReversed();
156
156
  if (reversed && (value === 'UP' || value === 'DOWN')) {
157
157
  value = reversed ? (value === 'UP' ? 'DOWN' : 'UP') : value;
158
158
  }
@@ -237,6 +237,9 @@ export class ZigbeeEntity extends EventEmitter {
237
237
  this.mutableDevice.clear();
238
238
  this.propertyMap.clear();
239
239
  }
240
+ isCoverReversed() {
241
+ return this.lastPayload.motor_direction === 'reversed' || this.lastPayload.reverse_direction === 'back' || this.lastPayload.reverse_direction === true;
242
+ }
240
243
  cachePublish(command = 'unknown', payload, transitionTime) {
241
244
  if (command === 'moveToColorTemperature') {
242
245
  delete this.cachePayload['color'];
@@ -1318,7 +1321,7 @@ export class ZigbeeDevice extends ZigbeeEntity {
1318
1321
  }
1319
1322
  if (zigbeeDevice.bridgedDevice.hasClusterServer(WindowCoveringCluster.id)) {
1320
1323
  zigbeeDevice.bridgedDevice.addCommandHandler('upOrOpen', async () => {
1321
- const reversed = zigbeeDevice.lastPayload.motor_direction === 'reversed';
1324
+ const reversed = zigbeeDevice.isCoverReversed();
1322
1325
  if (reversed)
1323
1326
  zigbeeDevice.log.debug(`Device ${zigbeeDevice.ien}${device.friendly_name}${rs}${db} has reversed motor direction. Commands will be reversed.`);
1324
1327
  zigbeeDevice.log.debug(`Command upOrOpen called for ${zigbeeDevice.ien}${device.friendly_name}${rs}${db}`);
@@ -1329,7 +1332,7 @@ export class ZigbeeDevice extends ZigbeeEntity {
1329
1332
  zigbeeDevice.publishCommand('upOrOpen', device.friendly_name, { state: reversed ? 'CLOSE' : 'OPEN' });
1330
1333
  });
1331
1334
  zigbeeDevice.bridgedDevice.addCommandHandler('downOrClose', async () => {
1332
- const reversed = zigbeeDevice.lastPayload.motor_direction === 'reversed';
1335
+ const reversed = zigbeeDevice.isCoverReversed();
1333
1336
  if (reversed)
1334
1337
  zigbeeDevice.log.debug(`Device ${zigbeeDevice.ien}${device.friendly_name}${rs}${db} has reversed motor direction. Commands will be reversed.`);
1335
1338
  zigbeeDevice.log.debug(`Command downOrClose called for ${zigbeeDevice.ien}${device.friendly_name}${rs}${db}`);
@@ -1345,7 +1348,7 @@ export class ZigbeeDevice extends ZigbeeEntity {
1345
1348
  zigbeeDevice.publishCommand('stopMotion', device.friendly_name, { state: 'STOP' });
1346
1349
  });
1347
1350
  zigbeeDevice.bridgedDevice.addCommandHandler('goToLiftPercentage', async ({ request: { liftPercent100thsValue } }) => {
1348
- const reversed = zigbeeDevice.lastPayload.motor_direction === 'reversed';
1351
+ const reversed = zigbeeDevice.isCoverReversed();
1349
1352
  if (reversed)
1350
1353
  zigbeeDevice.log.debug(`Device ${zigbeeDevice.ien}${device.friendly_name}${rs}${db} has reversed motor direction. Commands will be reversed.`);
1351
1354
  if (reversed)
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "matterbridge-zigbee2mqtt",
3
3
  "type": "DynamicPlatform",
4
- "version": "2.9.0",
4
+ "version": "3.0.0",
5
5
  "host": "mqtt://localhost",
6
6
  "port": 1883,
7
7
  "protocolVersion": 5,
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "matterbridge-zigbee2mqtt",
3
- "version": "3.0.0-dev-20251104-7b2d54f",
3
+ "version": "3.0.0-dev-20251104-5e2e4cd",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "matterbridge-zigbee2mqtt",
9
- "version": "3.0.0-dev-20251104-7b2d54f",
9
+ "version": "3.0.0-dev-20251104-5e2e4cd",
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
12
  "mqtt": "5.14.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "matterbridge-zigbee2mqtt",
3
- "version": "3.0.0-dev-20251104-7b2d54f",
3
+ "version": "3.0.0-dev-20251104-5e2e4cd",
4
4
  "description": "Matterbridge zigbee2mqtt plugin",
5
5
  "author": "https://github.com/Luligu",
6
6
  "license": "Apache-2.0",