matterbridge-example-dynamic-platform 1.3.0-dev-20250626-3d1ce79 → 1.3.1-dev-20250630-905428f

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -23,6 +23,21 @@ If you like this project and find it useful, please consider giving it a star on
23
23
  <img src="bmc-button.svg" alt="Buy me a coffee" width="120">
24
24
  </a>
25
25
 
26
+ ## [1.3.1] - 2025-06-??
27
+
28
+ ### Added
29
+
30
+ - [platform]: Added solarPower device type (not supported by the Home app).
31
+ - [platform]: Added batteryStoraga device type (not supported by the Home app).
32
+
33
+ ### Changed
34
+
35
+ - [platform]: Changed imports from matterbridge/devices.
36
+
37
+ <a href="https://www.buymeacoffee.com/luligugithub">
38
+ <img src="bmc-button.svg" alt="Buy me a coffee" width="80">
39
+ </a>
40
+
26
41
  ## [1.3.0] - 2025-06-25
27
42
 
28
43
  ### Added
package/README.md CHANGED
@@ -17,7 +17,7 @@
17
17
 
18
18
  Matterbridge dynamic platform example plugin is a template to develop your own plugin using the dynamic platform.
19
19
 
20
- It exposes 41 virtual devices:
20
+ It exposes 43 virtual devices:
21
21
 
22
22
  - a switch with onOff cluster
23
23
  - a light with onOff
@@ -61,6 +61,8 @@ It exposes 41 virtual devices:
61
61
  - a cooktop device (supported by SmartThings, Alexa and Home Assistant)
62
62
  - a water heater device (supported by SmartThings and Home Assistant)
63
63
  - a car charger device (supported by Home Assistant)
64
+ - a solar power device
65
+ - a batter storage device
64
66
 
65
67
  All these devices continuously change state and position. The plugin also shows how to use all the command handlers (you can control all the devices), how to subscribe to attributes and how to trigger events.
66
68
 
package/dist/platform.js CHANGED
@@ -1,4 +1,5 @@
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, RoboticVacuumCleaner, WaterHeater, Evse, } 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, cooktop, extractorHood, microwaveOven, oven, refrigerator, dishwasher, onOffMountedSwitch, dimmableMountedSwitch, extendedColorLight, } from 'matterbridge';
2
+ import { RoboticVacuumCleaner, LaundryWasher, WaterHeater, Evse, SolarPower, BatteryStorage, LaundryDryer } from 'matterbridge/devices';
2
3
  import { isValidBoolean, isValidNumber } from 'matterbridge/utils';
3
4
  import { LocationTag, NumberTag, PositionTag } from 'matterbridge/matter';
4
5
  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, EnergyEvseMode, EnergyEvse, } from 'matterbridge/matter/clusters';
@@ -37,6 +38,10 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
37
38
  vacuum;
38
39
  waterHeater;
39
40
  evse;
41
+ laundryWasher;
42
+ laundryDryer;
43
+ solarPower;
44
+ batteryStorage;
40
45
  switchInterval;
41
46
  lightInterval;
42
47
  outletInterval;
@@ -1016,51 +1021,63 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
1016
1021
  await this.registerDevice(this.evse);
1017
1022
  this.bridgedDevices.set(this.evse.deviceName ?? '', this.evse);
1018
1023
  }
