matterbridge-example-dynamic-platform 1.1.9 → 1.2.0-edge.11

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/dist/platform.js CHANGED
@@ -1,7 +1,9 @@
1
- import { MatterbridgeEndpoint, MatterbridgeDynamicPlatform, airConditioner, airQualitySensor, bridgedNode, colorTemperatureLight, coverDevice, dimmableLight, doorLockDevice, fanDevice, flowSensor, humiditySensor, onOffLight, onOffOutlet, onOffSwitch, powerSource, rainSensor, smokeCoAlarm, temperatureSensor, thermostatDevice, waterFreezeDetector, waterLeakDetector, airPurifier, pumpDevice, waterValve, genericSwitch, } from 'matterbridge';
1
+ import { MatterbridgeEndpoint, MatterbridgeDynamicPlatform, airQualitySensor, bridgedNode, colorTemperatureLight, coverDevice, dimmableLight, doorLockDevice, fanDevice, flowSensor, humiditySensor, onOffLight, onOffOutlet, onOffSwitch, powerSource, rainSensor, smokeCoAlarm, temperatureSensor, thermostatDevice, waterFreezeDetector, waterLeakDetector, airPurifier, pumpDevice, waterValve, genericSwitch, airConditioner, laundryWasher, cooktop, extractorHood, microwaveOven, oven, refrigerator, dishwasher, laundryDryer, onOffMountedSwitch, dimmableMountedSwitch, extendedColorLight, } from 'matterbridge';
2
2
  import { isValidBoolean, isValidNumber } from 'matterbridge/utils';
3
3
  import { LocationTag } from 'matterbridge/matter';
4
4
  import { PowerSource, BooleanState, OnOff, LevelControl, AirQuality, CarbonDioxideConcentrationMeasurement, CarbonMonoxideConcentrationMeasurement, FlowMeasurement, ColorControl, DoorLock, FanControl, FormaldehydeConcentrationMeasurement, NitrogenDioxideConcentrationMeasurement, OzoneConcentrationMeasurement, Pm10ConcentrationMeasurement, Pm1ConcentrationMeasurement, Pm25ConcentrationMeasurement, RadonConcentrationMeasurement, RelativeHumidityMeasurement, RelativeHumidityMeasurementCluster, SmokeCoAlarm, TemperatureMeasurement, Thermostat, ThermostatCluster, TotalVolatileOrganicCompoundsConcentrationMeasurement, WindowCovering, } from 'matterbridge/matter/clusters';
5
+ import { Appliances } from './appliances.js';
6
+ import { Robot } from './robot.js';
5
7
  export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatform {
6
8
  switch;
7
9
  mountedOnOffSwitch;
@@ -48,6 +50,9 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
48
50
  airConditionerInterval;
49
51
  genericSwitchInterval;
50
52
  genericSwitchLastEvent = 'Release';
53
+ intervalOnOff = false;
54
+ intervalLevel = 0;
55
+ intervalColorTemperature = 147;
51
56
  bridgedDevices = new Map();
52
57
  fanModeLookup = ['Off', 'Low', 'Medium', 'High', 'On', 'Auto', 'Smart'];
53
58
  constructor(matterbridge, log, config) {
@@ -90,6 +95,65 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
90
95
  await this.switch?.setAttribute(OnOff.Cluster.id, 'onOff', false, this.switch.log);
91
96
  this.switch?.log.info('Command off called');
92
97
  });
