matterbridge-zigbee2mqtt 2.4.4-dev.2 → 2.4.5-dev.1

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
@@ -4,11 +4,26 @@ If you like this project and find it useful, please consider giving it a star on
4
4
 
5
5
  All notable changes to this project will be documented in this file.
6
6
 
7
- ## [2.4.4-dev.2] - 2025-02-01
7
+ ## [2.4.5] - 2025-02-04
8
+
9
+ ### Changed
10
+
11
+ - [package]: Updated dependencies.
8
12
 
9
13
  ### Fixed
10
14
 
15
+ - [endpoint]: Fix thermostat bug.
16
+
17
+ <a href="https://www.buymeacoffee.com/luligugithub">
18
+ <img src="./yellow-button.png" alt="Buy me a coffee" width="120">
19
+ </a>
20
+
21
+ ## [2.4.4] - 2025-02-02
22
+
23
+ ### Changed
24
+
11
25
  - [plugin]: Requires Matterbridge 2.1.0.
26
+ - [package]: Updated package.
12
27
  - [package]: Updated dependencies.
13
28
 
14
29
  <a href="https://www.buymeacoffee.com/luligugithub">
@@ -17,7 +32,7 @@ All notable changes to this project will be documented in this file.
17
32
 
18
33
  ## [2.4.3] - 2025-01-20
19
34
 
20
- ### Fixed
35
+ ### Changed
21
36
 
22
37
  - [plugin]: Requires Matterbridge 1.7.3.
23
38
  - [package]: Updated dependencies.
package/dist/entity.js CHANGED
@@ -5,12 +5,8 @@ import * as color from 'matterbridge/utils';
5
5
  import { SwitchesTag, NumberTag } from 'matterbridge/matter';
6
6
  import { getClusterNameById, ClusterId } from 'matterbridge/matter/types';
7
7
  import { ElectricalEnergyMeasurement, ElectricalPowerMeasurement, OnOffCluster, LevelControlCluster, WindowCoveringCluster, DoorLockCluster, BridgedDeviceBasicInformation, OnOff, LevelControl, ColorControl, ColorControlCluster, TemperatureMeasurement, BooleanState, RelativeHumidityMeasurement, PressureMeasurement, OccupancySensing, IlluminanceMeasurement, PowerSource, WindowCovering, DoorLock, ThermostatCluster, Thermostat, AirQuality, TotalVolatileOrganicCompoundsConcentrationMeasurement, CarbonDioxideConcentrationMeasurement, CarbonMonoxideConcentrationMeasurement, FormaldehydeConcentrationMeasurement, Pm1ConcentrationMeasurement, Pm25ConcentrationMeasurement, Pm10ConcentrationMeasurement, } from 'matterbridge/matter/clusters';
8
- import { PowerSourceBehavior } from 'matterbridge/matter/behaviors';
9
8
  import EventEmitter from 'events';
10
9
  import { hostname } from 'os';