1019
- const laundryWasherDevice = new Appliances(laundryWasher, 'Laundry Washer', '1234567890');
1020
- this.setSelectDevice(laundryWasherDevice.serialNumber ?? '', laundryWasherDevice.deviceName ?? '', undefined, 'hub');
1021
- if (this.validateDevice(laundryWasherDevice.deviceName ?? '')) {
1022
- await this.registerDevice(laundryWasherDevice);
1023
- this.bridgedDevices.set(laundryWasherDevice.deviceName ?? '', laundryWasherDevice);
1024
- }
1025
- const laundryDryerDevice = new Appliances(laundryDryer, 'Laundry Dryer', '1235227890');
1026
- this.setSelectDevice(laundryDryerDevice.serialNumber ?? '', laundryDryerDevice.deviceName ?? '', undefined, 'hub');
1027
- if (this.validateDevice(laundryDryerDevice.deviceName ?? '')) {
1028
- await this.registerDevice(laundryDryerDevice);
1029
- this.bridgedDevices.set(laundryDryerDevice.deviceName ?? '', laundryDryerDevice);
1030
- }
1031
- const dishwasherDevice = new Appliances(dishwasher, 'Dishwasher', '0987654321');
1024
+ this.solarPower = new SolarPower('Solar Power', 'SP3456127821', 220_000, 10_000, 2200_000, 2_200_000, 1_000_000, 20_000_000);
1025
+ this.setSelectDevice(this.solarPower.serialNumber ?? '', this.solarPower.deviceName ?? '', undefined, 'hub');
1026
+ if (this.validateDevice(this.solarPower.deviceName ?? '')) {
1027
+ await this.registerDevice(this.solarPower);
1028
+ this.bridgedDevices.set(this.solarPower.deviceName ?? '', this.solarPower);
1029
+ }
1030
+ this.batteryStorage = new BatteryStorage('Battery Storage', 'BS3456127822', 75, PowerSource.BatChargeLevel.Ok, 220_000, 10_000, 2_200_000, 1_000_000, 2_000_000, 1_000_000, 10_000_000);
1031
+ this.setSelectDevice(this.batteryStorage.serialNumber ?? '', this.batteryStorage.deviceName ?? '', undefined, 'hub');
1032
+ if (this.validateDevice(this.batteryStorage.deviceName ?? '')) {
1033
+ await this.registerDevice(this.batteryStorage);
1034
+ this.bridgedDevices.set(this.batteryStorage.deviceName ?? '', this.batteryStorage);
1035
+ }
1036
+ this.laundryWasher = new LaundryWasher('Laundry Washer', 'LW1234567890');
1037
+ this.setSelectDevice(this.laundryWasher.serialNumber ?? '', this.laundryWasher.deviceName ?? '', undefined, 'hub');
1038
+ if (this.validateDevice(this.laundryWasher.deviceName ?? '')) {
1039
+ await this.registerDevice(this.laundryWasher);
1040
+ this.bridgedDevices.set(this.laundryWasher.deviceName ?? '', this.laundryWasher);
1041
+ }
1042
+ this.laundryDryer = new LaundryDryer('Laundry Dryer', 'LDW1235227890');
1043
+ this.setSelectDevice(this.laundryDryer.serialNumber ?? '', this.laundryDryer.deviceName ?? '', undefined, 'hub');
1044
+ if (this.validateDevice(this.laundryDryer.deviceName ?? '')) {
1045
+ await this.registerDevice(this.laundryDryer);
1046
+ this.bridgedDevices.set(this.laundryDryer.deviceName ?? '', this.laundryDryer);
1047
+ }
1048
+ const dishwasherDevice = new Appliances(dishwasher, 'Dishwasher', 'DW0987654321');
1032
1049
  this.setSelectDevice(dishwasherDevice.serialNumber ?? '', dishwasherDevice.deviceName ?? '', undefined, 'hub');
1033
1050
  if (this.validateDevice(dishwasherDevice.deviceName ?? '')) {
1034
1051
  await this.registerDevice(dishwasherDevice);
1035
1052
  this.bridgedDevices.set(dishwasherDevice.deviceName ?? '', dishwasherDevice);
1036
1053
  }
1037
- const refrigeratorDevice = new Appliances(refrigerator, 'Refrigerator', '9987654322');
1054
+ const refrigeratorDevice = new Appliances(refrigerator, 'Refrigerator', 'RE9987654322');
1038
1055
  refrigeratorDevice.addFixedLabel('composed', 'Refrigerator');