98
+ this.mountedOnOffSwitch = new MatterbridgeEndpoint([onOffMountedSwitch, bridgedNode, powerSource], { uniqueStorageKey: 'OnOffMountedSwitch' }, this.config.debug)
99
+ .createDefaultIdentifyClusterServer()
100
+ .createDefaultGroupsClusterServer()
101
+ .createDefaultBridgedDeviceBasicInformationClusterServer('OnOff Mounted Switch', '0x298242164', 0xfff1, 'Matterbridge', 'Matterbridge OnOff Mounted Switch', parseInt(this.version.replace(/\D/g, '')), this.version === '' ? 'Unknown' : this.version, parseInt(this.matterbridge.matterbridgeVersion.replace(/\D/g, '')), this.matterbridge.matterbridgeVersion)
102
+ .createDefaultOnOffClusterServer()
103
+ .createDefaultPowerSourceRechargeableBatteryClusterServer(70);
104
+ this.setSelectDevice(this.mountedOnOffSwitch.serialNumber ?? '', this.mountedOnOffSwitch.deviceName ?? '', undefined, 'hub');
105
+ if (this.validateDevice(this.mountedOnOffSwitch.deviceName ?? '')) {
106
+ await this.registerDevice(this.mountedOnOffSwitch);
107
+ this.bridgedDevices.set(this.mountedOnOffSwitch.deviceName ?? '', this.mountedOnOffSwitch);
108
+ }
109
+ else {
110
+ this.mountedOnOffSwitch = undefined;
111
+ }
112
+ this.mountedOnOffSwitch?.addCommandHandler('identify', async ({ request: { identifyTime } }) => {
113
+ this.mountedOnOffSwitch?.log.info(`Command identify called identifyTime:${identifyTime}`);
114
+ });
115
+ this.mountedOnOffSwitch?.addCommandHandler('on', async () => {
116
+ await this.mountedOnOffSwitch?.setAttribute(OnOff.Cluster.id, 'onOff', true, this.mountedOnOffSwitch.log);
117
+ this.mountedOnOffSwitch?.log.info('Command on called');
118
+ });
119
+ this.mountedOnOffSwitch?.addCommandHandler('off', async () => {
120
+ await this.mountedOnOffSwitch?.setAttribute(OnOff.Cluster.id, 'onOff', false, this.mountedOnOffSwitch.log);
121
+ this.mountedOnOffSwitch?.log.info('Command off called');
122
+ });
123
+ this.mountedDimmerSwitch = new MatterbridgeEndpoint([dimmableMountedSwitch, bridgedNode, powerSource], { uniqueStorageKey: 'DimmerMountedSwitch' }, this.config.debug)
124
+ .createDefaultIdentifyClusterServer()
125
+ .createDefaultGroupsClusterServer()
126
+ .createDefaultBridgedDeviceBasicInformationClusterServer('Dimmer Mounted Switch', '0x22145578864', 0xfff1, 'Matterbridge', 'Matterbridge Dimmer Mounted Switch', parseInt(this.version.replace(/\D/g, '')), this.version === '' ? 'Unknown' : this.version, parseInt(this.matterbridge.matterbridgeVersion.replace(/\D/g, '')), this.matterbridge.matterbridgeVersion)
127
+ .createDefaultOnOffClusterServer()
128
+ .createDefaultLevelControlClusterServer()
129
+ .createDefaultPowerSourceRechargeableBatteryClusterServer(70);
130
+ this.setSelectDevice(this.mountedDimmerSwitch.serialNumber ?? '', this.mountedDimmerSwitch.deviceName ?? '', undefined, 'hub');
131
+ if (this.validateDevice(this.mountedDimmerSwitch.deviceName ?? '')) {
132
+ await this.registerDevice(this.mountedDimmerSwitch);
133
+ this.bridgedDevices.set(this.mountedDimmerSwitch.deviceName ?? '', this.mountedDimmerSwitch);
134
+ }
135
+ else {
136
+ this.mountedDimmerSwitch = undefined;
137
+ }
138
+ this.mountedDimmerSwitch?.addCommandHandler('identify', async ({ request: { identifyTime } }) => {
139
+ this.mountedDimmerSwitch?.log.info(`Command identify called identifyTime:${identifyTime}`);
140
+ });
141
+ this.mountedDimmerSwitch?.addCommandHandler('on', async () => {
142
+ await this.mountedDimmerSwitch?.setAttribute(OnOff.Cluster.id, 'onOff', true, this.mountedDimmerSwitch.log);
143
+ this.mountedDimmerSwitch?.log.info('Command on called');
144
+ });
145
+ this.mountedDimmerSwitch?.addCommandHandler('off', async () => {
146
+ await this.mountedDimmerSwitch?.setAttribute(OnOff.Cluster.id, 'onOff', false, this.mountedDimmerSwitch.log);
147
+ this.mountedDimmerSwitch?.log.info('Command off called');
148
+ });
149
+ this.mountedDimmerSwitch?.addCommandHandler('moveToLevel', async ({ request: { level } }) => {
150
+ await this.mountedDimmerSwitch?.setAttribute(LevelControl.Cluster.id, 'currentLevel', level, this.mountedDimmerSwitch.log);
151
+ this.mountedDimmerSwitch?.log.debug(`Command moveToLevel called request: ${level}`);
152
+ });
153
+ this.mountedDimmerSwitch?.addCommandHandler('moveToLevelWithOnOff', async ({ request: { level } }) => {
154
+ await this.mountedDimmerSwitch?.setAttribute(LevelControl.Cluster.id, 'currentLevel', level, this.mountedDimmerSwitch.log);
155
+ this.mountedDimmerSwitch?.log.debug(`Command moveToLevelWithOnOff called request: ${level}`);
156
+ });
93
157
  this.lightOnOff = new MatterbridgeEndpoint([onOffLight, bridgedNode, powerSource], { uniqueStorageKey: 'Light (on/off)' }, this.config.debug)
94
158
  .createDefaultIdentifyClusterServer()
95
159
  .createDefaultGroupsClusterServer()
@@ -121,7 +185,7 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
121
185
  .createDefaultBridgedDeviceBasicInformationClusterServer('Dimmer', '0x234554564', 0xfff1, 'Matterbridge', 'Matterbridge Dimmer', parseInt(this.version.replace(/\D/g, '')), this.version === '' ? 'Unknown' : this.version, parseInt(this.matterbridge.matterbridgeVersion.replace(/\D/g, '')), this.matterbridge.matterbridgeVersion)
122
186
  .createDefaultOnOffClusterServer()
123
187
  .createDefaultLevelControlClusterServer()
124
- .createDefaultPowerSourceReplaceableBatteryClusterServer(70);
188
+ .createDefaultPowerSourceReplaceableBatteryClusterServer(70, PowerSource.BatChargeLevel.Ok, 2990, '2 x AA', 2);
125
189
  this.setSelectDevice(this.dimmer.serialNumber ?? '', this.dimmer.deviceName ?? '', undefined, 'hub');
126
190
  if (this.validateDevice(this.dimmer.deviceName ?? '')) {
127
191
  await this.registerDevice(this.dimmer);
@@ -149,7 +213,7 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
149
213
  await this.dimmer?.setAttribute(LevelControl.Cluster.id, 'currentLevel', level, this.dimmer.log);
150
214
  this.dimmer?.log.debug(`Command moveToLevelWithOnOff called request: ${level}`);
151
215
  });
152
- this.light = new MatterbridgeEndpoint([colorTemperatureLight, bridgedNode, powerSource], { uniqueStorageKey: 'Light (XY, HS and CT)' }, this.config.debug)
216
+ this.light = new MatterbridgeEndpoint([extendedColorLight, bridgedNode, powerSource], { uniqueStorageKey: 'Light (XY, HS and CT)' }, this.config.debug)
153
217
  .createDefaultIdentifyClusterServer()
154
218
  .createDefaultGroupsClusterServer()
155
219
  .createDefaultBridgedDeviceBasicInformationClusterServer('Light (XY, HS and CT)', '0x23480564', 0xfff1, 'Matterbridge', 'Matterbridge Light', parseInt(this.version.replace(/\D/g, '')), this.version === '' ? 'Unknown' : this.version, parseInt(this.matterbridge.matterbridgeVersion.replace(/\D/g, '')), this.matterbridge.matterbridgeVersion)
@@ -258,7 +322,7 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
258
322
  await this.lightHS?.setAttribute(ColorControl.Cluster.id, 'colorTemperatureMireds', colorTemperatureMireds, this.lightHS?.log);
259
323
  this.lightHS?.log.debug(`Command moveToColorTemperature called request: ${colorTemperatureMireds}`);
260
324
  });
261
- this.lightXY = new MatterbridgeEndpoint([colorTemperatureLight, bridgedNode, powerSource], { uniqueStorageKey: 'Light (XY, CT)' }, this.config.debug)
325
+ this.lightXY = new MatterbridgeEndpoint([extendedColorLight, bridgedNode, powerSource], { uniqueStorageKey: 'Light (XY, CT)' }, this.config.debug)
262
326
  .createDefaultIdentifyClusterServer()
