matterbridge-example-dynamic-platform 1.3.1-dev-20250630-905428f → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -1
- package/README.md +3 -2
- package/dist/platform.js +16 -9
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -23,16 +23,18 @@ 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-
|
26
|
+
## [1.3.1] - 2025-07-04
|
27
27
|
|
28
28
|
### Added
|
29
29
|
|
30
30
|
- [platform]: Added solarPower device type (not supported by the Home app).
|
31
31
|
- [platform]: Added batteryStoraga device type (not supported by the Home app).
|
32
|
+
- [platform]: Added heatPump device type (not supported by the Home app).
|
32
33
|
|
33
34
|
### Changed
|
34
35
|
|
35
36
|
- [platform]: Changed imports from matterbridge/devices.
|
37
|
+
- [package]: Require matterbridge 3.1.1.
|
36
38
|
|
37
39
|
<a href="https://www.buymeacoffee.com/luligugithub">
|
38
40
|
<img src="bmc-button.svg" alt="Buy me a coffee" width="80">
|
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
|
20
|
+
It exposes 44 virtual devices:
|
21
21
|
|
22
22
|
- a switch with onOff cluster
|
23
23
|
- a light with onOff
|
@@ -62,7 +62,8 @@ It exposes 43 virtual devices:
|
|
62
62
|
- a water heater device (supported by SmartThings and Home Assistant)
|
63
63
|
- a car charger device (supported by Home Assistant)
|
64
64
|
- a solar power device
|
65
|
-
- a
|
65
|
+
- a battery storage device
|
66
|
+
- a heat pump device
|
66
67
|
|
67
68
|
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.
|
68
69
|
|
package/dist/platform.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
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
|
+
import { RoboticVacuumCleaner, LaundryWasher, WaterHeater, Evse, SolarPower, BatteryStorage, LaundryDryer, HeatPump } from 'matterbridge/devices';
|
3
3
|
import { isValidBoolean, isValidNumber } from 'matterbridge/utils';
|
4
4
|
import { LocationTag, NumberTag, PositionTag } from 'matterbridge/matter';
|
5
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';
|
@@ -42,6 +42,7 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
42
42
|
laundryDryer;
|
43
43
|
solarPower;
|
44
44
|
batteryStorage;
|
45
|
+
heatPump;
|
45
46
|
switchInterval;
|
46
47
|
lightInterval;
|
47
48
|
outletInterval;
|
@@ -64,8 +65,8 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
64
65
|
fanModeLookup = ['Off', 'Low', 'Medium', 'High', 'On', 'Auto', 'Smart'];
|
65
66
|
constructor(matterbridge, log, config) {
|
66
67
|
super(matterbridge, log, config);
|
67
|
-
if (this.verifyMatterbridgeVersion === undefined || typeof this.verifyMatterbridgeVersion !== 'function' || !this.verifyMatterbridgeVersion('3.
|
68
|
-
throw new Error(`This plugin requires Matterbridge version >= "3.
|
68
|
+
if (this.verifyMatterbridgeVersion === undefined || typeof this.verifyMatterbridgeVersion !== 'function' || !this.verifyMatterbridgeVersion('3.1.1')) {
|
69
|
+
throw new Error(`This plugin requires Matterbridge version >= "3.1.1". Please update Matterbridge from ${this.matterbridge.matterbridgeVersion} to the latest version in the frontend.`);
|
69
70
|
}
|
70
71
|
this.log.info('Initializing platform:', this.config.name);
|
71
72
|
if (config.whiteList === undefined)
|
@@ -997,42 +998,48 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
997
998
|
this.latchingSwitch = undefined;
|
998
999
|
}
|
999
1000
|
if (this.config.enableRVC === true) {
|
1000
|
-
const robot = new RoboticVacuumCleaner('Robot Vacuum', '
|
1001
|
+
const robot = new RoboticVacuumCleaner('Robot Vacuum', 'RVC1238777820');
|
1001
1002
|
this.setSelectDevice(robot.serialNumber ?? '', robot.deviceName ?? '', undefined, 'hub');
|
1002
1003
|
if (this.validateDevice(robot.deviceName ?? '')) {
|
1003
1004
|
await this.registerDevice(robot);
|
1004
1005
|
this.bridgedDevices.set(robot.deviceName ?? '', robot);
|
1005
1006
|
}
|
1006
1007
|
}
|
1007
|
-
this.waterHeater = new WaterHeater('Water Heater', '
|
1008
|
+
this.waterHeater = new WaterHeater('Water Heater', 'WH3456177820', 50, 60, 20, 80, undefined, 85, 220_000, 1_000, 220_000, 12_000_000, 500_000, 3_000_000);
|
1008
1009
|
this.setSelectDevice(this.waterHeater.serialNumber ?? '', this.waterHeater.deviceName ?? '', undefined, 'hub');
|
1009
1010
|
if (this.validateDevice(this.waterHeater.deviceName ?? '')) {
|
1010
1011
|
await this.registerDevice(this.waterHeater);
|
1011
1012
|
this.bridgedDevices.set(this.waterHeater.deviceName ?? '', this.waterHeater);
|
1012
1013
|
}
|
1013
|
-
this.evse = new Evse('Evse', '
|
1014
|
+
this.evse = new Evse('Evse', 'EV3456127820', 1, [
|
1014
1015
|
{ label: 'On demand', mode: 1, modeTags: [{ value: EnergyEvseMode.ModeTag.Manual }] },
|
1015
1016
|
{ label: 'Scheduled', mode: 2, modeTags: [{ value: EnergyEvseMode.ModeTag.TimeOfUse }] },
|
1016
1017
|
{ label: 'Solar Charging', mode: 3, modeTags: [{ value: EnergyEvseMode.ModeTag.SolarCharging }] },
|
1017
1018
|
{ label: 'Solar Charging Scheduled', mode: 4, modeTags: [{ value: EnergyEvseMode.ModeTag.SolarCharging }, { value: EnergyEvseMode.ModeTag.TimeOfUse }] },
|
1018
|
-
], EnergyEvse.State.
|
1019
|
+
], EnergyEvse.State.PluggedInCharging, EnergyEvse.SupplyState.ChargingEnabled, EnergyEvse.FaultState.NoError, 220_000, 10_000, 2_200_000, 1_000_000, 500_000, 32_000_000);
|
1019
1020
|
this.setSelectDevice(this.evse.serialNumber ?? '', this.evse.deviceName ?? '', undefined, 'hub');
|
1020
1021
|
if (this.validateDevice(this.evse.deviceName ?? '')) {
|
1021
1022
|
await this.registerDevice(this.evse);
|
1022
1023
|
this.bridgedDevices.set(this.evse.deviceName ?? '', this.evse);
|
1023
1024
|
}
|
1024
|
-
this.solarPower = new SolarPower('Solar Power', 'SP3456127821', 220_000, 10_000, 2200_000, 2_200_000,
|
1025
|
+
this.solarPower = new SolarPower('Solar Power', 'SP3456127821', 220_000, 10_000, 2200_000, 2_200_000, -10_000_000, 500_000);
|
1025
1026
|
this.setSelectDevice(this.solarPower.serialNumber ?? '', this.solarPower.deviceName ?? '', undefined, 'hub');
|
1026
1027
|
if (this.validateDevice(this.solarPower.deviceName ?? '')) {
|
1027
1028
|
await this.registerDevice(this.solarPower);
|
1028
1029
|
this.bridgedDevices.set(this.solarPower.deviceName ?? '', this.solarPower);
|
1029
1030
|
}
|
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,
|
1031
|
+
this.batteryStorage = new BatteryStorage('Battery Storage', 'BS3456127822', 75, PowerSource.BatChargeLevel.Ok, 220_000, 10_000, 2_200_000, 1_000_000, 2_000_000, -2_000_000, 3_000_000);
|
1031
1032
|
this.setSelectDevice(this.batteryStorage.serialNumber ?? '', this.batteryStorage.deviceName ?? '', undefined, 'hub');
|
1032
1033
|
if (this.validateDevice(this.batteryStorage.deviceName ?? '')) {
|
1033
1034
|
await this.registerDevice(this.batteryStorage);
|
1034
1035
|
this.bridgedDevices.set(this.batteryStorage.deviceName ?? '', this.batteryStorage);
|
1035
1036
|
}
|
1037
|
+
this.heatPump = new HeatPump('Heat Pump', 'HP1234567890', 220_000, 10_000, 2_200_000, 1_000_000, 500_000, 3_000_000);
|
1038
|
+
this.setSelectDevice(this.heatPump.serialNumber ?? '', this.heatPump.deviceName ?? '', undefined, 'hub');
|
1039
|
+
if (this.validateDevice(this.heatPump.deviceName ?? '')) {
|
1040
|
+
await this.registerDevice(this.heatPump);
|
1041
|
+
this.bridgedDevices.set(this.heatPump.deviceName ?? '', this.heatPump);
|
1042
|
+
}
|
1036
1043
|
this.laundryWasher = new LaundryWasher('Laundry Washer', 'LW1234567890');
|
1037
1044
|
this.setSelectDevice(this.laundryWasher.serialNumber ?? '', this.laundryWasher.deviceName ?? '', undefined, 'hub');
|
1038
1045
|
if (this.validateDevice(this.laundryWasher.deviceName ?? '')) {
|
package/npm-shrinkwrap.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "matterbridge-example-dynamic-platform",
|
3
|
-
"version": "1.3.1
|
3
|
+
"version": "1.3.1",
|
4
4
|
"lockfileVersion": 3,
|
5
5
|
"requires": true,
|
6
6
|
"packages": {
|
7
7
|
"": {
|
8
8
|
"name": "matterbridge-example-dynamic-platform",
|
9
|
-
"version": "1.3.1
|
9
|
+
"version": "1.3.1",
|
10
10
|
"license": "Apache-2.0",
|
11
11
|
"dependencies": {
|
12
12
|
"node-ansi-logger": "3.1.1",
|