1039
1056
  this.setSelectDevice(refrigeratorDevice.serialNumber ?? '', refrigeratorDevice.deviceName ?? '', undefined, 'hub');
1040
1057
  if (this.validateDevice(refrigeratorDevice.deviceName ?? '')) {
1041
1058
  await this.registerDevice(refrigeratorDevice);
1042
1059
  this.bridgedDevices.set(refrigeratorDevice.deviceName ?? '', refrigeratorDevice);
1043
1060
  }
1044
- const ovenDevice = new Appliances(oven, 'Oven', '1298867891');
1061
+ const ovenDevice = new Appliances(oven, 'Oven', 'OV1298867891');
1045
1062
  ovenDevice.addFixedLabel('composed', 'Oven');
1046
1063
  this.setSelectDevice(ovenDevice.serialNumber ?? '', ovenDevice.deviceName ?? '', undefined, 'hub');
1047
1064
  if (this.validateDevice(ovenDevice.deviceName ?? '')) {
1048
1065
  await this.registerDevice(ovenDevice);
1049
1066
  this.bridgedDevices.set(ovenDevice.deviceName ?? '', ovenDevice);
1050
1067
  }
1051
- const microwaveOvenDevice = new Appliances(microwaveOven, 'Microwave Oven', '1234567892');
1068
+ const microwaveOvenDevice = new Appliances(microwaveOven, 'Microwave Oven', 'MO1234567892');
1052
1069
  this.setSelectDevice(microwaveOvenDevice.serialNumber ?? '', microwaveOvenDevice.deviceName ?? '', undefined, 'hub');
1053
1070
  if (this.validateDevice(microwaveOvenDevice.deviceName ?? '')) {
1054
1071
  await this.registerDevice(microwaveOvenDevice);
1055
1072
  this.bridgedDevices.set(microwaveOvenDevice.deviceName ?? '', microwaveOvenDevice);
1056
1073
  }
1057
- const extractorHoodDevice = new Appliances(extractorHood, 'Extractor Hood', '1234567893');
1074
+ const extractorHoodDevice = new Appliances(extractorHood, 'Extractor Hood', 'EH1234567893');
1058
1075
  this.setSelectDevice(extractorHoodDevice.serialNumber ?? '', extractorHoodDevice.deviceName ?? '', undefined, 'hub');
1059
1076
  if (this.validateDevice(extractorHoodDevice.deviceName ?? '')) {
1060
1077
  await this.registerDevice(extractorHoodDevice);
1061
1078
  this.bridgedDevices.set(extractorHoodDevice.deviceName ?? '', extractorHoodDevice);
1062
1079
  }
1063
- const cooktopDevice = new Appliances(cooktop, 'Cooktop', '1255887894');
1080
+ const cooktopDevice = new Appliances(cooktop, 'Cooktop', 'CT1255887894');
1064
1081
  this.setSelectDevice(cooktopDevice.serialNumber ?? '', cooktopDevice.deviceName ?? '', undefined, 'hub');
1065
1082
  if (this.validateDevice(cooktopDevice.deviceName ?? '')) {
1066
1083
  await this.registerDevice(cooktopDevice);
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "matterbridge-example-dynamic-platform",
3
- "version": "1.3.0-dev-20250626-3d1ce79",
3
+ "version": "1.3.1-dev-20250630-905428f",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "matterbridge-example-dynamic-platform",
9
- "version": "1.3.0-dev-20250626-3d1ce79",
9
+ "version": "1.3.1-dev-20250630-905428f",
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
12
  "node-ansi-logger": "3.1.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "matterbridge-example-dynamic-platform",
3
- "version": "1.3.0-dev-20250626-3d1ce79",
3
+ "version": "1.3.1-dev-20250630-905428f",
4
4
  "description": "Matterbridge dynamic plugin",
5
5
  "author": "https://github.com/Luligu",
6
6
  "license": "Apache-2.0",