matterbridge-zigbee2mqtt 2.5.0-dev.4 → 2.5.0-dev.6

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
@@ -17,7 +17,7 @@ New device types:
17
17
  - rainSensor
18
18
  - smokeSensor
19
19
 
20
- If your controller has issues detecting the new device type, blacklist these devices, restart, wait 5 minutes that the controller removes them, remove the blacklist and restart again. This will create a new endpoint on the controller.
20
+ If your controller has issues detecting the new device type, blacklist these devices, restart, wait 5 minutes that the controller removes them, remove the blacklist and restart again. This will create a new endpoint on the controller and the controllers will likely remove and recreate all the devices so make a backup of configurations (i.e. room assignements) and automations on the controller.
21
21
 
22
22
  ## [2.5.0] - 2025-05-23
23
23
 
@@ -27,10 +27,10 @@ If your controller has issues detecting the new device type, blacklist these dev
27
27
  - [waterLeak]: Added waterLeakDetector device type for zigbee property "water_leak". Default to false (i.e. no alarm) since is not possible to get the property.
28
28
  - [rainSensor]: Added rainSensor device type for zigbee property "rain". Default to false (i.e. no alarm) since is not possible to get the property.
29
29
  - [smokeSensor]: Added smokeSensor device type for zigbee property "smoke". Default to false (i.e. no alarm) since is not possible to get the property.
30
- - [colorTemp]: Added conversion from color temperature to rgb for the rgb devices that don't support color temperature.
30
+ - [colorTemp]: Added conversion from color temperature to rgb for the rgb devices that don't support color_temp.
31
31
  - [battery]: Set batChargeLevel to warning if battery is less than 40% and the device doesn't expose battery_low.
32
32
  - [battery]: Set batChargeLevel to critical if battery is less than 20% and the device doesn't expose battery_low.
33
- - [retain]: Send retained mqtt states at startup if z2m has retain enabled.
33
+ - [retain]: Send retained mqtt states at startup if z2m has retain enabled. See the README.md for explanations.
34
34
  - [logger]: Added onChangeLoggerLevel() to the platform.
35
35
 
36
36
  ### Changed
@@ -40,7 +40,12 @@ If your controller has issues detecting the new device type, blacklist these dev
40
40
  - [plugin]: Requires Matterbridge 3.0.3.
41
41
  - [config]: As anticipated in the previous release, the parameter postfixHostname has been removed. Use postfix if needed.
42
42
  - [colorRgb]: Changed the default device type from colorTemperatureLight to extendedColorLight to solve the SmartThings issue with colors.
43
- - [colorTemp]: The min and max mired values are now set in the cluster.
43
+ - [colorTemp]: The min and max mired values for color_temp are now set in the cluster.
44
+
45
+ ### Fixed
46
+
47
+ - [logger]: Fixed logger not always taking the correct value from the frontend.
48
+ - [issue104]: Solved wrong mode AUTO in system_mode for HEAT only devices.
44
49
 
45
50
  <a href="https://www.buymeacoffee.com/luligugithub">
46
51
  <img src="bmc-button.svg" alt="Buy me a coffee" width="80">
package/dist/entity.js CHANGED
@@ -50,7 +50,7 @@ export class ZigbeeEntity extends EventEmitter {
50
50
  this.en = gn;
51
51
  this.ien = ign;
52
52
  }
53
- this.log = new AnsiLogger({ logName: this.entityName, logTimestampFormat: 4, logLevel: platform.debugEnabled ? "debug" : "info" });
53
+ this.log = new AnsiLogger({ logName: this.entityName, logTimestampFormat: 4, logLevel: platform.debugEnabled ? "debug" : platform.log.logLevel });
54
54
  this.log.debug(`Created MatterEntity: ${this.entityName}`);
