matterbridge-zigbee2mqtt 2.4.5-dev.3 → 2.4.5-dev.4

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
@@ -6,13 +6,17 @@ All notable changes to this project will be documented in this file.
6
6
 
7
7
  ## [2.4.5] - 2025-02-04
8
8
 
9
+ ### Added
10
+
11
+ - [thermostat]: Added fan_only mode (tested by https://github.com/robvanoostenrijk).
12
+
9
13
  ### Changed
10
14
 
11
15
  - [package]: Updated dependencies.
12
16
 
13
17
  ### Fixed
14
18
 
15
- - [endpoint]: Fix thermostat bug (thanks https://github.com/robvanoostenrijk).
19
+ - [thermostat]: Fix thermostat bug (thanks https://github.com/robvanoostenrijk).
16
20
 
17
21
  <a href="https://www.buymeacoffee.com/luligugithub">
18
22
  <img src="./yellow-button.png" alt="Buy me a coffee" width="120">
package/dist/entity.js CHANGED
@@ -29,6 +29,7 @@ export class ZigbeeEntity extends EventEmitter {
29
29
  mutableDevice = new Map();
30
30
  colorTimeout = undefined;
31
31
  thermostatTimeout = undefined;
32
+ thermostatSystemModeLookup = ['off', 'auto', '', 'cool', 'heat', '', '', 'fan_only'];
32
33
  composedType = '';
33
34
  hasEndpoints = false;
34
35
  isRouter = false;
@@ -607,7 +608,7 @@ export const z2ms = [
607
608
  { type: 'climate', name: 'unoccupied_heating_setpoint', property: 'unoccupied_heating_setpoint', deviceType: thermostatDevice, cluster: Thermostat.Cluster.id, attribute: 'occupiedHeatingSetpoint', converter: (value) => { return Math.max(-5000, Math.min(5000, value * 100)); } },
608
609
  { type: 'climate', name: 'unoccupied_cooling_setpoint', property: 'unoccupied_cooling_setpoint', deviceType: thermostatDevice, cluster: Thermostat.Cluster.id, attribute: 'occupiedCoolingSetpoint', converter: (value) => { return Math.max(-5000, Math.min(5000, value * 100)); } },
609
610
  { type: 'climate', name: 'running_state', property: 'running_state', deviceType: thermostatDevice, cluster: Thermostat.Cluster.id, attribute: 'thermostatRunningMode', valueLookup: ['idle', '', '', 'cool', 'heat'] },
610
- { type: 'climate', name: 'system_mode', property: 'system_mode', deviceType: thermostatDevice, cluster: Thermostat.Cluster.id, attribute: 'systemMode', valueLookup: ['off', 'auto', '', 'cool', 'heat'] },
611
+ { type: 'climate', name: 'system_mode', property: 'system_mode', deviceType: thermostatDevice, cluster: Thermostat.Cluster.id, attribute: 'systemMode', valueLookup: ['off', 'auto', '', 'cool', 'heat', '', '', 'fan_only'] },
611
612
  { type: '', name: 'min_temperature_limit', property: 'min_temperature_limit', deviceType: thermostatDevice, cluster: Thermostat.Cluster.id, attribute: 'minHeatSetpointLimit', converter: (value) => { return Math.max(-5000, Math.min(5000, value * 100)); } },
612
613
  { type: '', name: 'max_temperature_limit', property: 'max_temperature_limit', deviceType: thermostatDevice, cluster: Thermostat.Cluster.id, attribute: 'maxHeatSetpointLimit', converter: (value) => { return Math.max(-5000, Math.min(5000, value * 100)); } },
613
614
  { type: '', name: 'min_heat_setpoint_limit', property: 'min_heat_setpoint_limit', deviceType: thermostatDevice, cluster: Thermostat.Cluster.id, attribute: 'minHeatSetpointLimit', converter: (value) => { return Math.max(-5000, Math.min(5000, value * 100)); } },
@@ -1203,13 +1204,15 @@ export class ZigbeeDevice extends ZigbeeEntity {
1203
1204
  }
1204
1205
  });
1205
1206
  zigbeeDevice.bridgedDevice.subscribeAttribute(ThermostatCluster.id, 'systemMode', async (value) => {
1206
- zigbeeDevice.log.debug(`Subscribe systemMode called for ${zigbeeDevice.ien}${device.friendly_name}${rs}${db} with:`, value);
1207
- const system_mode = value === Thermostat.SystemMode.Off ? 'off' : value === Thermostat.SystemMode.Heat ? 'heat' : 'cool';
1208
- zigbeeDevice.publishCommand('SystemMode', device.friendly_name, { system_mode });
1209
- zigbeeDevice.noUpdate = true;
1210
- zigbeeDevice.thermostatTimeout = setTimeout(() => {
1211
- zigbeeDevice.noUpdate = false;
1212
- }, 5 * 1000);
1207
+ if (isValidNumber(value, Thermostat.SystemMode.Off, Thermostat.SystemMode.FanOnly) && zigbeeDevice.thermostatSystemModeLookup[value] !== '') {
1208
+ const system_mode = zigbeeDevice.thermostatSystemModeLookup[value];
1209
+ zigbeeDevice.log.debug(`Subscribe systemMode called for ${zigbeeDevice.ien}${device.friendly_name}${rs}${db} with ${value} => ${system_mode}`);
1210
+ zigbeeDevice.publishCommand('SystemMode', device.friendly_name, { system_mode });
1211
+ zigbeeDevice.noUpdate = true;
1212
+ zigbeeDevice.thermostatTimeout = setTimeout(() => {
1213
+ zigbeeDevice.noUpdate = false;
1214
+ }, 5 * 1000);
1215
+ }
1213
1216
  }, zigbeeDevice.log);
1214
1217
  if (zigbeeDevice.bridgedDevice.hasAttributeServer(ThermostatCluster.id, 'occupiedHeatingSetpoint'))
1215
1218
  zigbeeDevice.bridgedDevice.subscribeAttribute(ThermostatCluster.id, 'occupiedHeatingSetpoint', async (value) => {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "matterbridge-zigbee2mqtt",
3
- "version": "2.4.5-dev.3",
3
+ "version": "2.4.5-dev.4",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "matterbridge-zigbee2mqtt",
9
- "version": "2.4.5-dev.3",
9
+ "version": "2.4.5-dev.4",
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.4.5-dev.3",
3
+ "version": "2.4.5-dev.4",
4
4
  "description": "Matterbridge zigbee2mqtt plugin",
5
5
  "author": "https://github.com/Luligu",
6
6
  "license": "Apache-2.0",