matterbridge-example-dynamic-platform 3.0.2-dev-20260809-1aeac01 → 3.0.2-dev-20260809-c06da9e

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
@@ -41,6 +41,7 @@ If you like this project and find it useful, please consider giving it a star on
41
41
  - [platform]: Add `closureGarageDoor` device. Thanks Ludovic BOUÉ.
42
42
  - [platform]: Add `closureVenetianBlind` device with Lift and Tilt panels. Thanks Ludovic BOUÉ.
43
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É.
44
+ - [thermostat]: Add a thermostat auto mode with thermostat suggestions (Comfort and Eco presets with a pre-seeded suggestion) including 2 sub endpoints with temperature and humidity sensors, using `createDefaultThermostatSuggestionsClusterServer()`. Thanks Ludovic BOUÉ.
44
45
 
45
46
  ### Changed
46
47
 
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 73 virtual devices:
26
+ It exposes 74 virtual devices:
27
27
 
28
28
  - a door contact sensor
29
29
  - a motion sensor
@@ -54,6 +54,7 @@ It exposes 73 virtual devices:
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
56
  - a thermostat auto mode with schedules (Weekdays and Weekend schedules) including 2 sub endpoints with temperature and humidity sensors
57
+ - a thermostat auto mode with thermostat suggestions (Comfort and Eco presets with a pre-seeded suggestion) including 2 sub endpoints with temperature and humidity sensors
57
58
  - a thermostat heat only with two external temperature sensors (tagged like Indoor and Outdoor)
58
59
  - a thermostat cool only
59
60
  - 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
+ thermoAutoSuggestions;
64
65
  thermoAutoSchedules;
65
66
  thermoHeat;
66
67
  thermoCool;
@@ -1078,6 +1079,81 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
1078
1079
  this.thermoAutoPresets?.subscribeAttribute(Thermostat.id, 'presets', (newValue, oldValue) => {
1079
1080
  this.thermoAutoPresets?.log.info(`Subscribe presets called with: ${debugStringify(newValue)} (old value: ${debugStringify(oldValue)})`);
1080
1081
  }, this.thermoAutoPresets.log);
