matterbridge 1.5.2 → 1.5.3

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.
Files changed (77) hide show
  1. package/CHANGELOG.md +19 -2
  2. package/dist/cluster/AirQualityCluster.d.ts +1 -1
  3. package/dist/cluster/AirQualityCluster.d.ts.map +1 -1
  4. package/dist/cluster/CarbonDioxideConcentrationMeasurementCluster.d.ts +11 -11
  5. package/dist/cluster/CarbonDioxideConcentrationMeasurementCluster.d.ts.map +1 -1
  6. package/dist/cluster/CarbonMonoxideConcentrationMeasurementCluster.d.ts +11 -11
  7. package/dist/cluster/CarbonMonoxideConcentrationMeasurementCluster.d.ts.map +1 -1
  8. package/dist/cluster/ConcentrationMeasurementCluster.d.ts +10 -10
  9. package/dist/cluster/DeviceEnergyManagementCluster.d.ts +16 -16
  10. package/dist/cluster/DeviceEnergyManagementCluster.d.ts.map +1 -1
  11. package/dist/cluster/DeviceEnergyManagementModeCluster.d.ts +3 -3
  12. package/dist/cluster/DeviceEnergyManagementModeCluster.d.ts.map +1 -1
  13. package/dist/cluster/ElectricalEnergyMeasurementCluster.d.ts +8 -8
  14. package/dist/cluster/ElectricalEnergyMeasurementCluster.d.ts.map +1 -1
  15. package/dist/cluster/ElectricalPowerMeasurementCluster.d.ts +13 -13
  16. package/dist/cluster/ElectricalPowerMeasurementCluster.d.ts.map +1 -1
  17. package/dist/cluster/FormaldehydeConcentrationMeasurementCluster.d.ts +11 -11
  18. package/dist/cluster/FormaldehydeConcentrationMeasurementCluster.d.ts.map +1 -1
  19. package/dist/cluster/NitrogenDioxideConcentrationMeasurementCluster.d.ts +11 -11
  20. package/dist/cluster/NitrogenDioxideConcentrationMeasurementCluster.d.ts.map +1 -1
  21. package/dist/cluster/OzoneConcentrationMeasurementCluster.d.ts +11 -11
  22. package/dist/cluster/OzoneConcentrationMeasurementCluster.d.ts.map +1 -1
  23. package/dist/cluster/Pm10ConcentrationMeasurementCluster.d.ts +11 -11
  24. package/dist/cluster/Pm10ConcentrationMeasurementCluster.d.ts.map +1 -1
  25. package/dist/cluster/Pm1ConcentrationMeasurementCluster.d.ts +11 -11
  26. package/dist/cluster/Pm1ConcentrationMeasurementCluster.d.ts.map +1 -1
  27. package/dist/cluster/Pm25ConcentrationMeasurementCluster.d.ts +11 -11
  28. package/dist/cluster/Pm25ConcentrationMeasurementCluster.d.ts.map +1 -1
  29. package/dist/cluster/PowerTopologyCluster.d.ts +7 -7
  30. package/dist/cluster/PowerTopologyCluster.d.ts.map +1 -1
  31. package/dist/cluster/RadonConcentrationMeasurementCluster.d.ts +11 -11
  32. package/dist/cluster/RadonConcentrationMeasurementCluster.d.ts.map +1 -1
  33. package/dist/cluster/ScenesCluster.d.ts +1249 -0
  34. package/dist/cluster/ScenesCluster.d.ts.map +1 -0
  35. package/dist/cluster/ScenesCluster.js +436 -0
  36. package/dist/cluster/ScenesCluster.js.map +1 -0
  37. package/dist/cluster/SmokeCoAlarmCluster.d.ts +9 -9
  38. package/dist/cluster/SmokeCoAlarmCluster.d.ts.map +1 -1
  39. package/dist/cluster/TvocCluster.d.ts +1 -1
  40. package/dist/cluster/TvocCluster.d.ts.map +1 -1
  41. package/dist/cluster/export.d.ts +0 -1
  42. package/dist/cluster/export.d.ts.map +1 -1
  43. package/dist/cluster/export.js +0 -1
  44. package/dist/cluster/export.js.map +1 -1
  45. package/dist/index.d.ts +3 -25
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +3 -32
  48. package/dist/index.js.map +1 -1
  49. package/dist/matterbridge.d.ts +3 -1
  50. package/dist/matterbridge.d.ts.map +1 -1
  51. package/dist/matterbridge.js +124 -17
  52. package/dist/matterbridge.js.map +1 -1
  53. package/dist/matterbridgeDevice.d.ts +4684 -2288
  54. package/dist/matterbridgeDevice.d.ts.map +1 -1
  55. package/dist/matterbridgeDevice.js +146 -545
  56. package/dist/matterbridgeDevice.js.map +1 -1
  57. package/dist/matterbridgeTypes.d.ts +3 -0
  58. package/dist/matterbridgeTypes.d.ts.map +1 -1
  59. package/frontend/build/asset-manifest.json +3 -3
  60. package/frontend/build/index.html +1 -1
  61. package/frontend/build/static/js/{main.cfcfbb06.js → main.6725e5ab.js} +3 -3
  62. package/frontend/build/static/js/main.6725e5ab.js.map +1 -0
  63. package/package.json +14 -9
  64. package/dist/cluster/BooleanStateConfigurationCluster.d.ts +0 -2200
  65. package/dist/cluster/BooleanStateConfigurationCluster.d.ts.map +0 -1
  66. package/dist/cluster/BooleanStateConfigurationCluster.js +0 -388
  67. package/dist/cluster/BooleanStateConfigurationCluster.js.map +0 -1
  68. package/dist/cluster/BridgedDeviceBasicInformationCluster.d.ts +0 -223
  69. package/dist/cluster/BridgedDeviceBasicInformationCluster.d.ts.map +0 -1
  70. package/dist/cluster/BridgedDeviceBasicInformationCluster.js +0 -177
  71. package/dist/cluster/BridgedDeviceBasicInformationCluster.js.map +0 -1
  72. package/dist/cluster/FanControlCluster.d.ts +0 -1583
  73. package/dist/cluster/FanControlCluster.d.ts.map +0 -1
  74. package/dist/cluster/FanControlCluster.js +0 -492
  75. package/dist/cluster/FanControlCluster.js.map +0 -1
  76. package/frontend/build/static/js/main.cfcfbb06.js.map +0 -1
  77. /package/frontend/build/static/js/{main.cfcfbb06.js.LICENSE.txt → main.6725e5ab.js.LICENSE.txt} +0 -0
@@ -6,7 +6,7 @@
6
6
  * @date 2023-12-29
7
7
  * @version 1.2.0
8
8
  *
9
- * Copyright 2023, 2024 Luca Liguori.
9
+ * Copyright 2023, 2024, 2025 Luca Liguori.
10
10
  *
11
11
  * Licensed under the Apache License, Version 2.0 (the "License");
12
12
  * you may not use this file except in compliance with the License.
@@ -20,26 +20,23 @@
20
20
  * See the License for the specific language governing permissions and
21
21
  * limitations under the License. *
22
22
  */