263
327
  .createDefaultGroupsClusterServer()
264
328
  .createDefaultBridgedDeviceBasicInformationClusterServer('Light (XY, CT)', '0x23497564', 0xfff1, 'Matterbridge', 'Matterbridge Light', parseInt(this.version.replace(/\D/g, '')), this.version === '' ? 'Unknown' : this.version, parseInt(this.matterbridge.matterbridgeVersion.replace(/\D/g, '')), this.matterbridge.matterbridgeVersion)
@@ -554,7 +618,9 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
554
618
  .createDefaultFanControlClusterServer()
555
619
  .createDefaultTemperatureMeasurementClusterServer(20 * 100)
556
620
  .createDefaultRelativeHumidityMeasurementClusterServer(50 * 100)
557
- .createDefaultPowerSourceWiredClusterServer();
621
+ .createDefaultPowerSourceWiredClusterServer()
622
+ .createDefaultActivatedCarbonFilterMonitoringClusterServer()
623
+ .createDefaultHepaFilterMonitoringClusterServer();
558
624
  this.setSelectDevice(this.airPurifier.serialNumber ?? '', this.airPurifier.deviceName ?? '', undefined, 'hub');
559
625
  if (this.validateDevice(this.airPurifier.deviceName ?? '')) {
560
626
  await this.registerDevice(this.airPurifier);
@@ -592,11 +658,12 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
592
658
  if (isValidNumber(newValue, 0, 100))
593
659
  await this.airPurifier?.setAttribute(FanControl.Cluster.id, 'percentCurrent', newValue, this.airPurifier?.log);
594
660
  }, this.airPurifier.log);
595
- this.airConditioner = new MatterbridgeEndpoint([airConditioner, bridgedNode, powerSource], { uniqueStorageKey: 'Air conditioner' }, this.config.debug)
596
- .createDefaultBridgedDeviceBasicInformationClusterServer('Air conditioner', '0x96382864AC', 0xfff1, 'Matterbridge', 'Matterbridge Air conditioner', parseInt(this.version.replace(/\D/g, '')), this.version === '' ? 'Unknown' : this.version, parseInt(this.matterbridge.matterbridgeVersion.replace(/\D/g, '')), this.matterbridge.matterbridgeVersion)
661
+ this.airConditioner = new MatterbridgeEndpoint([airConditioner, bridgedNode, powerSource], { uniqueStorageKey: 'Air Conditioner' }, this.config.debug)
662
+ .createDefaultBridgedDeviceBasicInformationClusterServer('Air Conditioner', '0x96382864AC', 0xfff1, 'Matterbridge', 'Matterbridge Air Conditioner', parseInt(this.version.replace(/\D/g, '')), this.version === '' ? 'Unknown' : this.version, parseInt(this.matterbridge.matterbridgeVersion.replace(/\D/g, '')), this.matterbridge.matterbridgeVersion)
597
663
  .createDefaultIdentifyClusterServer()
598
664
  .createDeadFrontOnOffClusterServer(true)
599
665
  .createDefaultThermostatClusterServer(20, 18, 22)
666
+ .createDefaultThermostatUserInterfaceConfigurationClusterServer()
600
667
  .createDefaultFanControlClusterServer(FanControl.FanMode.Auto)
601
668
  .createDefaultTemperatureMeasurementClusterServer(20 * 100)
602
669
  .createDefaultRelativeHumidityMeasurementClusterServer(50 * 100)
@@ -615,8 +682,6 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
615
682
  });
616
683
  this.airConditioner?.addCommandHandler('on', async () => {
617
684
  this.airConditioner?.log.info('Command on called');
618
- await this.airConditioner?.setAttribute(OnOff.Cluster.id, 'onOff', true, this.airConditioner?.log);
619
- await this.airConditioner?.setAttribute(OnOff.Cluster.id, 'onOff', true, this.airConditioner?.log);
620
685
  await this.airConditioner?.setAttribute(ThermostatCluster.id, 'localTemperature', 20 * 100, this.airConditioner?.log);
621
686
  await this.airConditioner?.setAttribute(TemperatureMeasurement.Cluster.id, 'measuredValue', 20 * 100, this.airConditioner?.log);
622
687
  await this.airConditioner?.setAttribute(RelativeHumidityMeasurementCluster.id, 'measuredValue', 50 * 100, this.airConditioner?.log);
@@ -625,7 +690,6 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
625
690
  });