55
55
  this.platform.z2m.on('MESSAGE-' + this.entityName, (payload) => {
56
56
  const now = Date.now();
@@ -106,6 +106,10 @@ export class ZigbeeEntity extends EventEmitter {
106
106
  if (!z2m)
107
107
  z2m = z2ms.find((z2m) => z2m.property === propertyMap?.name);
108
108
  if (z2m) {
109
+ if (z2m.valueLookup && propertyMap.values && propertyMap.values !== '' && typeof value === 'string' && !propertyMap.values.includes(value)) {
110
+ this.log.debug(`*Payload entry ${CYAN}${key}${db} value ${CYAN}${value}${db} not found in propertyMap values ${CYAN}${propertyMap.values}${db}`);
111
+ return;
112
+ }
109
113
  if (z2m.converter || z2m.valueLookup) {
110
114
  this.updateAttributeIfChanged(this.bridgedDevice, propertyMap === undefined || propertyMap.endpoint === '' ? undefined : propertyMap.endpoint, z2m.cluster, z2m.attribute, z2m.converter ? z2m.converter(value) : value, z2m.valueLookup);
111
115
  return;
@@ -130,6 +134,10 @@ export class ZigbeeEntity extends EventEmitter {
130
134
  this.updateAttributeIfChanged(this.bridgedDevice, undefined, WindowCovering.Cluster.id, 'currentPositionLiftPercent100ths', value * 100);
131
135
  }
132
136
  if (key === 'moving' && this.isDevice) {
137
+ const reversed = this.lastPayload.motor_direction === 'reversed';
138
+ if (reversed && (value === 'UP' || value === 'DOWN')) {
139
+ value = reversed ? (value === 'UP' ? 'DOWN' : 'UP') : value;
140
+ }
133
141
  if (value === 'UP') {
134
142
  const status = WindowCovering.MovementStatus.Opening;
135
143
  this.updateAttributeIfChanged(this.bridgedDevice, undefined, WindowCovering.Cluster.id, 'operationalStatus', { global: status, lift: status, tilt: status });
@@ -1016,11 +1024,17 @@ export class ZigbeeDevice extends ZigbeeEntity {
1016
1024
  zigbeeDevice.propertyMap.delete('running_state');
1017
1025
  zigbeeDevice.bridgedDevice.createDefaultHeatingThermostatClusterServer(undefined, undefined, minHeating, maxHeating);
1018
1026
  mainEndpoint.clusterServersIds.splice(mainEndpoint.clusterServersIds.indexOf(Thermostat.Cluster.id), 1);
1027
+ const sMode = zigbeeDevice.propertyMap.get('system_mode');
1028
+ if (sMode)
1029
+ sMode.values = 'off|heat';
1019
1030
  }
1020
1031
  else if ((!heat && cool) || (!system_mode_values?.includes('auto') && system_mode_values?.includes('cool'))) {
1021
1032
  zigbeeDevice.propertyMap.delete('running_state');
1022
1033
  zigbeeDevice.bridgedDevice.createDefaultCoolingThermostatClusterServer(undefined, undefined, minCooling, maxCooling);
1023
1034
  mainEndpoint.clusterServersIds.splice(mainEndpoint.clusterServersIds.indexOf(Thermostat.Cluster.id), 1);
1035
+ const sMode = zigbeeDevice.propertyMap.get('system_mode');
1036
+ if (sMode)
1037
+ sMode.values = 'off|cool';
1024
1038
  }
1025
1039
  else {
1026
1040
  zigbeeDevice.bridgedDevice.createDefaultThermostatClusterServer(undefined, undefined, undefined, undefined, minHeating, maxHeating, minCooling, maxCooling);
@@ -1183,21 +1197,22 @@ export class ZigbeeDevice extends ZigbeeEntity {
1183
1197
  });
1184
1198
  }
1185
1199
  if (zigbeeDevice.bridgedDevice.hasClusterServer(WindowCoveringCluster.id)) {
1200
+ const reversed = zigbeeDevice.lastPayload.motor_direction === 'reversed';
1186
1201
  zigbeeDevice.bridgedDevice.addCommandHandler('upOrOpen', async () => {
1187
1202
  zigbeeDevice.log.debug(`Command upOrOpen called for ${zigbeeDevice.ien}${device.friendly_name}${rs}${db}`);
1188
- if (zigbeeDevice.isDevice && zigbeeDevice.propertyMap.has('position'))
1189
- await zigbeeDevice.bridgedDevice?.setAttribute(WindowCoveringCluster.id, 'targetPositionLiftPercent100ths', 0, zigbeeDevice.log);
1203
+ if (zigbeeDevice.propertyMap.has('position'))
1204
+ await zigbeeDevice.bridgedDevice?.setAttribute(WindowCoveringCluster.id, 'targetPositionLiftPercent100ths', reversed ? 10000 : 0, zigbeeDevice.log);
1190
1205
  else
1191
- await zigbeeDevice.bridgedDevice?.setWindowCoveringTargetAndCurrentPosition(0);
1192
- zigbeeDevice.publishCommand('upOrOpen', device.friendly_name, { state: 'OPEN' });
1206
+ await zigbeeDevice.bridgedDevice?.setWindowCoveringTargetAndCurrentPosition(reversed ? 10000 : 0);
1207
+ zigbeeDevice.publishCommand('upOrOpen', device.friendly_name, { state: reversed ? 'CLOSE' : 'OPEN' });
1193
1208
  });
1194
1209
  zigbeeDevice.bridgedDevice.addCommandHandler('downOrClose', async () => {
1195
1210
  zigbeeDevice.log.debug(`Command downOrClose called for ${zigbeeDevice.ien}${device.friendly_name}${rs}${db}`);
1196
- if (zigbeeDevice.isDevice && zigbeeDevice.propertyMap.has('position'))
1197
- await zigbeeDevice.bridgedDevice?.setAttribute(WindowCoveringCluster.id, 'targetPositionLiftPercent100ths', 10000, zigbeeDevice.log);
1211
+ if (zigbeeDevice.propertyMap.has('position'))
1212
+ await zigbeeDevice.bridgedDevice?.setAttribute(WindowCoveringCluster.id, 'targetPositionLiftPercent100ths', reversed ? 0 : 10000, zigbeeDevice.log);
1198
1213
  else
1199
- await zigbeeDevice.bridgedDevice?.setWindowCoveringTargetAndCurrentPosition(10000);
1200
- zigbeeDevice.publishCommand('downOrClose', device.friendly_name, { state: 'CLOSE' });
1214
+ await zigbeeDevice.bridgedDevice?.setWindowCoveringTargetAndCurrentPosition(reversed ? 0 : 10000);
1215
+ zigbeeDevice.publishCommand('downOrClose', device.friendly_name, { state: reversed ? 'OPEN' : 'CLOSE' });
1201
1216
  });
1202
1217
  zigbeeDevice.bridgedDevice.addCommandHandler('stopMotion', async () => {
1203
1218
  zigbeeDevice.log.debug(`Command stopMotion called for ${zigbeeDevice.ien}${device.friendly_name}${rs}${db}`);
@@ -1206,7 +1221,7 @@ export class ZigbeeDevice extends ZigbeeEntity {
1206
1221
  });
1207
1222
  zigbeeDevice.bridgedDevice.addCommandHandler('goToLiftPercentage', async ({ request: { liftPercent100thsValue } }) => {
1208
1223
  zigbeeDevice.log.debug(`Command goToLiftPercentage called for ${zigbeeDevice.ien}${device.friendly_name}${rs}${db} request liftPercent100thsValue: ${liftPercent100thsValue}`);
1209
- if (zigbeeDevice.isDevice && zigbeeDevice.propertyMap.has('position'))
1224
+ if (zigbeeDevice.propertyMap.has('position'))
1210
1225
  await zigbeeDevice.bridgedDevice?.setAttribute(WindowCoveringCluster.id, 'targetPositionLiftPercent100ths', liftPercent100thsValue, zigbeeDevice.log);
1211
1226
  else
1212
1227
  await zigbeeDevice.bridgedDevice?.setWindowCoveringTargetAndCurrentPosition(liftPercent100thsValue);
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "matterbridge-zigbee2mqtt",
3
- "version": "2.5.0-dev.4",
3
+ "version": "2.5.0-dev.6",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "matterbridge-zigbee2mqtt",
9
- "version": "2.5.0-dev.4",
9
+ "version": "2.5.0-dev.6",
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
12
  "moment": "2.30.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "matterbridge-zigbee2mqtt",
3
- "version": "2.5.0-dev.4",
3
+ "version": "2.5.0-dev.6",
4
4
  "description": "Matterbridge zigbee2mqtt plugin",
5
5
  "author": "https://github.com/Luligu",
6
6
  "license": "Apache-2.0",