23
- import { BasicInformationCluster, BooleanState, BooleanStateCluster, ClusterServer, ColorControl, ColorControlCluster, DoorLock, DoorLockCluster, FanControl, FanControlCluster, FixedLabelCluster, FlowMeasurement, FlowMeasurementCluster, Groups, GroupsCluster, GroupsClusterHandler, Identify, IdentifyCluster, IlluminanceMeasurement, IlluminanceMeasurementCluster, LevelControl, LevelControlCluster, ModeSelectCluster, OccupancySensing, OccupancySensingCluster, OnOff, OnOffCluster, PowerSource, PowerSourceCluster, PowerSourceConfigurationCluster, PressureMeasurement, PressureMeasurementCluster, RelativeHumidityMeasurement, RelativeHumidityMeasurementCluster, Scenes, ScenesCluster, ScenesClusterHandler, Switch, SwitchCluster, TemperatureMeasurement, TemperatureMeasurementCluster, Thermostat, ThermostatCluster, ThreadNetworkDiagnostics, ThreadNetworkDiagnosticsCluster, TimeSync, TimeSyncCluster, WindowCovering, WindowCoveringCluster, getClusterNameById, } from '@project-chip/matter-node.js/cluster';
24
- import { EndpointNumber, GroupId, VendorId } from '@project-chip/matter-node.js/datatype';
23
+ import { BasicInformationCluster, BooleanState, BooleanStateCluster, BooleanStateConfiguration, BooleanStateConfigurationCluster, BridgedDeviceBasicInformation, BridgedDeviceBasicInformationCluster, ClusterServer, ColorControl, ColorControlCluster, DoorLock, DoorLockCluster, FanControl, FanControlCluster, FixedLabelCluster, FlowMeasurement, FlowMeasurementCluster, Groups, GroupsCluster, GroupsClusterHandler, Identify, IdentifyCluster, IlluminanceMeasurement, IlluminanceMeasurementCluster, LevelControl, LevelControlCluster, ModeSelectCluster, OccupancySensing, OccupancySensingCluster, OnOff, OnOffCluster, PowerSource, PowerSourceCluster, PowerSourceConfigurationCluster, PressureMeasurement, PressureMeasurementCluster, RelativeHumidityMeasurement, RelativeHumidityMeasurementCluster, Switch, SwitchCluster, TemperatureMeasurement, TemperatureMeasurementCluster, Thermostat, ThermostatCluster, ThreadNetworkDiagnostics, ThreadNetworkDiagnosticsCluster, TimeSynchronization, TimeSynchronizationCluster, WindowCovering, WindowCoveringCluster, getClusterNameById, } from '@project-chip/matter-node.js/cluster';
24
+ import { Specification } from '@project-chip/matter-node.js/model';
25
+ import { EndpointNumber, VendorId } from '@project-chip/matter-node.js/datatype';
25
26
  import { Device, DeviceClasses, DeviceTypeDefinition, Endpoint } from '@project-chip/matter-node.js/device';
26
27
  import { extendPublicHandlerMethods } from '@project-chip/matter-node.js/util';
27
- import { EveHistory, MatterHistory } from 'matter-history';
28
- import { AnsiLogger, CYAN, YELLOW, db, debugStringify, hk, or, zb } from 'node-ansi-logger';
28
+ // Custom cluster types
29
29
  import { AirQuality, AirQualityCluster } from './cluster/AirQualityCluster.js';
30
- import { createHash } from 'crypto';
31
30
  import { TvocMeasurement, TvocMeasurementCluster } from './cluster/TvocCluster.js';
32
- import { BridgedDeviceBasicInformation, BridgedDeviceBasicInformationCluster } from './cluster/BridgedDeviceBasicInformationCluster.js';
33
31
  import { PowerTopology, PowerTopologyCluster } from './cluster/PowerTopologyCluster.js';
34
32
  import { ElectricalPowerMeasurement, ElectricalPowerMeasurementCluster } from './cluster/ElectricalPowerMeasurementCluster.js';
35
33
  import { ElectricalEnergyMeasurement, ElectricalEnergyMeasurementCluster } from './cluster/ElectricalEnergyMeasurementCluster.js';
36
34
  import { MeasurementType } from './cluster/MeasurementType.js';
37
35
  import { CarbonMonoxideConcentrationMeasurement, CarbonMonoxideConcentrationMeasurementCluster } from './cluster/CarbonMonoxideConcentrationMeasurementCluster.js';
38
36
  import { SmokeCoAlarm, SmokeCoAlarmCluster } from './cluster/SmokeCoAlarmCluster.js';
39
- import { BooleanStateConfiguration, BooleanStateConfigurationCluster } from './cluster/BooleanStateConfigurationCluster.js';
37
+ // import { BooleanStateConfiguration, BooleanStateConfigurationCluster } from './cluster/BooleanStateConfigurationCluster.js';
40
38
  import { DeviceEnergyManagement, DeviceEnergyManagementCluster } from './cluster/DeviceEnergyManagementCluster.js';
41
39
  import { DeviceEnergyManagementMode, DeviceEnergyManagementModeCluster } from './cluster/DeviceEnergyManagementModeCluster.js';
42
- // import { FanControl, FanControlCluster } from './cluster/FanControlCluster.js';
43
40
  import { ConcentrationMeasurement } from './cluster/ConcentrationMeasurementCluster.js';
44
41
  import { CarbonDioxideConcentrationMeasurement, CarbonDioxideConcentrationMeasurementCluster } from './cluster/CarbonDioxideConcentrationMeasurementCluster.js';
45
42
  import { OzoneConcentrationMeasurement, OzoneConcentrationMeasurementCluster } from './cluster/OzoneConcentrationMeasurementCluster.js';
@@ -49,6 +46,9 @@ import { Pm10ConcentrationMeasurement, Pm10ConcentrationMeasurementCluster } fro
49
46
  import { RadonConcentrationMeasurement, RadonConcentrationMeasurementCluster } from './cluster/RadonConcentrationMeasurementCluster.js';
50
47
  import { NitrogenDioxideConcentrationMeasurement, NitrogenDioxideConcentrationMeasurementCluster } from './cluster/NitrogenDioxideConcentrationMeasurementCluster.js';
51
48
  import { FormaldehydeConcentrationMeasurement, FormaldehydeConcentrationMeasurementCluster } from './cluster/FormaldehydeConcentrationMeasurementCluster.js';
49
+ import { EveHistory, MatterHistory } from 'matter-history';
50
+ import { AnsiLogger, CYAN, YELLOW, db, debugStringify, hk, or, zb } from 'node-ansi-logger';
51
+ import { createHash } from 'crypto';
52
52
  // Matter 1.2 and 1.3 device types
