matterbridge-example-dynamic-platform 3.0.2-dev-20260808-eeaaae3 → 3.0.2-dev-20260809-1aeac01
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 -2
- package/README.md +2 -1
- package/dist/module.js +78 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -38,8 +38,9 @@ If you like this project and find it useful, please consider giving it a star on
|
|
|
38
38
|
- [chip]: Add chip-test toolchain agents instruction and chip-test runner.
|
|
39
39
|
- [chip]: Add `chipTests.json`/`chipTests.md` with the generic device basic composition, conformance and default warnings tests, and document known CHIP test suite gaps.
|
|
40
40
|
- [frontend]: Add plugin-frontend agents instructions.
|
|
41
|
-
- [platform]: Add `closureGarageDoor` device.
|
|
42
|
-
- [platform]: Add `closureVenetianBlind` device with Lift and Tilt panels.
|
|
41
|
+
- [platform]: Add `closureGarageDoor` device. Thanks Ludovic BOUÉ.
|
|
42
|
+
- [platform]: Add `closureVenetianBlind` device with Lift and Tilt panels. Thanks Ludovic BOUÉ.
|
|
43
|
+
- [platform]: Add a thermostat auto mode with schedules (Weekdays and Weekend schedules) including 2 sub endpoints with temperature and humidity sensors, using `createDefaultSchedulesThermostatClusterServer()`. Thanks Ludovic BOUÉ.
|
|
43
44
|
|
|
44
45
|
### Changed
|
|
45
46
|
|
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
Matterbridge dynamic platform example plugin is a template to develop your own plugin using the dynamic platform.
|
|
25
25
|
|
|
26
|
-
It exposes
|
|
26
|
+
It exposes 73 virtual devices:
|
|
27
27
|
|
|
28
28
|
- a door contact sensor
|
|
29
29
|
- a motion sensor
|
|
@@ -53,6 +53,7 @@ It exposes 72 virtual devices:
|
|
|
53
53
|
and relativeHumidityMeasurement cluster (to show how to create a composed device with sub endpoints)
|
|
54
54
|
- a thermostat with auto mode (i.e. with Auto Heat and Cool features), occupancy and outdoorTemperature
|
|
55
55
|
- a thermostat auto mode with presets (Home, Away, Sleep, Wake, Vacation and GoingToSleep modes) including 3 sub endpoints with flow, temperature and humidity sensors
|
|
56
|
+
- a thermostat auto mode with schedules (Weekdays and Weekend schedules) including 2 sub endpoints with temperature and humidity sensors
|
|
56
57
|
- a thermostat heat only with two external temperature sensors (tagged like Indoor and Outdoor)
|
|
57
58
|
- a thermostat cool only
|
|
58
59
|
- a fan with Off High presets
|
package/dist/module.js
CHANGED
|
@@ -61,6 +61,7 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
|
61
61
|
thermoAuto;
|
|
62
62
|
thermoAutoOccupancy;
|
|
63
63
|
thermoAutoPresets;
|
|
64
|
+
thermoAutoSchedules;
|
|
64
65
|
thermoHeat;
|
|
65
66
|
thermoCool;
|
|
66
67
|
fanBase;
|
|
@@ -1077,6 +1078,83 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
|
1077
1078
|
this.thermoAutoPresets?.subscribeAttribute(Thermostat.id, 'presets', (newValue, oldValue) => {
|
|
1078
1079
|
this.thermoAutoPresets?.log.info(`Subscribe presets called with: ${debugStringify(newValue)} (old value: ${debugStringify(oldValue)})`);
|
|
1079
1080
|
}, this.thermoAutoPresets.log);
|
|
1081
|
+
const schedules_List = [
|
|
1082
|
+
{
|
|
1083
|
+
scheduleHandle: new Uint8Array([0]),
|
|
1084
|
+
systemMode: Thermostat.SystemMode.Auto,
|
|
1085
|
+
name: 'Weekdays',
|
|
1086
|
+
transitions: [
|
|
1087
|
+
{ dayOfWeek: { monday: true, tuesday: true, wednesday: true, thursday: true, friday: true }, transitionTime: 360, heatingSetpoint: 2000, coolingSetpoint: 2400 },
|
|
1088
|
+
{ dayOfWeek: { monday: true, tuesday: true, wednesday: true, thursday: true, friday: true }, transitionTime: 750, heatingSetpoint: 1900, coolingSetpoint: 2500 },
|
|
1089
|
+
{ dayOfWeek: { monday: true, tuesday: true, wednesday: true, thursday: true, friday: true }, transitionTime: 810, heatingSetpoint: 2000, coolingSetpoint: 2400 },
|
|
1090
|
+
{ dayOfWeek: { monday: true, tuesday: true, wednesday: true, thursday: true, friday: true }, transitionTime: 1320, heatingSetpoint: 1800, coolingSetpoint: 2600 },
|
|
1091
|
+
],
|
|
1092
|
+
builtIn: true,
|
|
1093
|
+
},
|
|
1094
|
+
{
|
|
1095
|
+
scheduleHandle: new Uint8Array([1]),
|
|
1096
|
+
systemMode: Thermostat.SystemMode.Auto,
|
|
1097
|
+
name: 'Weekend',
|
|
1098
|
+
transitions: [
|
|
1099
|
+
{ dayOfWeek: { saturday: true, sunday: true }, transitionTime: 480, heatingSetpoint: 2100, coolingSetpoint: 2300 },
|
|
1100
|
+
{ dayOfWeek: { saturday: true, sunday: true }, transitionTime: 1380, heatingSetpoint: 1900, coolingSetpoint: 2500 },
|
|
1101
|
+
],
|
|
1102
|
+
builtIn: true,
|
|
1103
|
+
},
|
|
1104
|
+
];
|
|
1105
|
+
const scheduleTypeDefinitions = [
|
|
1106
|
+
{
|
|
1107
|
+
systemMode: Thermostat.SystemMode.Auto,
|
|
1108
|
+
numberOfSchedules: 10,
|
|
1109
|
+
scheduleTypeFeatures: { supportsSetpoints: true, supportsNames: true },
|
|
1110
|
+
},
|
|
1111
|
+
];
|
|
1112
|
+
this.thermoAutoSchedules = new MatterbridgeEndpoint([thermostat, bridgedNode, powerSource], { id: 'Thermostat (AutoModeSchedules)' }, this.config.debug)
|
|
1113
|
+
.createDefaultIdentifyClusterServer()
|
|
1114
|
+
.createDefaultBridgedDeviceBasicInformationClusterServer('Thermostat (AutoModeSchedules)', 'TAS00059', 0xfff1, 'Matterbridge', 'Matterbridge Thermostat With Schedules')
|
|
1115
|
+
.createDefaultSchedulesThermostatClusterServer(20, 18, 22, 1, 0, 35, 15, 50, undefined, undefined, undefined, undefined, null, schedules_List, scheduleTypeDefinitions, 10, null)
|
|
1116
|
+
.createDefaultPowerSourceWiredClusterServer()
|
|
1117
|
+
.addRequiredClusterServers();
|
|
1118
|
+
if (this.thermoAutoSchedules) {
|
|
1119
|
+
this.thermoAutoSchedules
|
|
1120
|
+
.addChildDeviceType('Temperature', temperatureSensor)
|
|
1121
|
+
.createDefaultTemperatureMeasurementClusterServer(21 * 100)
|
|
1122
|
+
.addRequiredClusterServers();
|
|
1123
|
+
this.thermoAutoSchedules
|
|
1124
|
+
.addChildDeviceType('Humidity', humiditySensor)
|
|
1125
|
+
.createDefaultRelativeHumidityMeasurementClusterServer(50 * 100)
|
|
1126
|
+
.addRequiredClusterServers();
|
|
1127
|
+
this.thermoAutoSchedules = await this.addDevice(this.thermoAutoSchedules);
|
|
1128
|
+
}
|
|
1129
|
+
this.thermoAutoSchedules?.addCommandHandler('identify', ({ request: { identifyTime } }) => {
|
|
1130
|
+
this.thermoAutoSchedules?.log.info(`Command identify called identifyTime ${identifyTime}`);
|
|
1131
|
+
});
|
|
1132
|
+
this.thermoAutoSchedules?.addCommandHandler('triggerEffect', ({ request: { effectIdentifier, effectVariant } }) => {
|
|
1133
|
+
this.thermoAutoSchedules?.log.info(`Command identify called effectIdentifier ${effectIdentifier} effectVariant ${effectVariant}`);
|
|
1134
|
+
});
|
|
1135
|
+
this.thermoAutoSchedules?.addCommandHandler('setpointRaiseLower', ({ request: { mode, amount } }) => {
|
|
1136
|
+
const lookupSetpointAdjustMode = ['Heat', 'Cool', 'Both'];
|
|
1137
|
+
this.thermoAutoSchedules?.log.info(`Command setpointRaiseLower called with mode: ${lookupSetpointAdjustMode[mode]} amount: ${amount / 10}`);
|
|
1138
|
+
});
|
|
1139
|
+
this.thermoAutoSchedules?.addCommandHandler('setActiveScheduleRequest', ({ request: { scheduleHandle } }) => {
|
|
1140
|
+
this.thermoAutoSchedules?.log.info(`Command setActiveScheduleRequest called with scheduleHandle: ${scheduleHandle ? `0x${Buffer.from(scheduleHandle).toString('hex')}` : 'null'}`);
|
|
1141
|
+
});
|
|
1142
|
+
this.thermoAutoSchedules?.subscribeAttribute(Thermostat, 'systemMode', (newValue, oldValue) => {
|
|
1143
|
+
const lookupSystemMode = ['Off', 'Auto', '', 'Cool', 'Heat', 'EmergencyHeat', 'Precooling', 'FanOnly', 'Dry', 'Sleep'];
|
|
1144
|
+
this.thermoAutoSchedules?.log.info(`Subscribe systemMode called with: ${lookupSystemMode[newValue]} (old value: ${lookupSystemMode[oldValue]})`);
|
|
1145
|
+
}, this.thermoAutoSchedules.log);
|
|
1146
|
+
this.thermoAutoSchedules?.subscribeAttribute(Thermostat.id, 'occupiedHeatingSetpoint', (newValue, oldValue) => {
|
|
1147
|
+
this.thermoAutoSchedules?.log.info(`Subscribe occupiedHeatingSetpoint called with: ${newValue / 100} (old value: ${oldValue / 100})`);
|
|
1148
|
+
}, this.thermoAutoSchedules.log);
|
|
1149
|
+
this.thermoAutoSchedules?.subscribeAttribute(Thermostat.id, 'occupiedCoolingSetpoint', (newValue, oldValue) => {
|
|
1150
|
+
this.thermoAutoSchedules?.log.info(`Subscribe occupiedCoolingSetpoint called with: ${newValue / 100} (old value: ${oldValue / 100})`);
|
|
1151
|
+
}, this.thermoAutoSchedules.log);
|
|
1152
|
+
this.thermoAutoSchedules?.subscribeAttribute(Thermostat.id, 'activeScheduleHandle', (newValue, oldValue) => {
|
|
1153
|
+
this.thermoAutoSchedules?.log.info(`Subscribe activeScheduleHandle called with: ${newValue ? `0x${Buffer.from(newValue).toString('hex')}` : 'null'} (old value: ${oldValue ? `0x${Buffer.from(oldValue).toString('hex')}` : 'null'})`);
|
|
1154
|
+
}, this.thermoAutoSchedules.log);
|
|
1155
|
+
this.thermoAutoSchedules?.subscribeAttribute(Thermostat.id, 'schedules', (newValue, oldValue) => {
|
|
1156
|
+
this.thermoAutoSchedules?.log.info(`Subscribe schedules called with: ${debugStringify(newValue)} (old value: ${debugStringify(oldValue)})`);
|
|
1157
|
+
}, this.thermoAutoSchedules.log);
|
|
1080
1158
|
this.thermoHeat = new MatterbridgeEndpoint([thermostat, bridgedNode, powerSource], { id: 'Thermostat (Heat)' }, this.config.debug)
|
|
1081
1159
|
.createDefaultIdentifyClusterServer()
|
|
1082
1160
|
.createDefaultBridgedDeviceBasicInformationClusterServer('Thermostat (Heat)', 'THE00024', 0xfff1, 'Matterbridge', 'Matterbridge Thermostat')
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matterbridge-example-dynamic-platform",
|
|
3
|
-
"version": "3.0.2-dev-
|
|
3
|
+
"version": "3.0.2-dev-20260809-1aeac01",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "matterbridge-example-dynamic-platform",
|
|
9
|
-
"version": "3.0.2-dev-
|
|
9
|
+
"version": "3.0.2-dev-20260809-1aeac01",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"node-ansi-logger": "3.3.0",
|
package/package.json
CHANGED