626
691
  this.airConditioner?.addCommandHandler('off', async () => {
627
692
  this.airConditioner?.log.info('Command off called');
628
- await this.airConditioner?.setAttribute(OnOff.Cluster.id, 'onOff', false, this.airConditioner?.log);
629
693
  await this.airConditioner?.setAttribute(ThermostatCluster.id, 'localTemperature', null, this.airConditioner?.log);
630
694
  await this.airConditioner?.setAttribute(TemperatureMeasurement.Cluster.id, 'measuredValue', null, this.airConditioner?.log);
631
695
  await this.airConditioner?.setAttribute(RelativeHumidityMeasurementCluster.id, 'measuredValue', null, this.airConditioner?.log);
@@ -635,7 +699,8 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
635
699
  this.pump = new MatterbridgeEndpoint([pumpDevice, bridgedNode, powerSource], { uniqueStorageKey: 'Pump' }, this.config.debug)
636
700
  .createDefaultBridgedDeviceBasicInformationClusterServer('Pump', '0x96382864PUMP', 0xfff1, 'Matterbridge', 'Matterbridge Pump', parseInt(this.version.replace(/\D/g, '')), this.version === '' ? 'Unknown' : this.version, parseInt(this.matterbridge.matterbridgeVersion.replace(/\D/g, '')), this.matterbridge.matterbridgeVersion)
637
701
  .createDefaultIdentifyClusterServer()
638
- .createDefaultOnOffClusterServer(true)
702
+ .createOnOffClusterServer()
703
+ .createLevelControlClusterServer()
639
704
  .createDefaultPumpConfigurationAndControlClusterServer()
640
705
  .createDefaultPowerSourceWiredClusterServer();
641
706
  this.setSelectDevice(this.pump.serialNumber ?? '', this.pump.deviceName ?? '', undefined, 'hub');
@@ -673,8 +738,9 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
673
738
  this.valve?.addCommandHandler('identify', async ({ request: { identifyTime } }) => {
674
739
  this.valve?.log.info(`Command identify called identifyTime:${identifyTime}`);
675
740
  });
676
- this.fan = new MatterbridgeEndpoint([fanDevice, bridgedNode], { uniqueStorageKey: 'Fan' }, this.config.debug)
741
+ this.fan = new MatterbridgeEndpoint([fanDevice, bridgedNode, powerSource], { uniqueStorageKey: 'Fan' }, this.config.debug)
677
742
  .createDefaultBridgedDeviceBasicInformationClusterServer('Fan', 'serial_980545631228', 0xfff1, 'Matterbridge', 'Matterbridge Fan', parseInt(this.version.replace(/\D/g, '')), this.version === '' ? 'Unknown' : this.version, parseInt(this.matterbridge.matterbridgeVersion.replace(/\D/g, '')), this.matterbridge.matterbridgeVersion)
743
+ .createDefaultPowerSourceWiredClusterServer()
678
744
  .addRequiredClusterServers();
679
745
  this.setSelectDevice(this.fan.serialNumber ?? '', this.fan.deviceName ?? '', undefined, 'hub');
680
746
  if (this.validateDevice(this.fan.deviceName ?? '')) {
@@ -721,8 +787,9 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
721
787
  if (isValidNumber(newValue, 0, 100))
722
788
  await this.fan?.setAttribute(FanControl.Cluster.id, 'speedCurrent', newValue, this.fan?.log);
723
789
  }, this.fan.log);
724
- this.waterLeak = new MatterbridgeEndpoint([waterLeakDetector, bridgedNode], { uniqueStorageKey: 'Water leak detector' }, this.config.debug)
790
+ this.waterLeak = new MatterbridgeEndpoint([waterLeakDetector, bridgedNode, powerSource], { uniqueStorageKey: 'Water leak detector' }, this.config.debug)
725
791
  .createDefaultBridgedDeviceBasicInformationClusterServer('Water leak detector', 'serial_98745631222', 0xfff1, 'Matterbridge', 'Matterbridge WaterLeakDetector', parseInt(this.version.replace(/\D/g, '')), this.version === '' ? 'Unknown' : this.version, parseInt(this.matterbridge.matterbridgeVersion.replace(/\D/g, '')), this.matterbridge.matterbridgeVersion)
792
+ .createDefaultPowerSourceRechargeableBatteryClusterServer()
726
793
  .createDefaultBooleanStateClusterServer(false)
727
794
  .addRequiredClusterServers()
728
795
  .addOptionalClusterServers();
@@ -734,8 +801,9 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
734
801
  else {
735
802
  this.waterLeak = undefined;
736
803
  }
737
- this.waterFreeze = new MatterbridgeEndpoint([waterFreezeDetector, bridgedNode], { uniqueStorageKey: 'Water freeze detector' }, this.config.debug)
804
+ this.waterFreeze = new MatterbridgeEndpoint([waterFreezeDetector, bridgedNode, powerSource], { uniqueStorageKey: 'Water freeze detector' }, this.config.debug)
738
805
  .createDefaultBridgedDeviceBasicInformationClusterServer('Water freeze detector', 'serial_98745631223', 0xfff1, 'Matterbridge', 'Matterbridge WaterFreezeDetector', parseInt(this.version.replace(/\D/g, '')), this.version === '' ? 'Unknown' : this.version, parseInt(this.matterbridge.matterbridgeVersion.replace(/\D/g, '')), this.matterbridge.matterbridgeVersion)
806
+ .createDefaultPowerSourceRechargeableBatteryClusterServer()
739
807
  .createDefaultBooleanStateClusterServer(false)
740
808
  .addRequiredClusterServers()
741
809
  .addOptionalClusterServers();
@@ -747,8 +815,9 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
747
815
  else {
748
816
  this.waterFreeze = undefined;
749
817
  }
750
- this.rain = new MatterbridgeEndpoint([rainSensor, bridgedNode], { uniqueStorageKey: 'Rain sensor' }, this.config.debug)
818
+ this.rain = new MatterbridgeEndpoint([rainSensor, bridgedNode, powerSource], { uniqueStorageKey: 'Rain sensor' }, this.config.debug)
751
819
  .createDefaultBridgedDeviceBasicInformationClusterServer('Rain sensor', 'serial_98745631224', 0xfff1, 'Matterbridge', 'Matterbridge RainSensor', parseInt(this.version.replace(/\D/g, '')), this.version === '' ? 'Unknown' : this.version, parseInt(this.matterbridge.matterbridgeVersion.replace(/\D/g, '')), this.matterbridge.matterbridgeVersion)
820
+ .createDefaultPowerSourceRechargeableBatteryClusterServer()
752
821
  .createDefaultIdentifyClusterServer()
753
822
  .createDefaultBooleanStateClusterServer(false)
754
823
  .createDefaultBooleanStateConfigurationClusterServer();
@@ -760,10 +829,11 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
760
829
  else {
761
830
  this.rain = undefined;
762
831
  }
763
- this.smokeCo = new MatterbridgeEndpoint([smokeCoAlarm, bridgedNode], { uniqueStorageKey: 'SmokeCo alarm sensor' }, this.config.debug)
832
+ this.smokeCo = new MatterbridgeEndpoint([smokeCoAlarm, bridgedNode, powerSource], { uniqueStorageKey: 'SmokeCo alarm sensor' }, this.config.debug)
764
833
  .createDefaultBridgedDeviceBasicInformationClusterServer('SmokeCo alarm sensor', 'serial_94745631225', 0xfff1, 'Matterbridge', 'Matterbridge SmokeCoAlarm', parseInt(this.version.replace(/\D/g, '')), this.version === '' ? 'Unknown' : this.version, parseInt(this.matterbridge.matterbridgeVersion.replace(/\D/g, '')), this.matterbridge.matterbridgeVersion)
765
834
  .createDefaultIdentifyClusterServer()
766
- .createDefaultSmokeCOAlarmClusterServer(SmokeCoAlarm.AlarmState.Normal, SmokeCoAlarm.AlarmState.Normal);
835
+ .createDefaultSmokeCOAlarmClusterServer(SmokeCoAlarm.AlarmState.Normal, SmokeCoAlarm.AlarmState.Normal)
836
+ .createDefaultPowerSourceReplaceableBatteryClusterServer();
767
837
  if (this.config.enableConcentrationMeasurements === true)
768
838
  this.smokeCo.createDefaultCarbonMonoxideConcentrationMeasurementClusterServer(100);
769
839
  this.setSelectDevice(this.smokeCo.serialNumber ?? '', this.smokeCo.deviceName ?? '', undefined, 'hub');
@@ -774,10 +844,11 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
774
844
  else {
775
845
  this.smokeCo = undefined;
776
846
  }
777
- this.smokeOnly = new MatterbridgeEndpoint([smokeCoAlarm, bridgedNode], { uniqueStorageKey: 'Smoke only SmokeCo alarm sensor' }, this.config.debug)
778
- .createDefaultBridgedDeviceBasicInformationClusterServer('Smoke only SmokeCo alarm sensor', 'serial_94755661225', 0xfff1, 'Matterbridge', 'Matterbridge SmokeCoAlarm', parseInt(this.version.replace(/\D/g, '')), this.version === '' ? 'Unknown' : this.version, parseInt(this.matterbridge.matterbridgeVersion.replace(/\D/g, '')), this.matterbridge.matterbridgeVersion)
847
+ this.smokeOnly = new MatterbridgeEndpoint([smokeCoAlarm, bridgedNode, powerSource], { uniqueStorageKey: 'Smoke alarm sensor' }, this.config.debug)
848
+ .createDefaultBridgedDeviceBasicInformationClusterServer('Smoke alarm sensor', 'serial_94755661225', 0xfff1, 'Matterbridge', 'Matterbridge SmokeCoAlarm', parseInt(this.version.replace(/\D/g, '')), this.version === '' ? 'Unknown' : this.version, parseInt(this.matterbridge.matterbridgeVersion.replace(/\D/g, '')), this.matterbridge.matterbridgeVersion)
779
849
  .createDefaultIdentifyClusterServer()
780
- .createSmokeOnlySmokeCOAlarmClusterServer(SmokeCoAlarm.AlarmState.Normal);
850
+ .createSmokeOnlySmokeCOAlarmClusterServer(SmokeCoAlarm.AlarmState.Normal)
851
+ .createDefaultPowerSourceReplaceableBatteryClusterServer();
781
852
  this.setSelectDevice(this.smokeOnly.serialNumber ?? '', this.smokeOnly.deviceName ?? '', undefined, 'hub');
782
853
  if (this.validateDevice(this.smokeOnly.deviceName ?? '')) {
783
854
  await this.registerDevice(this.smokeOnly);
@@ -786,10 +857,11 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
786
857
  else {
787
858
  this.smokeOnly = undefined;
788
859
  }
789
- this.coOnly = new MatterbridgeEndpoint([smokeCoAlarm, bridgedNode], { uniqueStorageKey: 'Co only SmokeCo alarm sensor' }, this.config.debug)
790
- .createDefaultBridgedDeviceBasicInformationClusterServer('Co only SmokeCo alarm sensor', 'serial_947456317488', 0xfff1, 'Matterbridge', 'Matterbridge SmokeCoAlarm', parseInt(this.version.replace(/\D/g, '')), this.version === '' ? 'Unknown' : this.version, parseInt(this.matterbridge.matterbridgeVersion.replace(/\D/g, '')), this.matterbridge.matterbridgeVersion)
860
+ this.coOnly = new MatterbridgeEndpoint([smokeCoAlarm, bridgedNode, powerSource], { uniqueStorageKey: 'Co alarm sensor' }, this.config.debug)
861
+ .createDefaultBridgedDeviceBasicInformationClusterServer('Co alarm sensor', 'serial_947456317488', 0xfff1, 'Matterbridge', 'Matterbridge SmokeCoAlarm', parseInt(this.version.replace(/\D/g, '')), this.version === '' ? 'Unknown' : this.version, parseInt(this.matterbridge.matterbridgeVersion.replace(/\D/g, '')), this.matterbridge.matterbridgeVersion)
791
862
  .createDefaultIdentifyClusterServer()
792
- .createCoOnlySmokeCOAlarmClusterServer(SmokeCoAlarm.AlarmState.Normal);
863
+ .createCoOnlySmokeCOAlarmClusterServer(SmokeCoAlarm.AlarmState.Normal)
864
+ .createDefaultPowerSourceReplaceableBatteryClusterServer();
793
865
  if (this.config.enableConcentrationMeasurements === true)
794
866
  this.coOnly.createDefaultCarbonMonoxideConcentrationMeasurementClusterServer(100);
795
867
  this.setSelectDevice(this.coOnly.serialNumber ?? '', this.coOnly.deviceName ?? '', undefined, 'hub');
@@ -800,8 +872,9 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
800
872
  else {
801
873
  this.coOnly = undefined;
802
874
  }
803
- this.airQuality = new MatterbridgeEndpoint([airQualitySensor, bridgedNode], { uniqueStorageKey: 'Air quality sensor' }, this.config.debug)
875
+ this.airQuality = new MatterbridgeEndpoint([airQualitySensor, bridgedNode, powerSource], { uniqueStorageKey: 'Air quality sensor' }, this.config.debug)
804
876
  .createDefaultBridgedDeviceBasicInformationClusterServer('Air quality sensor', 'serial_987484318322', 0xfff1, 'Matterbridge', 'Matterbridge Air Quality Sensor', parseInt(this.version.replace(/\D/g, '')), this.version === '' ? 'Unknown' : this.version, parseInt(this.matterbridge.matterbridgeVersion.replace(/\D/g, '')), this.matterbridge.matterbridgeVersion)
877
+ .createDefaultPowerSourceReplaceableBatteryClusterServer(50, PowerSource.BatChargeLevel.Warning, 2900, 'CR2450', 1)
805
878
  .addRequiredClusterServers()
806
879
  .addClusterServers([TemperatureMeasurement.Cluster.id, RelativeHumidityMeasurement.Cluster.id]);
807
880
  if (this.config.enableConcentrationMeasurements === true) {
@@ -850,25 +923,83 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
850
923
  else {
851
924
  this.latchingSwitch = undefined;
852
925
  }
926
+ const robot = new Robot('Robot Vacuum', '1238777820');
927
+ this.setSelectDevice(robot.serialNumber ?? '', robot.deviceName ?? '', undefined, 'hub');
928
+ if (this.validateDevice(robot.deviceName ?? '')) {
929
+ await this.registerDevice(robot);
930
+ this.bridgedDevices.set(robot.deviceName ?? '', robot);
931
+ }
932
+ const laundryWasherDevice = new Appliances(laundryWasher, 'Laundry Washer', '1234567890');
933
+ this.setSelectDevice(laundryWasherDevice.serialNumber ?? '', laundryWasherDevice.deviceName ?? '', undefined, 'hub');
934
+ if (this.validateDevice(laundryWasherDevice.deviceName ?? '')) {
935
+ await this.registerDevice(laundryWasherDevice);
936
+ this.bridgedDevices.set(laundryWasherDevice.deviceName ?? '', laundryWasherDevice);
937
+ }
938
+ const laundryDryerDevice = new Appliances(laundryDryer, 'Laundry Dryer', '1235227890');
939
+ this.setSelectDevice(laundryDryerDevice.serialNumber ?? '', laundryDryerDevice.deviceName ?? '', undefined, 'hub');
940
+ if (this.validateDevice(laundryDryerDevice.deviceName ?? '')) {
941
+ await this.registerDevice(laundryDryerDevice);
942
+ this.bridgedDevices.set(laundryDryerDevice.deviceName ?? '', laundryDryerDevice);
943
+ }
944
+ const dishwasherDevice = new Appliances(dishwasher, 'Dishwasher', '0987654321');
945
+ this.setSelectDevice(dishwasherDevice.serialNumber ?? '', dishwasherDevice.deviceName ?? '', undefined, 'hub');
946
+ if (this.validateDevice(dishwasherDevice.deviceName ?? '')) {
947
+ await this.registerDevice(dishwasherDevice);
948
+ this.bridgedDevices.set(dishwasherDevice.deviceName ?? '', dishwasherDevice);
949
+ }
950
+ const refrigeratorDevice = new Appliances(refrigerator, 'Refrigerator', '9987654322');
951
+ refrigeratorDevice.addFixedLabel('composed', 'Refrigerator');
952
+ this.setSelectDevice(refrigeratorDevice.serialNumber ?? '', refrigeratorDevice.deviceName ?? '', undefined, 'hub');
953
+ if (this.validateDevice(refrigeratorDevice.deviceName ?? '')) {
954
+ await this.registerDevice(refrigeratorDevice);
955
+ this.bridgedDevices.set(refrigeratorDevice.deviceName ?? '', refrigeratorDevice);
956
+ }
957
+ const ovenDevice = new Appliances(oven, 'Oven', '1298867891');
958
+ ovenDevice.addFixedLabel('composed', 'Oven');
959
+ this.setSelectDevice(ovenDevice.serialNumber ?? '', ovenDevice.deviceName ?? '', undefined, 'hub');
960
+ if (this.validateDevice(ovenDevice.deviceName ?? '')) {
961
+ await this.registerDevice(ovenDevice);
962
+ this.bridgedDevices.set(ovenDevice.deviceName ?? '', ovenDevice);
963
+ }
964
+ const microwaveOvenDevice = new Appliances(microwaveOven, 'Microwave Oven', '1234567892');
965
+ this.setSelectDevice(microwaveOvenDevice.serialNumber ?? '', microwaveOvenDevice.deviceName ?? '', undefined, 'hub');
966
+ if (this.validateDevice(microwaveOvenDevice.deviceName ?? '')) {
967
+ await this.registerDevice(microwaveOvenDevice);
968
+ this.bridgedDevices.set(microwaveOvenDevice.deviceName ?? '', microwaveOvenDevice);
969
+ }
970
+ const extractorHoodDevice = new Appliances(extractorHood, 'Extractor Hood', '1234567893');
971
+ this.setSelectDevice(extractorHoodDevice.serialNumber ?? '', extractorHoodDevice.deviceName ?? '', undefined, 'hub');
972
+ if (this.validateDevice(extractorHoodDevice.deviceName ?? '')) {
973
+ await this.registerDevice(extractorHoodDevice);
974
+ this.bridgedDevices.set(extractorHoodDevice.deviceName ?? '', extractorHoodDevice);
975
+ }
976
+ const cooktopDevice = new Appliances(cooktop, 'Cooktop', '1255887894');
977
+ this.setSelectDevice(cooktopDevice.serialNumber ?? '', cooktopDevice.deviceName ?? '', undefined, 'hub');
978
+ if (this.validateDevice(cooktopDevice.deviceName ?? '')) {
979
+ await this.registerDevice(cooktopDevice);
980
+ this.bridgedDevices.set(cooktopDevice.deviceName ?? '', cooktopDevice);
981
+ }
853
982
  }
854
983
  async onConfigure() {
855
984
  await super.onConfigure();
856
985
  this.log.info('onConfigure called');
857
- await this.switch?.setAttribute(OnOff.Cluster.id, 'onOff', false, this.switch.log);
858
- this.switch?.log.info('Set switch initial onOff to false');
986
+ await this.switch?.setAttribute(OnOff.Cluster.id, 'onOff', this.intervalOnOff, this.switch.log);
987
+ await this.mountedOnOffSwitch?.setAttribute(OnOff.Cluster.id, 'onOff', this.intervalOnOff, this.mountedOnOffSwitch.log);
988
+ this.switch?.log.info(`Set switch initial onOff to ${this.intervalOnOff}`);
859
989
  if (this.config.useInterval) {
860
990
  this.switchInterval = setInterval(async () => {
861
- const status = this.switch?.getAttribute(OnOff.Cluster.id, 'onOff', this.switch.log);
862
- if (isValidBoolean(status)) {
863
- await this.switch?.setAttribute(OnOff.Cluster.id, 'onOff', !status, this.switch.log);
864
- this.switch?.log.info(`Set switch onOff to ${!status}`);
865
- }
991
+ await this.switch?.setAttribute(OnOff.Cluster.id, 'onOff', this.intervalOnOff, this.switch.log);
992
+ await this.mountedOnOffSwitch?.setAttribute(OnOff.Cluster.id, 'onOff', this.intervalOnOff, this.mountedOnOffSwitch.log);
993
+ this.log.info(`Set switches onOff to ${this.intervalOnOff}`);
994
+ this.intervalOnOff = !this.intervalOnOff;
866
995
  }, 60 * 1000 + 100);
867
996
  }
868
997
  await this.lightOnOff?.setAttribute(OnOff.Cluster.id, 'onOff', false, this.lightOnOff.log);
869
998
  this.lightOnOff?.log.info('Set light initial onOff to false.');
870
999
  await this.dimmer?.setAttribute(OnOff.Cluster.id, 'onOff', false, this.dimmer.log);
871
1000
  await this.dimmer?.setAttribute(LevelControl.Cluster.id, 'currentLevel', 1, this.dimmer.log);
1001
+ await this.mountedDimmerSwitch?.setAttribute(OnOff.Cluster.id, 'onOff', false, this.mountedDimmerSwitch.log);
1002
+ await this.mountedDimmerSwitch?.setAttribute(LevelControl.Cluster.id, 'currentLevel', 1, this.mountedDimmerSwitch.log);
872
1003
  this.dimmer?.log.info(`Set dimmer initial onOff to false, currentLevel to 1.`);
873
1004
  await this.light?.setAttribute(OnOff.Cluster.id, 'onOff', false, this.light.log);
874
1005
  await this.light?.setAttribute(LevelControl.Cluster.id, 'currentLevel', 200, this.light.log);
@@ -895,42 +1026,48 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
895
1026
  this.lightCT?.log.info('Set light CT initial onOff to true, currentLevel to 128, colorTemperatureMireds to 250.');
896
1027
  if (this.config.useInterval) {
897
1028
  this.lightInterval = setInterval(async () => {
898
- const state = this.light?.getAttribute(OnOff.Cluster.id, 'onOff', this.light.log);
899
- let level = this.light?.getAttribute(LevelControl.Cluster.id, 'currentLevel', this.light.log);
900
- if (isValidBoolean(state) && isValidNumber(level, 0, 254)) {
901
- level += 10;
902
- if (level >= 250) {
903
- level = 1;
904
- await this.lightOnOff?.setAttribute(OnOff.Cluster.id, 'onOff', false, this.lightOnOff.log);
905
- await this.dimmer?.setAttribute(OnOff.Cluster.id, 'onOff', false, this.dimmer.log);
906
- await this.light?.setAttribute(OnOff.Cluster.id, 'onOff', false, this.light.log);
907
- await this.lightXY?.setAttribute(OnOff.Cluster.id, 'onOff', false, this.lightXY.log);
908
- await this.lightHS?.setAttribute(OnOff.Cluster.id, 'onOff', false, this.lightHS.log);
909
- await this.lightCT?.setAttribute(OnOff.Cluster.id, 'onOff', false, this.lightCT.log);
910
- this.log.info('Set lights onOff to false');
911
- await this.dimmer?.setAttribute(LevelControl.Cluster.id, 'currentLevel', level, this.dimmer.log);
912
- await this.light?.setAttribute(LevelControl.Cluster.id, 'currentLevel', level, this.light.log);
913
- await this.lightXY?.setAttribute(LevelControl.Cluster.id, 'currentLevel', level, this.lightXY.log);
914
- await this.lightHS?.setAttribute(LevelControl.Cluster.id, 'currentLevel', level, this.lightHS.log);
915
- await this.lightCT?.setAttribute(LevelControl.Cluster.id, 'currentLevel', level, this.lightCT.log);
916
- this.log.info(`Set lights currentLevel to ${level}`);
917
- }
918
- else {
919
- await this.lightOnOff?.setAttribute(OnOff.Cluster.id, 'onOff', true, this.lightOnOff?.log);
920
- await this.dimmer?.setAttribute(OnOff.Cluster.id, 'onOff', true, this.dimmer.log);
921
- await this.light?.setAttribute(OnOff.Cluster.id, 'onOff', true, this.light.log);
922
- await this.lightXY?.setAttribute(OnOff.Cluster.id, 'onOff', true, this.lightXY.log);
923
- await this.lightHS?.setAttribute(OnOff.Cluster.id, 'onOff', true, this.lightHS.log);
924
- await this.lightCT?.setAttribute(OnOff.Cluster.id, 'onOff', true, this.lightCT.log);
925
- this.log.info('Set lights onOff to true');
926
- await this.dimmer?.setAttribute(LevelControl.Cluster.id, 'currentLevel', level, this.dimmer.log);
927
- await this.light?.setAttribute(LevelControl.Cluster.id, 'currentLevel', level, this.light.log);
928
- await this.lightXY?.setAttribute(LevelControl.Cluster.id, 'currentLevel', level, this.lightXY.log);
929
- await this.lightHS?.setAttribute(LevelControl.Cluster.id, 'currentLevel', level, this.lightHS.log);
930
- await this.lightCT?.setAttribute(LevelControl.Cluster.id, 'currentLevel', level, this.lightCT.log);
931
- this.log.info(`Set lights currentLevel to ${level}`);
932
- }
1029
+ this.intervalLevel += 10;
1030
+ if (this.intervalLevel >= 250) {
1031
+ this.intervalLevel = 0;
1032
+ await this.lightOnOff?.setAttribute(OnOff.Cluster.id, 'onOff', false, this.lightOnOff.log);
1033
+ await this.dimmer?.setAttribute(OnOff.Cluster.id, 'onOff', false, this.dimmer.log);
1034
+ await this.mountedDimmerSwitch?.setAttribute(OnOff.Cluster.id, 'onOff', false, this.mountedDimmerSwitch.log);
1035
+ await this.light?.setAttribute(OnOff.Cluster.id, 'onOff', false, this.light.log);
1036
+ await this.lightXY?.setAttribute(OnOff.Cluster.id, 'onOff', false, this.lightXY.log);
1037
+ await this.lightHS?.setAttribute(OnOff.Cluster.id, 'onOff', false, this.lightHS.log);
1038
+ await this.lightCT?.setAttribute(OnOff.Cluster.id, 'onOff', false, this.lightCT.log);
1039
+ this.log.info('Set lights onOff to false');
1040
+ }
1041
+ else {
1042
+ await this.lightOnOff?.setAttribute(OnOff.Cluster.id, 'onOff', true, this.lightOnOff?.log);
1043
+ await this.dimmer?.setAttribute(OnOff.Cluster.id, 'onOff', true, this.dimmer.log);
1044
+ await this.mountedDimmerSwitch?.setAttribute(OnOff.Cluster.id, 'onOff', true, this.mountedDimmerSwitch.log);
1045
+ await this.light?.setAttribute(OnOff.Cluster.id, 'onOff', true, this.light.log);
1046
+ await this.lightXY?.setAttribute(OnOff.Cluster.id, 'onOff', true, this.lightXY.log);
1047
+ await this.lightHS?.setAttribute(OnOff.Cluster.id, 'onOff', true, this.lightHS.log);
1048
+ await this.lightCT?.setAttribute(OnOff.Cluster.id, 'onOff', true, this.lightCT.log);
1049
+ this.log.info('Set lights onOff to true');
1050
+ await this.dimmer?.setAttribute(LevelControl.Cluster.id, 'currentLevel', this.intervalLevel, this.dimmer.log);
1051
+ await this.mountedDimmerSwitch?.setAttribute(LevelControl.Cluster.id, 'currentLevel', this.intervalLevel, this.mountedDimmerSwitch.log);
1052
+ await this.light?.setAttribute(LevelControl.Cluster.id, 'currentLevel', this.intervalLevel, this.light.log);
1053
+ await this.lightXY?.setAttribute(LevelControl.Cluster.id, 'currentLevel', this.intervalLevel, this.lightXY.log);
1054
+ await this.lightHS?.setAttribute(LevelControl.Cluster.id, 'currentLevel', this.intervalLevel, this.lightHS.log);
1055
+ await this.lightCT?.setAttribute(LevelControl.Cluster.id, 'currentLevel', this.intervalLevel, this.lightCT.log);
1056
+ this.log.info(`Set lights currentLevel to ${this.intervalLevel}`);
1057
+ }
1058
+ this.intervalColorTemperature += 50;
1059
+ if (this.intervalColorTemperature > 500) {
1060
+ this.intervalColorTemperature = 147;
933
1061
  }
1062
+ await this.light?.setAttribute(ColorControl.Cluster.id, 'colorTemperatureMireds', this.intervalColorTemperature, this.light.log);
1063
+ await this.lightHS?.setAttribute(ColorControl.Cluster.id, 'colorTemperatureMireds', this.intervalColorTemperature, this.lightHS.log);
1064
+ await this.lightXY?.setAttribute(ColorControl.Cluster.id, 'colorTemperatureMireds', this.intervalColorTemperature, this.lightXY.log);
1065
+ await this.lightCT?.setAttribute(ColorControl.Cluster.id, 'colorTemperatureMireds', this.intervalColorTemperature, this.lightCT.log);
1066
+ await this.light?.configureColorControlMode(ColorControl.ColorMode.ColorTemperatureMireds);
1067
+ await this.lightHS?.configureColorControlMode(ColorControl.ColorMode.ColorTemperatureMireds);
1068
+ await this.lightXY?.configureColorControlMode(ColorControl.ColorMode.ColorTemperatureMireds);
1069
+ await this.lightCT?.configureColorControlMode(ColorControl.ColorMode.ColorTemperatureMireds);
1070
+ this.log.info(`Set lights colorTemperatureMireds to ${this.intervalColorTemperature}`);
934
1071
  }, 60 * 1000 + 200);
935
1072
  }
936
1073
  await this.outlet?.setAttribute(OnOff.Cluster.id, 'onOff', false, this.outlet.log);
@@ -1110,6 +1247,24 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
1110
1247
  }
1111
1248
  }, 60 * 1000 + 1100);
1112
1249
  }