11
- function require(type, options) {
12
- return { clusterId: ClusterId(1), options };
13
- }
14
10
  export class ZigbeeEntity extends EventEmitter {
15
11
  log;
16
12
  serial = '';
@@ -327,7 +323,6 @@ export class ZigbeeGroup extends ZigbeeEntity {
327
323
  else {
328
324
  zigbeeGroup.serial = `group-${group.id}`.slice(0, 32);
329
325
  }
330
- zigbeeGroup.log.warn(`***Group ${zigbeeGroup.en}${group.friendly_name}${db} adds select device ${group.id} (${group.friendly_name})`);
331
326
  if (!platform.selectDevice.get(`group-${group.id}`)) {
332
327
  platform.selectDevice.set(`group-${group.id}`, { serial: `group-${group.id}`, name: group.friendly_name, icon: 'wifi', entities: [] });
333
328
  }
@@ -891,14 +886,32 @@ export class ZigbeeDevice extends ZigbeeEntity {
891
886
  zigbeeDevice.addBridgedDeviceBasicInformation();
892
887
  zigbeeDevice.addPowerSource();
893
888
  mainEndpoint.clusterServersIds.splice(mainEndpoint.clusterServersIds.indexOf(PowerSource.Cluster.id), 1);
894
- const options = require(PowerSourceBehavior.with(PowerSource.Feature.Wired), {
895
- wiredCurrentType: PowerSource.WiredCurrentType.Ac,
896
- description: 'AC Power',
897
- status: PowerSource.PowerSourceStatus.Active,
898
- order: 0,
899
- endpointList: [],
900
- });
901
- mainEndpoint.clusterServersOptions.push(options);
889
+ for (const [endpoint, device] of zigbeeDevice.mutableDevice) {
890
+ const deviceClusterServersIdMap = new Map();
891
+ device.clusterServersIds.forEach((clusterServer) => {
892
+ deviceClusterServersIdMap.set(clusterServer, clusterServer);
893
+ });
894
+ const deviceClusterServersObjMap = new Map();
895
+ device.clusterServersOptions.forEach((clusterServer) => {
896
+ deviceClusterServersIdMap.delete(clusterServer.clusterId);
897
+ deviceClusterServersObjMap.set(clusterServer.clusterId, clusterServer);
898
+ });
899
+ device.clusterServersIds = Array.from(deviceClusterServersIdMap.values());
900
+ device.clusterServersOptions = Array.from(deviceClusterServersObjMap.values());
901
+ const deviceClusterClientsIdMap = new Map();
902
+ device.clusterClientsIds.forEach((clusterClient) => {
903
+ deviceClusterClientsIdMap.set(clusterClient, clusterClient);
904
+ });
905
+ const deviceClusterClientsObjMap = new Map();
906
+ device.clusterClientsOptions.forEach((clusterClient) => {
907
+ deviceClusterClientsIdMap.delete(clusterClient.clusterId);
908
+ deviceClusterClientsObjMap.set(clusterClient.clusterId, clusterClient);
909
+ });
910
+ device.clusterClientsIds = Array.from(deviceClusterClientsIdMap.values());
911
+ device.clusterClientsOptions = Array.from(deviceClusterClientsObjMap.values());
912
+ zigbeeDevice.log.debug(`Device ${zigbeeDevice.ien}${zigbeeDevice.device?.friendly_name}${rs}${db} endpoint: ${ign}${endpoint === '' ? 'main' : endpoint}${rs}${db} => ` +
913
+ `${nf}tagList: ${debugStringify(device.tagList)} deviceTypes: ${debugStringify(device.deviceTypes)} clusterServersIds: ${debugStringify(device.clusterServersIds)}`);
914
+ }
902
915
  if (mainEndpoint.clusterServersIds.includes(ColorControl.Cluster.id)) {
903
916
  zigbeeDevice.log.debug(`Configuring device ${zigbeeDevice.ien}${device.friendly_name}${rs}${db} ColorControlCluster cluster with HS: ${names.includes('color_hs')} XY: ${names.includes('color_xy')} CT: ${names.includes('color_temp')}`);
904
917
  if (!names.includes('color_hs') && !names.includes('color_xy')) {
@@ -930,32 +943,6 @@ export class ZigbeeDevice extends ZigbeeEntity {
930
943
  mainEndpoint.clusterServersIds.splice(mainEndpoint.clusterServersIds.indexOf(Thermostat.Cluster.id), 1);
931
944
  }
932
945
  }
933
- for (const [endpoint, device] of zigbeeDevice.mutableDevice) {
934
- const deviceClusterServersIdMap = new Map();
935
- device.clusterServersIds.forEach((clusterServer) => {
936
- deviceClusterServersIdMap.set(clusterServer, clusterServer);
937
- });
938
- const deviceClusterServersObjMap = new Map();
939
- device.clusterServersOptions.forEach((clusterServer) => {
940
- deviceClusterServersIdMap.delete(clusterServer.clusterId);
941
- deviceClusterServersObjMap.set(clusterServer.clusterId, clusterServer);
942
- });
943
- device.clusterServersIds = Array.from(deviceClusterServersIdMap.values());
944
- device.clusterServersOptions = Array.from(deviceClusterServersObjMap.values());
945
- const deviceClusterClientsIdMap = new Map();
946
- device.clusterClientsIds.forEach((clusterClient) => {
947
- deviceClusterClientsIdMap.set(clusterClient, clusterClient);
948
- });
949
- const deviceClusterClientsObjMap = new Map();
950
- device.clusterClientsOptions.forEach((clusterClient) => {
951
- deviceClusterClientsIdMap.delete(clusterClient.clusterId);
952
- deviceClusterClientsObjMap.set(clusterClient.clusterId, clusterClient);
953
- });
954
- device.clusterClientsIds = Array.from(deviceClusterClientsIdMap.values());
955
- device.clusterClientsOptions = Array.from(deviceClusterClientsObjMap.values());
956
- zigbeeDevice.log.debug(`Device ${zigbeeDevice.ien}${zigbeeDevice.device?.friendly_name}${rs}${db} endpoint: ${ign}${endpoint === '' ? 'main' : endpoint}${rs}${db} => ` +
957
- `${nf}tagList: ${debugStringify(device.tagList)} deviceTypes: ${debugStringify(device.deviceTypes)} clusterServersIds: ${debugStringify(device.clusterServersIds)}`);
958
- }
959
946
  zigbeeDevice.bridgedDevice.addClusterServers(mainEndpoint.clusterServersIds);
960
947
  zigbeeDevice.bridgedDevice.addRequiredClusterServers();
961
948
  if (zigbeeDevice.composedType !== '')
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "matterbridge-zigbee2mqtt",
3
- "version": "2.4.4-dev.2",
3
+ "version": "2.4.5-dev.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "matterbridge-zigbee2mqtt",
9
- "version": "2.4.4-dev.2",
9
+ "version": "2.4.5-dev.1",
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
12
  "moment": "2.30.1",
@@ -35,9 +35,9 @@
35
35
  }
36
36
  },
37
37
  "node_modules/@types/node": {
38
- "version": "22.10.10",
39
- "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.10.tgz",
40
- "integrity": "sha512-X47y/mPNzxviAGY5TcYPtYL8JsY3kAq2n8fMmKoRCxq/c4v4pyGNCzM2R6+M5/umG4ZfHuT+sgqDYqWc9rJ6ww==",
38
+ "version": "22.13.1",
39
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.1.tgz",
40
+ "integrity": "sha512-jK8uzQlrvXqEU91UxiK5J7pKHyzgnI1Qnl0QDHIgVGuolJhRb9EEl28Cj9b3rGR8B2lhFCtvIm5os8lFnO/1Ew==",
41
41
  "license": "MIT",
42
42
  "dependencies": {
43
43
  "undici-types": "~6.20.0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "matterbridge-zigbee2mqtt",
3
- "version": "2.4.4-dev.2",
3
+ "version": "2.4.5-dev.1",
4
4
  "description": "Matterbridge zigbee2mqtt plugin",
5
5
  "author": "https://github.com/Luligu",
6
6
  "license": "Apache-2.0",