53
53
  export const airQualitySensor = DeviceTypeDefinition({
54
54
  name: 'MA-airQualitySensor',
@@ -135,13 +135,61 @@ export const bridgedNode = DeviceTypeDefinition({
135
135
  requiredServerClusters: [BridgedDeviceBasicInformation.Cluster.id],
136
136
  optionalServerClusters: [PowerSource.Cluster.id],
137
137
  });
138
+ export const genericSwitch = DeviceTypeDefinition({
139
+ name: 'MA-genericswitch',
140
+ code: 0x000f,
141
+ deviceClass: DeviceClasses.Simple,
142
+ revision: 1,
143
+ requiredServerClusters: [IdentifyCluster.id, SwitchCluster.id],
144
+ optionalServerClusters: [FixedLabelCluster.id],
145
+ });
146
+ export const onOffLight = DeviceTypeDefinition({
147
+ name: 'MA-onofflight',
148
+ code: 0x0100,
149
+ deviceClass: DeviceClasses.Simple,
150
+ revision: 2,
151
+ requiredServerClusters: [Identify.Cluster.id, Groups.Cluster.id, /* Scenes.Cluster.id,*/ OnOff.Cluster.id],
152
+ optionalServerClusters: [LevelControl.Cluster.id, ColorControl.Cluster.id],
153
+ });
154
+ export const dimmableLight = DeviceTypeDefinition({
155
+ name: 'MA-dimmablelight',
156
+ code: 0x0101,
157
+ deviceClass: DeviceClasses.Simple,
158
+ revision: 2,
159
+ requiredServerClusters: [Identify.Cluster.id, Groups.Cluster.id, /* Scenes.Cluster.id,*/ OnOff.Cluster.id, LevelControl.Cluster.id],
160
+ optionalServerClusters: [ColorControl.Cluster.id],
161
+ });
162
+ export const colorTemperatureLight = DeviceTypeDefinition({
163
+ name: 'MA-colortemperaturelight',
164
+ code: 0x010c,
165
+ deviceClass: DeviceClasses.Simple,
166
+ revision: 2,
167
+ requiredServerClusters: [Identify.Cluster.id, Groups.Cluster.id, /* Scenes.Cluster.id,*/ OnOff.Cluster.id, LevelControl.Cluster.id, ColorControl.Cluster.id],
168
+ optionalServerClusters: [],
169
+ });
170
+ export const onOffOutlet = DeviceTypeDefinition({
171
+ name: 'MA-onoffpluginunit',
172
+ code: 0x010a,
173
+ deviceClass: DeviceClasses.Simple,
174
+ revision: 2,
175
+ requiredServerClusters: [Identify.Cluster.id, Groups.Cluster.id, /* Scenes.Cluster.id,*/ OnOff.Cluster.id],
176
+ optionalServerClusters: [LevelControl.Cluster.id],
177
+ });
178
+ export const dimmableOutlet = DeviceTypeDefinition({
179
+ name: 'MA-dimmablepluginunit',
180
+ code: 0x010b,
181
+ deviceClass: DeviceClasses.Simple,
182
+ revision: 2,
183
+ requiredServerClusters: [Identify.Cluster.id, Groups.Cluster.id, /* Scenes.Cluster.id,*/ OnOff.Cluster.id, LevelControl.Cluster.id],
184
+ optionalServerClusters: [],
185
+ });
138
186
  // Custom device types: switch without ClientClusters
139
187
  export const onOffSwitch = DeviceTypeDefinition({
140
188
  name: 'MA-onoffswitch',
141
189
  code: 0x0103,
142
190
  deviceClass: DeviceClasses.Simple,
143
191
  revision: 2,
144
- requiredServerClusters: [Identify.Cluster.id, Groups.Cluster.id, Scenes.Cluster.id, OnOff.Cluster.id],
192
+ requiredServerClusters: [Identify.Cluster.id, Groups.Cluster.id, /* Scenes.Cluster.id,*/ OnOff.Cluster.id],
145
193
  optionalServerClusters: [LevelControl.Cluster.id, ColorControl.Cluster.id],
146
194
  });
147
195
  export const dimmableSwitch = DeviceTypeDefinition({
@@ -149,7 +197,7 @@ export const dimmableSwitch = DeviceTypeDefinition({
149
197
  code: 0x0104,
150
198
  deviceClass: DeviceClasses.Simple,
151
199
  revision: 2,
152
- requiredServerClusters: [Identify.Cluster.id, Groups.Cluster.id, Scenes.Cluster.id, OnOff.Cluster.id, LevelControl.Cluster.id],
200
+ requiredServerClusters: [Identify.Cluster.id, Groups.Cluster.id, /* Scenes.Cluster.id,*/ OnOff.Cluster.id, LevelControl.Cluster.id],
153
201
  optionalServerClusters: [ColorControl.Cluster.id],
154
202
  });
155
203
  export const colorTemperatureSwitch = DeviceTypeDefinition({
@@ -157,7 +205,7 @@ export const colorTemperatureSwitch = DeviceTypeDefinition({
157
205
  code: 0x0105,
158
206
  deviceClass: DeviceClasses.Simple,
159
207
  revision: 2,
160
- requiredServerClusters: [Identify.Cluster.id, Groups.Cluster.id, Scenes.Cluster.id, OnOff.Cluster.id, LevelControl.Cluster.id, ColorControl.Cluster.id],
208
+ requiredServerClusters: [Identify.Cluster.id, Groups.Cluster.id, /* Scenes.Cluster.id,*/ OnOff.Cluster.id, LevelControl.Cluster.id, ColorControl.Cluster.id],
161
209
  optionalServerClusters: [],
162
210
  });
163
211
  export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
@@ -402,8 +450,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
402
450
  endpoint.addClusterServer(this.getDefaultIdentifyClusterServer());
403
451
  if (includeServerList.includes(Groups.Cluster.id))
404
452
  endpoint.addClusterServer(this.getDefaultGroupsClusterServer());
405
- if (includeServerList.includes(Scenes.Cluster.id))
406
- endpoint.addClusterServer(this.getDefaultScenesClusterServer());
453
+ // if (includeServerList.includes(ScenesManagement.Cluster.id)) endpoint.addClusterServer(this.getDefaultScenesClusterServer());
407
454
  if (includeServerList.includes(OnOff.Cluster.id))
408
455
  endpoint.addClusterServer(this.getDefaultOnOffClusterServer());
409
456
  if (includeServerList.includes(LevelControl.Cluster.id))
@@ -416,7 +463,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
416
463
  endpoint.addClusterServer(this.getDefaultDoorLockClusterServer());
417
464
  if (includeServerList.includes(Thermostat.Cluster.id))
418
465
  endpoint.addClusterServer(this.getDefaultThermostatClusterServer());
419
- if (includeServerList.includes(TimeSync.Cluster.id))
466
+ if (includeServerList.includes(TimeSynchronization.Cluster.id))
420
467
  endpoint.addClusterServer(this.getDefaultTimeSyncClusterServer());
421
468
  if (includeServerList.includes(WindowCovering.Cluster.id))
422
469
  endpoint.addClusterServer(this.getDefaultWindowCoveringClusterServer());
@@ -440,7 +487,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
440
487
  endpoint.addClusterServer(this.getDefaultPowerSourceWiredClusterServer());
441
488
  if (includeServerList.includes(EveHistory.Cluster.id))
442
489
  endpoint.addClusterServer(MatterHistory.getEveHistoryClusterServer());
443
- // if (includeServerList.includes(ElectricalMeasurement.Cluster.id)) endpoint.addClusterServer(this.getDefaultElectricalMeasurementClusterServer());
444
490
  if (includeServerList.includes(PowerTopology.Cluster.id))
445
491
  endpoint.addClusterServer(this.getDefaultPowerTopologyClusterServer());
446
492
  if (includeServerList.includes(ElectricalPowerMeasurement.Cluster.id))
@@ -631,6 +677,44 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
631
677
  `to ${YELLOW}${typeof value === 'object' ? debugStringify(value) : value}${db}`);
632
678
  return true;
633
679
  }
680
+ /**
681
+ * Subscribes to an attribute on a cluster.
682
+ *
683
+ * @param {ClusterId} clusterId - The ID of the cluster.
684
+ * @param {string} attribute - The name of the attribute to subscribe to.
685
+ * @param {(newValue: any, oldValue: any) => void} listener - A callback function that will be called when the attribute value changes.
686
+ * @param {AnsiLogger} log - (Optional) An AnsiLogger instance for logging errors and information.
687
+ * @param {Endpoint} endpoint - (Optional) The endpoint to subscribe the attribute on. If not provided, the current endpoint will be used.
688
+ * @returns A boolean indicating whether the subscription was successful.
689
+ */
690
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
691
+ subscribeAttribute(clusterId, attribute, listener, log, endpoint) {
692
+ if (!endpoint)
693
+ endpoint = this;
694
+ const clusterServer = endpoint.getClusterServerById(clusterId);
695
+ if (!clusterServer) {
696
+ log?.error(`subscribeAttribute error: Cluster ${clusterId} not found on endpoint ${endpoint.name}:${endpoint.number}`);
697
+ return false;
698
+ }
699
+ const capitalizedAttributeName = attribute.charAt(0).toUpperCase() + attribute.slice(1);
700
+ if (!clusterServer.isAttributeSupportedByName(attribute) && !clusterServer.isAttributeSupportedByName(capitalizedAttributeName)) {
701
+ if (log)
702
+ log.error(`subscribeAttribute error: Attribute ${attribute} not found on Cluster ${clusterServer.name} on endpoint ${endpoint.name}:${endpoint.number}`);
703
+ return false;
704
+ }
705
+ // Find the subscribe method
706
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
707
+ if (!clusterServer[`subscribe${capitalizedAttributeName}Attribute`]) {
708
+ log?.error(`subscribeAttribute error: subscribe${capitalizedAttributeName}Attribute not found on Cluster ${clusterServer.name} on endpoint ${endpoint.name}:${endpoint.number}`);
709
+ return false;
710
+ }
711
+ // Subscribe to the attribute
712
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-empty-object-type
713
+ const subscribe = clusterServer[`subscribe${capitalizedAttributeName}Attribute`];
714
+ subscribe(listener);
715
+ log?.info(`${db}Subscribe endpoint ${or}${endpoint.name}:${endpoint.number}${db} attribute ${hk}${clusterServer.name}.${capitalizedAttributeName}${db}`);
716
+ return true;
717
+ }
634
718
  /**
635
719
  * Serializes the Matterbridge device into a serialized object.
636
720
  *
@@ -648,7 +732,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
648
732
  serialNumber: this.serialNumber,
649
733
  deviceName: this.deviceName,
650
734
  uniqueId: this.uniqueId,
651
- productId: cluster.attributes.productId?.getLocal(),
652
735
  productName: cluster.attributes.productName?.getLocal(),
653
736
  vendorId: cluster.attributes.vendorId?.getLocal(),
654
737
  vendorName: cluster.attributes.vendorName?.getLocal(),
@@ -682,475 +765,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
682
765
  }
683
766
  return device;
684
767
  }
685
- /**
686
- * Returns a default static EveHistoryClusterServer object with the specified voltage, current, power, and consumption values.
687
- * This shows up in HA as a static sensor!
688
- * @deprecated This method is deprecated and will be removed in a future version. Use MatterHistory.
689
- * @param voltage - The voltage value (default: 0).
690
- * @param current - The current value (default: 0).
691
- * @param power - The power value (default: 0).
692
- * @param consumption - The consumption value (default: 0).
693
- * @returns The default static EveHistoryClusterServer object.
694
- */
695
- /*
696
- getDefaultStaticEveHistoryClusterServer(voltage = 0, current = 0, power = 0, consumption = 0) {
697
- return ClusterServer(
698
- EveHistoryCluster.with(EveHistory.Feature.EveEnergy),
699
- {
700
- // Dynamic attributes
701
- ConfigDataGet: Uint8Array.fromHex(''),
702
- ConfigDataSet: Uint8Array.fromHex(''),
703
- HistoryStatus: Uint8Array.fromHex(''),
704
- HistoryEntries: Uint8Array.fromHex(''),
705
- HistoryRequest: Uint8Array.fromHex(''),
706
- HistorySetTime: Uint8Array.fromHex(''),
707
- LastEvent: 0,
708
- ResetTotal: 0,
709
- // Normal static attributes
710
- Voltage: voltage,
711
- Current: current,
712
- Consumption: power,
713
- TotalConsumption: consumption,
714
- EnergyUnknown: 1,
715
- ChildLock: false,
716
- RLoc: 46080,
717
- },
718
- {},
719
- {},
720
- );
721
- }
722
- */
723
- /**
724
- * Create a default static EveHistoryClusterServer object with the specified voltage, current, power, and consumption values.
725
- * This shows up in HA as a static sensor!
726
- * @deprecated This method is deprecated and will be removed in a future version. Use MatterHistory.
727
- * @param voltage - The voltage value (default: 0).
728
- * @param current - The current value (default: 0).
729
- * @param power - The power value (default: 0).
730
- * @param consumption - The consumption value (default: 0).
731
- * @returns The default static EveHistoryClusterServer object.
732
- */
733
- /*
734
- createDefaultStaticEveHistoryClusterServer(voltage = 0, current = 0, power = 0, consumption = 0) {
735
- this.addClusterServer(this.getDefaultStaticEveHistoryClusterServer(voltage, current, power, consumption));
736
- }
737
- */
738
- /**
739
- * Creates a room Eve History Cluster Server.
740
- * @deprecated This method is deprecated and will be removed in a future version. Use MatterHistory.
741
- *
742
- * @param history - The MatterHistory object.
743
- * @param log - The AnsiLogger object.
744
- */
745
- /*
746
- createRoomEveHistoryClusterServer(history: MatterHistory, log: AnsiLogger) {
747
- history.setMatterHystoryType('room', this.serialNumber);
748
- this.addClusterServer(
749
- ClusterServer(
750
- EveHistoryCluster.with(EveHistory.Feature.EveRoom),
751
- {
752
- // Dynamic attributes
753
- ConfigDataGet: Uint8Array.fromHex(''),
754
- ConfigDataSet: Uint8Array.fromHex(''),
755
- HistoryStatus: Uint8Array.fromHex(''),
756
- HistoryEntries: Uint8Array.fromHex(''),
757
- HistoryRequest: Uint8Array.fromHex(''),
758
- HistorySetTime: Uint8Array.fromHex(''),
759
- // Normal attributes
760
- TemperatureDisplayUnits: TemperatureDisplayUnits.CELSIUS,
761
- RLoc: 46080,
762
- },
763
- {
764
- ConfigDataGetAttributeGetter: ({ session, isFabricFiltered }) => {
765
- log.debug(`ConfigDataGetAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
766
- return history.OnGetConfigData(isFabricFiltered);
767
- },
768
-
769
- ConfigDataSetAttributeGetter: ({ session, isFabricFiltered }) => {
770
- log.debug(`ConfigDataSetAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
771
- return Uint8Array.fromHex('');
772
- },
773
- ConfigDataSetAttributeSetter: (value: Uint8Array, { attributes, endpoint, session }) => {
774
- log.debug(`ConfigDataSetAttributeSetter [${value.toHex()}] ${attributes.ConfigDataSet} endpoint: ${endpoint?.name} session: ${session?.name}`);
775
- return history.OnSetConfigData(value);
776
- },
777
-
778
- HistoryStatusAttributeGetter: ({ session, isFabricFiltered }) => {
779
- log.debug(`HistoryStatusAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
780
- return history.OnGetHistoryStatus(isFabricFiltered);
781
- },
782
-
783
- HistoryEntriesAttributeGetter: ({ session, isFabricFiltered }) => {
784
- log.debug(`HistoryEntriesAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
785
- return history.OnGetHistoryEntries();
786
- },
787
-
788
- HistorySetTimeAttributeGetter: ({ session, isFabricFiltered }) => {
789
- log.debug(`HistorySetTimeAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
790
- return Uint8Array.fromHex('');
791
- },
792
- HistorySetTimeAttributeSetter: (value: Uint8Array, { attributes, endpoint, session }) => {
793
- log.debug(`HistorySetTimeAttributeSetter ${value.toHex()} ${attributes.HistorySetTime} endpoint: ${endpoint?.name} session: ${session?.name}`);
794
- return history.OnSetHistorySetTime(value);
795
- },
796
-
797
- HistoryRequestAttributeGetter: ({ session, isFabricFiltered }) => {
798
- log.debug(`HistoryRequestAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
799
- return Uint8Array.fromHex('');
800
- },
801
- HistoryRequestAttributeSetter: (value: Uint8Array, { attributes, endpoint, session }) => {
802
- log.debug(`HistoryRequestAttributeSetter ${value.toHex()} ${attributes.HistoryRequest} endpoint: ${endpoint?.name} session: ${session?.name}`);
803
- return history.OnSetHistoryRequest(value);
804
- },
805
- },
806
- {},
807
- ),
808
- );
809
- }
810
- */
811
- /**
812
- * Creates a Weather Eve History Cluster Server.
813
- * @deprecated This method is deprecated and will be removed in a future version. Use MatterHistory.
814
- *
815
- * @param history - The MatterHistory instance.
816
- * @param log - The AnsiLogger instance.
817
- */
818
- /*
819
- createWeatherEveHistoryClusterServer(history: MatterHistory, log: AnsiLogger) {
820
- history.setMatterHystoryType('weather', this.serialNumber);
821
- this.addClusterServer(
822
- ClusterServer(
823
- EveHistoryCluster.with(EveHistory.Feature.EveWeather),
824
- {
825
- // Dynamic attributes
826
- ConfigDataGet: Uint8Array.fromHex(''),
827
- ConfigDataSet: Uint8Array.fromHex(''),
828
- HistoryStatus: Uint8Array.fromHex(''),
829
- HistoryEntries: Uint8Array.fromHex(''),
830
- HistoryRequest: Uint8Array.fromHex(''),
831
- HistorySetTime: Uint8Array.fromHex(''),
832
- // Normal attributes
833
- Elevation: 0,
834
- AirPressure: 1000,
835
- WeatherTrend: WeatherTrend.SUN,
836
- TemperatureDisplayUnits: TemperatureDisplayUnits.CELSIUS,
837
- RLoc: 46080,
838
- },
839
- {
840
- ConfigDataGetAttributeGetter: ({ session, isFabricFiltered }) => {
841
- log.debug(`ConfigDataGetAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
842
- return history.OnGetConfigData(isFabricFiltered);
843
- },
844
-
845
- ConfigDataSetAttributeGetter: ({ session, isFabricFiltered }) => {
846
- log.debug(`ConfigDataSetAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
847
- return Uint8Array.fromHex('');
848
- },
849
- ConfigDataSetAttributeSetter: (value: Uint8Array, { attributes, endpoint, session }) => {
850
- log.debug(`ConfigDataSetAttributeSetter [${value.toHex()}] ${attributes.ConfigDataSet} endpoint: ${endpoint?.name} session: ${session?.name}`);
851
- return history.OnSetConfigData(value);
852
- },
853
-
854
- HistoryStatusAttributeGetter: ({ session, isFabricFiltered }) => {
855
- log.debug(`HistoryStatusAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
856
- return history.OnGetHistoryStatus(isFabricFiltered);
857
- },
858
-
859
- HistoryEntriesAttributeGetter: ({ session, isFabricFiltered }) => {
860
- log.debug(`HistoryEntriesAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
861
- return history.OnGetHistoryEntries();
862
- },
863
-
864
- HistorySetTimeAttributeGetter: ({ session, isFabricFiltered }) => {
865
- log.debug(`HistorySetTimeAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
866
- return Uint8Array.fromHex('');
867
- },
868
- HistorySetTimeAttributeSetter: (value: Uint8Array, { attributes, endpoint, session }) => {
869
- log.debug(`HistorySetTimeAttributeSetter ${value.toHex()} ${attributes.HistorySetTime} endpoint: ${endpoint?.name} session: ${session?.name}`);
870
- return history.OnSetHistorySetTime(value);
871
- },
872
-
873
- HistoryRequestAttributeGetter: ({ session, isFabricFiltered }) => {
874
- log.debug(`HistoryRequestAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
875
- return Uint8Array.fromHex('');
876
- },
877
- HistoryRequestAttributeSetter: (value: Uint8Array, { attributes, endpoint, session }) => {
878
- log.debug(`HistoryRequestAttributeSetter ${value.toHex()} ${attributes.HistoryRequest} endpoint: ${endpoint?.name} session: ${session?.name}`);
879
- return history.OnSetHistoryRequest(value);
880
- },
881
- },
882
- {},
883
- ),
884
- );
885
- }
886
- */
887
- /**
888
- * Creates an Energy Eve History Cluster Server.
889
- * @deprecated This method is deprecated and will be removed in a future version. Use MatterHistory.
890
- *
891
- * @param history - The MatterHistory object.
892
- * @param log - The AnsiLogger object.
893
- */
894
- /*
895
- createEnergyEveHistoryClusterServer(history: MatterHistory, log: AnsiLogger) {
896
- history.setMatterHystoryType('energy');
897
- this.addClusterServer(
898
- ClusterServer(
899
- EveHistoryCluster.with(EveHistory.Feature.EveEnergy),
900
- {
901
- // Dynamic attributes
902
- ConfigDataGet: Uint8Array.fromHex(''),
903
- ConfigDataSet: Uint8Array.fromHex(''),
904
- HistoryStatus: Uint8Array.fromHex(''),
905
- HistoryEntries: Uint8Array.fromHex(''),
906
- HistoryRequest: Uint8Array.fromHex(''),
907
- HistorySetTime: Uint8Array.fromHex(''),
908
- LastEvent: 0,
909
- ResetTotal: 0,
910
- // Normal attributes
911
- Voltage: 0,
912
- Current: 0,
913
- Consumption: 0,
914
- TotalConsumption: 0,
915
- EnergyUnknown: 1,
916
- ChildLock: false,
917
- RLoc: 46080,
918
- },
919
- {
920
- ConfigDataGetAttributeGetter: ({ session, isFabricFiltered }) => {
921
- log.debug(`ConfigDataGetAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
922
- return history.OnGetConfigData(isFabricFiltered);
923
- },
924
-
925
- ConfigDataSetAttributeGetter: ({ session, isFabricFiltered }) => {
926
- log.debug(`ConfigDataSetAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
927
- return Uint8Array.fromHex('');
928
- },
929
- ConfigDataSetAttributeSetter: (value: Uint8Array, { attributes, endpoint, session }) => {
930
- log.debug(`ConfigDataSetAttributeSetter [${value.toHex()}] ${attributes.ConfigDataSet} endpoint: ${endpoint?.name} session: ${session?.name}`);
931
- return history.OnSetConfigData(value);
932
- },
933
-
934
- HistoryStatusAttributeGetter: ({ session, isFabricFiltered }) => {
935
- log.debug(`HistoryStatusAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
936
- return history.OnGetHistoryStatus(isFabricFiltered);
937
- },
938
-
939
- HistoryEntriesAttributeGetter: ({ session, isFabricFiltered }) => {
940
- log.debug(`HistoryEntriesAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
941
- return history.OnGetHistoryEntries();
942
- },
943
-
944
- HistorySetTimeAttributeGetter: ({ session, isFabricFiltered }) => {
945
- log.debug(`HistorySetTimeAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
946
- return Uint8Array.fromHex('');
947
- },
948
- HistorySetTimeAttributeSetter: (value: Uint8Array, { attributes, endpoint, session }) => {
949
- log.debug(`HistorySetTimeAttributeSetter ${value.toHex()} ${attributes.HistorySetTime} endpoint: ${endpoint?.name} session: ${session?.name}`);
950
- return history.OnSetHistorySetTime(value);
951
- },
952
-
953
- HistoryRequestAttributeGetter: ({ session, isFabricFiltered }) => {
954
- log.debug(`HistoryRequestAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
955
- return Uint8Array.fromHex('');
956
- },
957
- HistoryRequestAttributeSetter: (value: Uint8Array, { attributes, endpoint, session }) => {
958
- log.debug(`HistoryRequestAttributeSetter ${value.toHex()} ${attributes.HistoryRequest} endpoint: ${endpoint?.name} session: ${session?.name}`);
959
- return history.OnSetHistoryRequest(value);
960
- },
961
-
962
- LastEventAttributeGetter: ({ session, isFabricFiltered }) => {
963
- log.debug(`LastEventAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
964
- return history.OnGetLastEvent();
965
- },
966
-
967
- ResetTotalAttributeGetter: ({ session, isFabricFiltered }) => {
968
- log.debug(`LastResetTotalAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
969
- return history.OnGetLastReset();
970
- },
971
- ResetTotalAttributeSetter: (value: number, { attributes, endpoint, session }) => {
972
- log.debug(`LastResetTotalAttributeSetter ${value} ${attributes.ResetTotal} endpoint: ${endpoint?.name} session: ${session?.name}`);
973
- return history.OnSetLastReset(value);
974
- },
975
- },
976
- {},
977
- ),
978
- );
979
- }
980
- */
981
- /**
982
- * Creates a Motion Eve History Cluster Server.
983
- * @deprecated This method is deprecated and will be removed in a future version. Use MatterHistory.
984
- *
985
- * @param history - The MatterHistory object.
986
- * @param log - The AnsiLogger object.
987
- */
988
- /*
989
- createMotionEveHistoryClusterServer(history: MatterHistory, log: AnsiLogger) {
990
- history.setMatterHystoryType('motion');
991
- this.addClusterServer(
992
- ClusterServer(
993
- EveHistoryCluster.with(EveHistory.Feature.EveMotion),
994
- {
995
- // Dynamic attributes
996
- ConfigDataGet: Uint8Array.fromHex(''),
997
- ConfigDataSet: Uint8Array.fromHex(''),
998
- HistoryStatus: Uint8Array.fromHex(''),
999
- HistoryEntries: Uint8Array.fromHex(''),
1000
- HistoryRequest: Uint8Array.fromHex(''),
1001
- HistorySetTime: Uint8Array.fromHex(''),
1002
- LastEvent: 0,
1003
- // Normal attributes
1004
- MotionSensitivity: Sensitivity.HIGH,
1005
- RLoc: 46080,
1006
- },
1007
- {
1008
- ConfigDataGetAttributeGetter: ({ session, isFabricFiltered }) => {
1009
- log.debug(`ConfigDataGetAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
1010
- return history.OnGetConfigData(isFabricFiltered);
1011
- },
1012
-
1013
- ConfigDataSetAttributeGetter: ({ session, isFabricFiltered }) => {
1014
- log.debug(`ConfigDataSetAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
1015
- return Uint8Array.fromHex('');
1016
- },
1017
- ConfigDataSetAttributeSetter: (value: Uint8Array, { attributes, endpoint, session }) => {
1018
- log.debug(`ConfigDataSetAttributeSetter [${value.toHex()}] ${attributes.ConfigDataSet} endpoint: ${endpoint?.name} session: ${session?.name}`);
1019
- return history.OnSetConfigData(value);
1020
- },
1021
-
1022
- HistoryStatusAttributeGetter: ({ session, isFabricFiltered }) => {
1023
- log.debug(`HistoryStatusAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
1024
- return history.OnGetHistoryStatus(isFabricFiltered);
1025
- },
1026
-
1027
- HistoryEntriesAttributeGetter: ({ session, isFabricFiltered }) => {
1028
- log.debug(`HistoryEntriesAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
1029
- return history.OnGetHistoryEntries();
1030
- },
1031
-
1032
- HistorySetTimeAttributeGetter: ({ session, isFabricFiltered }) => {
1033
- log.debug(`HistorySetTimeAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
1034
- return Uint8Array.fromHex('');
1035
- },
1036
- HistorySetTimeAttributeSetter: (value: Uint8Array, { attributes, endpoint, session }) => {
1037
- log.debug(`HistorySetTimeAttributeSetter ${value.toHex()} ${attributes.HistorySetTime} endpoint: ${endpoint?.name} session: ${session?.name}`);
1038
- return history.OnSetHistorySetTime(value);
1039
- },
1040
-
1041
- HistoryRequestAttributeGetter: ({ session, isFabricFiltered }) => {
1042
- log.debug(`HistoryRequestAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
1043
- return Uint8Array.fromHex('');
1044
- },
1045
- HistoryRequestAttributeSetter: (value: Uint8Array, { attributes, endpoint, session }) => {
1046
- log.debug(`HistoryRequestAttributeSetter ${value.toHex()} ${attributes.HistoryRequest} endpoint: ${endpoint?.name} session: ${session?.name}`);
1047
- return history.OnSetHistoryRequest(value);
1048
- },
1049
-
1050
- LastEventAttributeGetter: ({ session, isFabricFiltered }) => {
1051
- log.debug(`LastEventAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
1052
- return history.OnGetLastEvent();
1053
- },
1054
- },
1055
- {},
1056
- ),
1057
- );
1058
- }
1059
- */
1060
- /**
1061
- * Creates a door EveHistoryCluster server.
1062
- * @deprecated This method is deprecated and will be removed in a future version. Use MatterHistory.
1063
- *
1064
- * @param history - The MatterHistory instance.
1065
- * @param log - The AnsiLogger instance.
1066
- */
1067
- /*
1068
- createDoorEveHistoryClusterServer(history: MatterHistory, log: AnsiLogger) {
1069
- history.setMatterHystoryType('door');
1070
- this.addClusterServer(
1071
- ClusterServer(
1072
- EveHistoryCluster.with(EveHistory.Feature.EveDoor),
1073
- {
1074
- // Dynamic attributes
1075
- ConfigDataGet: Uint8Array.fromHex(''),
1076
- ConfigDataSet: Uint8Array.fromHex(''),
1077
- HistoryStatus: Uint8Array.fromHex(''),
1078
- HistoryEntries: Uint8Array.fromHex(''),
1079
- HistoryRequest: Uint8Array.fromHex(''),
1080
- HistorySetTime: Uint8Array.fromHex(''),
1081
- TimesOpened: 0,
1082
- LastEvent: 0,
1083
- ResetTotal: 0,
1084
- // Normal attributes
1085
- RLoc: 46080,
1086
- },
1087
- {
1088
- ConfigDataGetAttributeGetter: ({ session, isFabricFiltered }) => {
1089
- log.debug(`ConfigDataGetAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
1090
- return history.OnGetConfigData(isFabricFiltered);
1091
- },
1092
-
1093
- ConfigDataSetAttributeGetter: ({ session, isFabricFiltered }) => {
1094
- log.debug(`ConfigDataSetAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
1095
- return Uint8Array.fromHex('');
1096
- },
1097
- ConfigDataSetAttributeSetter: (value: Uint8Array, { attributes, endpoint, session }) => {
1098
- log.debug(`ConfigDataSetAttributeSetter [${value.toHex()}] ${attributes.ConfigDataSet} endpoint: ${endpoint?.name} session: ${session?.name}`);
1099
- return history.OnSetConfigData(value);
1100
- },
1101
-
1102
- HistoryStatusAttributeGetter: ({ session, isFabricFiltered }) => {
1103
- log.debug(`HistoryStatusAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
1104
- return history.OnGetHistoryStatus(isFabricFiltered);
1105
- },
1106
-
1107
- HistoryEntriesAttributeGetter: ({ session, isFabricFiltered }) => {
1108
- log.debug(`HistoryEntriesAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
1109
- return history.OnGetHistoryEntries();
1110
- },
1111
-
1112
- HistorySetTimeAttributeGetter: ({ session, isFabricFiltered }) => {
1113
- log.debug(`HistorySetTimeAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
1114
- return Uint8Array.fromHex('');
1115
- },
1116
- HistorySetTimeAttributeSetter: (value: Uint8Array, { attributes, endpoint, session }) => {
1117
- log.debug(`HistorySetTimeAttributeSetter ${value.toHex()} ${attributes.HistorySetTime} endpoint: ${endpoint?.name} session: ${session?.name}`);
1118
- return history.OnSetHistorySetTime(value);
1119
- },
1120
-
1121
- HistoryRequestAttributeGetter: ({ session, isFabricFiltered }) => {
1122
- log.debug(`HistoryRequestAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
1123
- return Uint8Array.fromHex('');
1124
- },
1125
- HistoryRequestAttributeSetter: (value: Uint8Array, { attributes, endpoint, session }) => {
1126
- log.debug(`HistoryRequestAttributeSetter ${value.toHex()} ${attributes.HistoryRequest} endpoint: ${endpoint?.name} session: ${session?.name}`);
1127
- return history.OnSetHistoryRequest(value);
1128
- },
1129
-
1130
- LastEventAttributeGetter: ({ session, isFabricFiltered }) => {
1131
- log.debug(`LastEventAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
1132
- return history.OnGetLastEvent();
1133
- },
1134
-
1135
- TimesOpenedAttributeGetter: ({ session, isFabricFiltered }) => {
1136
- log.debug(`TimesOpenedAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
1137
- return history.OnGetimesOpened();
1138
- },
1139
-
1140
- ResetTotalAttributeGetter: ({ session, isFabricFiltered }) => {
1141
- log.debug(`LastResetTotalAttributeGetter session: ${session?.name} ${isFabricFiltered?.valueOf()}`);
1142
- return history.OnGetLastReset();
1143
- },
1144
- ResetTotalAttributeSetter: (value: number, { attributes, endpoint, session }) => {
1145
- log.debug(`LastResetTotalAttributeSetter ${value} ${attributes.ResetTotal} endpoint: ${endpoint?.name} session: ${session?.name}`);
1146
- return history.OnSetLastReset(value);
1147
- },
1148
- },
1149
- {},
1150
- ),
1151
- );
1152
- }
1153
- */
1154
768
  /**
1155
769
  * Get a default IdentifyCluster server.
1156
770
  */
@@ -1194,25 +808,35 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
1194
808
  }
1195
809
  /**
1196
810
  * Get a default scenes cluster server and adds it to the current instance.
811
+ * @deprecated This method is deprecated.
812
+ *
1197
813
  */
1198
814
  getDefaultScenesClusterServer() {
1199
- return ClusterServer(ScenesCluster, {
815
+ /*
816
+ return ClusterServer(
817
+ ScenesCluster,
818
+ {
1200
819
  sceneCount: 0,
1201
820
  currentScene: 0,
1202
821
  currentGroup: GroupId(0),
1203
822
  sceneValid: false,
1204
823
  nameSupport: {
1205
- nameSupport: true,
824
+ nameSupport: true,
1206
825
  },
1207
826
  lastConfiguredBy: null,
1208
- }, ScenesClusterHandler());
1209
- // return createDefaultScenesClusterServer();
827
+ },
828
+ {},
829
+ );
830
+ */
1210
831
  }
1211
832
  /**
1212
833
  * Creates a default scenes cluster server and adds it to the current instance.
834
+ * @deprecated This method is deprecated.
1213
835
  */
1214
836
  createDefaultScenesClusterServer() {
837
+ /*
1215
838
  this.addClusterServer(this.getDefaultScenesClusterServer());
839
+ */
1216
840
  }
1217
841
  /**
1218
842
  * Creates a unique identifier based on the provided parameters.
@@ -1259,6 +883,8 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
1259
883
  hardwareVersionString: hardwareVersionString.slice(0, 64),
1260
884
  reachable: true,
1261
885
  capabilityMinima: { caseSessionsPerFabric: 3, subscriptionsPerFabric: 3 },
886
+ specificationVersion: Specification.SPECIFICATION_VERSION,
887
+ maxPathsPerInvoke: 1,
1262
888
  }, {}, {
1263
889
  startUp: true,
1264
890
  shutDown: true,
@@ -1307,7 +933,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
1307
933
  return ClusterServer(BridgedDeviceBasicInformationCluster, {
1308
934
  vendorId: vendorId !== undefined ? VendorId(vendorId) : undefined, // 4874
1309
935
  vendorName: vendorName.slice(0, 32),
1310
- productId: 0x8000,
1311
936
  productName: productName.slice(0, 32),
1312
937
  productLabel: deviceName.slice(0, 64),
1313
938
  nodeLabel: deviceName.slice(0, 32),
@@ -1408,44 +1033,6 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
1408
1033
  activePower: power,
1409
1034
  }, {}, {});
1410
1035
  }
1411
- /**
1412
- * @deprecated This method is deprecated and will be removed in a future version.
1413
- * Get a default Electrical Measurement Cluster Server.
1414
- *
1415
- * @param voltage - The RMS voltage value.
1416
- * @param current - The RMS current value.
1417
- * @param power - The active power value.
1418
- * @param consumption - The total active power consumption value.
1419
- */
1420
- /*
1421
- getDefaultElectricalMeasurementClusterServer(voltage = 0, current = 0, power = 0, consumption = 0) {
1422
- return ClusterServer(
1423
- ElectricalMeasurementCluster,
1424
- {
1425
- rmsVoltage: voltage,
1426
- rmsCurrent: current,
1427
- activePower: power,
1428
- totalActivePower: consumption,
1429
- },
1430
- {},
1431
- {},
1432
- );
1433
- }
1434
- */
1435
- /**
1436
- * @deprecated This method is deprecated and will be removed in a future version.
1437
- * Creates a default Electrical Measurement Cluster Server.
1438
- *
1439
- * @param voltage - The RMS voltage value.
1440
- * @param current - The RMS current value.
1441
- * @param power - The active power value.
1442
- * @param consumption - The total active power consumption value.
1443
- */
1444
- /*
1445
- createDefaultElectricalMeasurementClusterServer(voltage = 0, current = 0, power = 0, consumption = 0) {
1446
- this.addClusterServer(this.getDefaultElectricalMeasurementClusterServer(voltage, current, power, consumption));
1447
- }
1448
- */
1449
1036
  /**
1450
1037
  * Creates a default Dummy Thread Network Diagnostics Cluster server.
1451
1038
  * @deprecated This method is deprecated and is only used for testing.
@@ -1474,7 +1061,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
1474
1061
  channelPage0Mask: null,
1475
1062
  operationalDatasetComponents: null,
1476
1063
  overrunCount: 0,
1477
- activeNetworkFaults: [],
1064
+ activeNetworkFaultsList: [],
1478
1065
  }, {
1479
1066
  resetCounts: async (data) => {
1480
1067
  this.log.debug('Matter command: resetCounts');
@@ -1749,25 +1336,25 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
1749
1336
  * @param colorTempPhysicalMinMireds - The physical minimum color temperature in mireds.
1750
1337
  * @param colorTempPhysicalMaxMireds - The physical maximum color temperature in mireds.
1751
1338
  */
1752
- getDefaultCompleteColorControlClusterServer(currentX = 0, currentY = 0, colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
1339
+ getDefaultCompleteColorControlClusterServer(currentX = 0, currentY = 0, currentHue = 0, currentSaturation = 0, colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
1753
1340
  return ClusterServer(ColorControlCluster.with(ColorControl.Feature.Xy, ColorControl.Feature.HueSaturation, ColorControl.Feature.ColorTemperature), {
1754
1341
  colorMode: ColorControl.ColorMode.CurrentHueAndCurrentSaturation,
1342
+ enhancedColorMode: ColorControl.EnhancedColorMode.CurrentHueAndCurrentSaturation,
1343
+ colorCapabilities: { xy: true, hueSaturation: true, colorLoop: false, enhancedHue: false, colorTemperature: true },
1755
1344
  options: {
1756
1345
  executeIfOff: false,
1757
1346
  },
1758
1347
  numberOfPrimaries: null,
1759
- enhancedColorMode: ColorControl.EnhancedColorMode.CurrentHueAndCurrentSaturation,
1760
- colorCapabilities: { xy: true, hueSaturation: true, colorLoop: false, enhancedHue: false, colorTemperature: true },
1761
- currentHue: 0,
1762
- currentSaturation: 0,
1763
1348
  currentX,
1764
1349
  currentY,
1350
+ currentHue,
1351
+ currentSaturation,
1765
1352
  colorTemperatureMireds,
1766
1353
  colorTempPhysicalMinMireds,
1767
1354
  colorTempPhysicalMaxMireds,
1768
1355
  }, {
1769
1356
  moveToColor: async (data) => {
1770
- this.log.debug('Matter command: moveToColor request:', data.request, 'attributes.currentHue:', data.attributes.currentX.getLocal(), data.attributes.currentY.getLocal());
1357
+ this.log.debug('Matter command: moveToColor request:', data.request, 'attributes.currentX:', data.attributes.currentX.getLocal(), 'attributes.currentY:', data.attributes.currentY.getLocal());
1771
1358
  this.commandHandler.executeHandler('moveToColor', data);
1772
1359
  },
1773
1360
  moveColor: async () => {
@@ -1826,8 +1413,8 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
1826
1413
  * @param colorTempPhysicalMinMireds - The physical minimum color temperature in mireds.
1827
1414
  * @param colorTempPhysicalMaxMireds - The physical maximum color temperature in mireds.
1828
1415
  */
1829
- createDefaultCompleteColorControlClusterServer(currentX = 0, currentY = 0, colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
1830
- this.addClusterServer(this.getDefaultCompleteColorControlClusterServer(currentX, currentY, colorTemperatureMireds, colorTempPhysicalMinMireds, colorTempPhysicalMaxMireds));
1416
+ createDefaultCompleteColorControlClusterServer(currentX = 0, currentY = 0, currentHue = 0, currentSaturation = 0, colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
1417
+ this.addClusterServer(this.getDefaultCompleteColorControlClusterServer(currentX, currentY, currentHue, currentSaturation, colorTemperatureMireds, colorTempPhysicalMinMireds, colorTempPhysicalMaxMireds));
1831
1418
  }
1832
1419
  /**
1833
1420
  * Configures the color control cluster for a device.
@@ -2010,7 +1597,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
2010
1597
  * This method adds a cluster server for a door lock cluster with default settings.
2011
1598
  *
2012
1599
  */
2013
- getDefaultDoorLockClusterServer(lockState = DoorLock.LockState.Locked, lockType = DoorLock.LockType.Deadbolt) {
1600
+ getDefaultDoorLockClusterServer(lockState = DoorLock.LockState.Locked, lockType = DoorLock.LockType.DeadBolt) {
2014
1601
  return ClusterServer(DoorLockCluster, {
2015
1602
  operatingMode: DoorLock.OperatingMode.Normal,
2016
1603
  lockState,
@@ -2039,7 +1626,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
2039
1626
  * This method adds a cluster server for a door lock cluster with default settings.
2040
1627
  *
2041
1628
  */
2042
- createDefaultDoorLockClusterServer(lockState = DoorLock.LockState.Locked, lockType = DoorLock.LockType.Deadbolt) {
1629
+ createDefaultDoorLockClusterServer(lockState = DoorLock.LockState.Locked, lockType = DoorLock.LockType.DeadBolt) {
2043
1630
  this.addClusterServer(this.getDefaultDoorLockClusterServer(lockState, lockType));
2044
1631
  }
2045
1632
  /**
@@ -2101,7 +1688,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
2101
1688
  /**
2102
1689
  * Triggers a switch event on the specified endpoint.
2103
1690
  *
2104
- * @param {string} event - The type of event to trigger. Possible values are 'Single', 'Double', 'Long', 'Press', and 'Release'.
1691
+ * @param {string} event - The type of event to trigger. Possible values are 'Single', 'Double', 'Long' for momentarySwitch and 'Press', 'Release' for latchingSwitch.
2105
1692
  * @param {Endpoint} endpoint - The endpoint on which to trigger the event (default the device endpoint).
2106
1693
  * @returns {void}
2107
1694
  */
@@ -2420,6 +2007,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
2420
2007
  activeBatFaults: undefined,
2421
2008
  batReplacementDescription,
2422
2009
  batQuantity,
2010
+ endpointList: [],
2423
2011
  }, {}, {});
2424
2012
  }
2425
2013
  /**
@@ -2455,6 +2043,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
2455
2043
  activeBatFaults: undefined,
2456
2044
  batChargeState: PowerSource.BatChargeState.IsNotCharging,
2457
2045
  batFunctionalWhileCharging: true,
2046
+ endpointList: [],
2458
2047
  }, {}, {});
2459
2048
  }
2460
2049
  /**
@@ -2478,6 +2067,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
2478
2067
  description: wiredCurrentType === PowerSource.WiredCurrentType.Ac ? 'AC Power' : 'DC Power',
2479
2068
  status: PowerSource.PowerSourceStatus.Active,
2480
2069
  order: 0,
2070
+ endpointList: [],
2481
2071
  }, {}, {});
2482
2072
  }
2483
2073
  /**
@@ -2581,15 +2171,25 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
2581
2171
  * Get a default dummy time sync cluster server. Only needed to create a thermostat.
2582
2172
  */
2583
2173
  getDefaultTimeSyncClusterServer() {
2584
- return ClusterServer(TimeSyncCluster.with(TimeSync.Feature.TimeZone), {
2174
+ return ClusterServer(TimeSynchronizationCluster.with(TimeSynchronization.Feature.TimeZone), {
2585
2175
  utcTime: null,
2586
- granularity: TimeSync.Granularity.NoTimeGranularity,
2176
+ granularity: TimeSynchronization.Granularity.NoTimeGranularity,
2587
2177
  timeZone: [{ offset: 0, validAt: 0 }],
2588
- trustedTimeNodeId: null,
2589
2178
  dstOffset: [],
2590
2179
  localTime: null,
2591
- timeZoneDatabase: true,
2180
+ timeZoneDatabase: TimeSynchronization.TimeZoneDatabase.None,
2181
+ timeZoneListMaxSize: 1,
2182
+ dstOffsetListMaxSize: 1,
2592
2183
  }, {
2184
+ setTimeZone: async ({ request, attributes }) => {
2185
+ this.log.debug('Matter command: setTimeZone', request);
2186
+ await this.commandHandler.executeHandler('setTimeZone', { request, attributes });
2187
+ return { dstOffsetsRequired: false };
2188
+ },
2189
+ setDstOffset: async ({ request, attributes }) => {
2190
+ this.log.debug('Matter command: setDstOffset', request);
2191
+ await this.commandHandler.executeHandler('setDstOffset', { request, attributes });
2192
+ },
2593
2193
  setUtcTime: async ({ request, attributes }) => {
2594
2194
  this.log.debug('Matter command: setUtcTime', request);
2595
2195
  await this.commandHandler.executeHandler('setUtcTime', { request, attributes });
@@ -2598,6 +2198,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
2598
2198
  dstTableEmpty: true,
2599
2199
  dstStatus: true,
2600
2200
  timeZoneStatus: true,
2201
+ timeFailure: true,
2601
2202
  });
2602
2203
  }
2603
2204
  /**