1250
+ const airConditionerDevice = this.bridgedDevices.get('Air Conditioner');
1251
+ await airConditionerDevice?.setAttribute(OnOff.Cluster.id, 'onOff', true, airConditionerDevice.log);
1252
+ const laundryWasherDevice = this.bridgedDevices.get('Laundry Washer');
1253
+ await laundryWasherDevice?.setAttribute(OnOff.Cluster.id, 'onOff', true, laundryWasherDevice.log);
1254
+ const laundryDryerDevice = this.bridgedDevices.get('Laundry Dryer');
1255
+ await laundryDryerDevice?.setAttribute(OnOff.Cluster.id, 'onOff', true, laundryDryerDevice.log);
1256
+ const dishwasherDevice = this.bridgedDevices.get('Dishwasher');
1257
+ await dishwasherDevice?.setAttribute(OnOff.Cluster.id, 'onOff', true, dishwasherDevice.log);
1258
+ this.log.info(`Set appliances dead front OnOff to on`);
1259
+ const cooktopDevice = this.bridgedDevices.get('Cooktop');
1260
+ await cooktopDevice?.setAttribute(OnOff.Cluster.id, 'onOff', true, cooktopDevice.log);
1261
+ cooktopDevice?.log.info(`Set Cooktop onOff only OnOff to on`);
1262
+ const surface1 = cooktopDevice?.getChildEndpointByName('Surface1');
1263
+ await surface1?.setAttribute(OnOff.Cluster.id, 'onOff', true, surface1.log);
1264
+ surface1?.log.info(`Set Surface 1 onOff only OnOff to on`);
1265
+ const surface2 = cooktopDevice?.getChildEndpointByName('Surface2');
1266
+ await surface2?.setAttribute(OnOff.Cluster.id, 'onOff', true, surface2.log);
1267
+ surface2?.log.info(`Set Surface 2 onOff only OnOff to on`);
1113
1268
  if (this.config.useInterval) {
1114
1269
  this.genericSwitchInterval = setInterval(async () => {
1115
1270
  if (this.genericSwitchLastEvent === 'Release') {
@@ -1153,6 +1308,6 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
1153
1308
  await super.onShutdown(reason);
1154
1309
  this.log.info('onShutdown called with reason:', reason ?? 'none');
1155
1310
  if (this.config.unregisterOnShutdown === true)
1156
- await this.unregisterAllDevices();
1311
+ await this.unregisterAllDevices(500);
1157
1312
  }
1158
1313
  }