matterbridge-example-dynamic-platform 3.0.2-dev-20260809-1aeac01 → 3.0.2-dev-20260812-5fa3c30
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 +5 -33
- package/README.md +9 -8
- package/dist/module.js +76 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
|
|
24
24
|
All notable changes to this project will be documented in this file.
|
|
25
25
|
|
|
26
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
27
|
+
|
|
26
28
|
If you like this project and find it useful, please consider giving it a star on [GitHub](https://github.com/Luligu/matterbridge-example-dynamic-platform) and sponsoring it.
|
|
27
29
|
|
|
28
30
|
<a href="https://www.buymeacoffee.com/luligugithub"><img src="https://matterbridge.io/assets/bmc-button.svg" alt="Buy me a coffee" width="120"></a>
|
|
@@ -41,6 +43,7 @@ If you like this project and find it useful, please consider giving it a star on
|
|
|
41
43
|
- [platform]: Add `closureGarageDoor` device. Thanks Ludovic BOUÉ.
|
|
42
44
|
- [platform]: Add `closureVenetianBlind` device with Lift and Tilt panels. Thanks Ludovic BOUÉ.
|
|
43
45
|
- [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É.
|
|
46
|
+
- [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
47
|
|
|
45
48
|
### Changed
|
|
46
49
|
|
|
@@ -48,8 +51,8 @@ If you like this project and find it useful, please consider giving it a star on
|
|
|
48
51
|
- [package]: Update dependencies.
|
|
49
52
|
- [package]: Bump `typescript` to v.7.0.2.
|
|
50
53
|
- [package]: Bump `@types/node` to v.26.2.0.
|
|
51
|
-
- [package]: Bump `oxfmt` to v.0.
|
|
52
|
-
- [package]: Bump `oxlint` to v.1.
|
|
54
|
+
- [package]: Bump `oxfmt` to v.0.63.0.
|
|
55
|
+
- [package]: Bump `oxlint` to v.1.78.0.
|
|
53
56
|
- [package]: Bump `oxlint-tsgolint` to v.7.0.2001.
|
|
54
57
|
- [package]: Update agents configs.
|
|
55
58
|
|
|
@@ -939,34 +942,3 @@ If you like this project and find it useful, please consider giving it a star on
|
|
|
939
942
|
- [package]: Updated dependencies.
|
|
940
943
|
|
|
941
944
|
<a href="https://www.buymeacoffee.com/luligugithub"><img src="https://matterbridge.io/assets/bmc-button.svg" alt="Buy me a coffee" width="80"></a>
|
|
942
|
-
|
|
943
|
-
<!-- Commented out section
|
|
944
|
-
## [1.1.2] - 2024-03-08
|
|
945
|
-
|
|
946
|
-
### Added
|
|
947
|
-
|
|
948
|
-
- [Feature 1]: Description of the feature.
|
|
949
|
-
- [Feature 2]: Description of the feature.
|
|
950
|
-
|
|
951
|
-
### Changed
|
|
952
|
-
|
|
953
|
-
- [Feature 3]: Description of the change.
|
|
954
|
-
- [Feature 4]: Description of the change.
|
|
955
|
-
|
|
956
|
-
### Deprecated
|
|
957
|
-
|
|
958
|
-
- [Feature 5]: Description of the deprecation.
|
|
959
|
-
|
|
960
|
-
### Removed
|
|
961
|
-
|
|
962
|
-
- [Feature 6]: Description of the removal.
|
|
963
|
-
|
|
964
|
-
### Fixed
|
|
965
|
-
|
|
966
|
-
- [Bug 1]: Description of the bug fix.
|
|
967
|
-
- [Bug 2]: Description of the bug fix.
|
|
968
|
-
|
|
969
|
-
### Security
|
|
970
|
-
|
|
971
|
-
- [Security 1]: Description of the security improvement.
|
|
972
|
-
-->
|
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 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
|
|
@@ -113,7 +114,11 @@ If you like this project and find it useful, please consider giving it a star on
|
|
|
113
114
|
|
|
114
115
|
### Matterbridge
|
|
115
116
|
|
|
116
|
-
See the guidelines on [Matterbridge](https://
|
|
117
|
+
See the guidelines on [Matterbridge](https://matterbridge.io/README.html) for more information.
|
|
118
|
+
|
|
119
|
+
## Style guide
|
|
120
|
+
|
|
121
|
+
See also the [Style Guide](./STYLEGUIDE.md) for JSDoc, naming, and logging conventions used in this repository.
|
|
117
122
|
|
|
118
123
|
## Repository toolchain
|
|
119
124
|
|
|
@@ -127,10 +132,6 @@ See the guidelines on [Matterbridge](https://github.com/Luligu/matterbridge/blob
|
|
|
127
132
|
- **Much faster builds** — tsgo compiles the project in a fraction of the time required by the standard `tsc` build.
|
|
128
133
|
- **Editor support** — use the VS Code extensions for tsgo and oxc to get the same experience in the editor.
|
|
129
134
|
|
|
130
|
-
## Style guide
|
|
131
|
-
|
|
132
|
-
See also the [Style Guide](./STYLEGUIDE.md) for JSDoc, naming, and logging conventions used in this repository.
|
|
133
|
-
|
|
134
135
|
## Copilot instructions
|
|
135
136
|
|
|
136
137
|
| File | Notes |
|
|
@@ -163,8 +164,8 @@ See also the [Style Guide](./STYLEGUIDE.md) for JSDoc, naming, and logging conve
|
|
|
163
164
|
| `.codex/config.toml` | Codex project permissions, approvals, and profile |
|
|
164
165
|
| `.codex/rules/default.rules` | Codex command allow, prompt, and deny rules |
|
|
165
166
|
|
|
166
|
-
##
|
|
167
|
+
## Development guide
|
|
167
168
|
|
|
168
|
-
Refer to the Matterbridge [
|
|
169
|
+
Refer to the Matterbridge [Development guide](https://matterbridge.io/README-DEV.html) for other guidelines.
|
|
169
170
|
|
|
170
171
|
---
|
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]),
|
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-20260812-5fa3c30",
|
|
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-20260812-5fa3c30",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"node-ansi-logger": "3.3.0",
|
package/package.json
CHANGED