1082
+ const presets_ListSuggestions = [
1083
+ {
1084
+ presetHandle: new Uint8Array([0]),
1085
+ presetScenario: Thermostat.PresetScenario.Occupied,
1086
+ name: 'Comfort',
1087
+ coolingSetpoint: 2400,
1088
+ heatingSetpoint: 2100,
1089
+ builtIn: true,
1090
+ },
1091
+ {
1092
+ presetHandle: new Uint8Array([1]),
1093
+ presetScenario: Thermostat.PresetScenario.Unoccupied,
1094
+ name: 'Eco',
1095
+ coolingSetpoint: 2700,
1096
+ heatingSetpoint: 1800,
1097
+ builtIn: true,
1098
+ },
1099
+ ];
1100
+ const thermostatSuggestions_List = [
1101
+ {
1102
+ uniqueId: 0,
1103
+ presetHandle: new Uint8Array([1]),
1104
+ effectiveTime: Math.floor(Date.now() / 1000),
1105
+ expirationTime: Math.floor(Date.now() / 1000) + 60 * 60,
1106
+ },
1107
+ ];
1108
+ this.thermoAutoSuggestions = new MatterbridgeEndpoint([thermostat, bridgedNode, powerSource], { id: 'Thermostat (AutoModeSuggestions)' }, this.config.debug)
1109
+ .createDefaultIdentifyClusterServer()
1110
+ .createDefaultBridgedDeviceBasicInformationClusterServer('Thermostat (AutoModeSuggestions)', 'TSU00060', 0xfff1, 'Matterbridge', 'Matterbridge Thermostat With Suggestions')
1111
+ .createDefaultThermostatSuggestionsClusterServer(20, 18, 22, 1, 0, 35, 15, 50, undefined, undefined, undefined, undefined, null, presets_ListSuggestions, undefined, thermostatSuggestions_List)
1112
+ .createDefaultPowerSourceWiredClusterServer()
1113
+ .addRequiredClusterServers();
1114
+ if (this.thermoAutoSuggestions) {
1115
+ this.thermoAutoSuggestions
1116
+ .addChildDeviceType('Temperature', temperatureSensor)
1117
+ .createDefaultTemperatureMeasurementClusterServer(21 * 100)
1118
+ .addRequiredClusterServers();
1119
+ this.thermoAutoSuggestions
1120
+ .addChildDeviceType('Humidity', humiditySensor)
1121
+ .createDefaultRelativeHumidityMeasurementClusterServer(50 * 100)
1122
+ .addRequiredClusterServers();
1123
+ this.thermoAutoSuggestions = await this.addDevice(this.thermoAutoSuggestions);
1124
+ }
1125
+ this.thermoAutoSuggestions?.addCommandHandler('identify', ({ request: { identifyTime } }) => {
1126
+ this.thermoAutoSuggestions?.log.info(`Command identify called identifyTime ${identifyTime}`);
1127
+ });
1128
+ this.thermoAutoSuggestions?.addCommandHandler('triggerEffect', ({ request: { effectIdentifier, effectVariant } }) => {
1129
+ this.thermoAutoSuggestions?.log.info(`Command identify called effectIdentifier ${effectIdentifier} effectVariant ${effectVariant}`);
1130
+ });
1131
+ this.thermoAutoSuggestions?.addCommandHandler('setpointRaiseLower', ({ request: { mode, amount } }) => {
1132
+ const lookupSetpointAdjustMode = ['Heat', 'Cool', 'Both'];
1133
+ this.thermoAutoSuggestions?.log.info(`Command setpointRaiseLower called with mode: ${lookupSetpointAdjustMode[mode]} amount: ${amount / 10}`);
1134
+ });
1135
+ this.thermoAutoSuggestions?.addCommandHandler('addThermostatSuggestion', ({ request: { presetHandle, effectiveTime, expirationInMinutes } }) => {
1136
+ this.thermoAutoSuggestions?.log.info(`Command addThermostatSuggestion called with presetHandle: 0x${Buffer.from(presetHandle).toString('hex')} effectiveTime: ${effectiveTime ?? 'now'} expirationInMinutes: ${expirationInMinutes}`);
1137
+ });
1138
+ this.thermoAutoSuggestions?.addCommandHandler('removeThermostatSuggestion', ({ request: { uniqueId } }) => {
1139
+ this.thermoAutoSuggestions?.log.info(`Command removeThermostatSuggestion called with uniqueId: ${uniqueId}`);
1140
+ });
1141
+ this.thermoAutoSuggestions?.subscribeAttribute(Thermostat, 'systemMode', (newValue, oldValue) => {
1142
+ const lookupSystemMode = ['Off', 'Auto', '', 'Cool', 'Heat', 'EmergencyHeat', 'Precooling', 'FanOnly', 'Dry', 'Sleep'];
1143
+ this.thermoAutoSuggestions?.log.info(`Subscribe systemMode called with: ${lookupSystemMode[newValue]} (old value: ${lookupSystemMode[oldValue]})`);
1144
+ }, this.thermoAutoSuggestions.log);
1145
+ this.thermoAutoSuggestions?.subscribeAttribute(Thermostat.id, 'occupiedHeatingSetpoint', (newValue, oldValue) => {
1146
+ this.thermoAutoSuggestions?.log.info(`Subscribe occupiedHeatingSetpoint called with: ${newValue / 100} (old value: ${oldValue / 100})`);
1147
+ }, this.thermoAutoSuggestions.log);
1148
+ this.thermoAutoSuggestions?.subscribeAttribute(Thermostat.id, 'occupiedCoolingSetpoint', (newValue, oldValue) => {
1149
+ this.thermoAutoSuggestions?.log.info(`Subscribe occupiedCoolingSetpoint called with: ${newValue / 100} (old value: ${oldValue / 100})`);
1150
+ }, this.thermoAutoSuggestions.log);
1151
+ this.thermoAutoSuggestions?.subscribeAttribute(Thermostat.id, 'thermostatSuggestions', (newValue, oldValue) => {
1152
+ this.thermoAutoSuggestions?.log.info(`Subscribe thermostatSuggestions called with: ${debugStringify(newValue)} (old value: ${debugStringify(oldValue)})`);
1153
+ }, this.thermoAutoSuggestions.log);
1154
+ this.thermoAutoSuggestions?.subscribeAttribute(Thermostat.id, 'currentThermostatSuggestion', (newValue, oldValue) => {
1155
+ this.thermoAutoSuggestions?.log.info(`Subscribe currentThermostatSuggestion called with: ${debugStringify(newValue)} (old value: ${debugStringify(oldValue)})`);
1156
+ }, this.thermoAutoSuggestions.log);
1081
1157
  const schedules_List = [
1082
1158
  {
1083
1159
  scheduleHandle: new Uint8Array([0]),
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "matterbridge-example-dynamic-platform",
3
- "version": "3.0.2-dev-20260809-1aeac01",
3
+ "version": "3.0.2-dev-20260809-c06da9e",
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-20260809-1aeac01",
9
+ "version": "3.0.2-dev-20260809-c06da9e",
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
12
  "node-ansi-logger": "3.3.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "matterbridge-example-dynamic-platform",
3
- "version": "3.0.2-dev-20260809-1aeac01",
3
+ "version": "3.0.2-dev-20260809-c06da9e",
4
4
  "description": "Matterbridge dynamic plugin",
5
5
  "author": "https://github.com/Luligu",
6
6
  "license": "Apache-2.0",