matterbridge 3.0.0-edge.1 → 3.0.0-edge.10
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 +46 -2
- package/dist/cli.js +4 -1
- package/dist/frontend.js +2 -3
- package/dist/matterbridge.js +23 -4
- package/dist/matterbridgeBehaviors.js +31 -31
- package/dist/matterbridgeDeviceTypes.js +121 -20
- package/dist/matterbridgeEndpoint.js +50 -48
- package/dist/matterbridgePlatform.js +2 -2
- package/dist/pluginManager.js +8 -2
- package/frontend/build/asset-manifest.json +3 -3
- package/frontend/build/index.html +1 -1
- package/frontend/build/static/js/{main.1fa50342.js → main.ff47208e.js} +3 -3
- package/frontend/build/static/js/{main.1fa50342.js.map → main.ff47208e.js.map} +1 -1
- package/npm-shrinkwrap.json +296 -365
- package/package.json +3 -4
- /package/frontend/build/static/js/{main.1fa50342.js.LICENSE.txt → main.ff47208e.js.LICENSE.txt} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -47,26 +47,70 @@ Modified clusters:
|
|
|
47
47
|
### Added
|
|
48
48
|
|
|
49
49
|
- [addEndpoint]: Added an error handler with deep stack on aggregatorNode.add() and serverNode.add() calls.
|
|
50
|
+
- [endpoint]: Added createOffOnlyOnOffClusterServer().
|
|
51
|
+
- [endpoint]: Added createBaseFanControlClusterServer().
|
|
52
|
+
- [endpoint]: Added createDefaultHepaFilterMonitoringClusterServer().
|
|
53
|
+
- [endpoint]: Added createDefaultActivatedCarbonFilterMonitoringClusterServer().
|
|
54
|
+
- [deviceTypes]: Added Robotic device type.
|
|
55
|
+
- [deviceTypes]: Added Appliances device types.
|
|
50
56
|
|
|
51
57
|
### Changed
|
|
52
58
|
|
|
59
|
+
- [package]: Update express to 5.1.0.
|
|
60
|
+
- [package]: Update dependencies.
|
|
53
61
|
- [deviceTypes]: Updated device types to Matter 1.4
|
|
54
62
|
- [matter.js]: Update to 0.13.0-alpha.0-20250405-7fc7db48.
|
|
63
|
+
- [matter.js]: Update to 0.13.0-alpha.0-20250408-c916c7e8.
|
|
64
|
+
- [matter.js]: Update to 0.13.0-alpha.0-20250412-5fad64e7b.
|
|
65
|
+
- [matter.js]: Update to 0.13.0-alpha.0-20250413-d5a27700d.
|
|
66
|
+
- [matter.js]: Update to 0.13.0-alpha.0-20250415-475996bb5.
|
|
67
|
+
- [matter.js]: Update to 0.13.0-alpha.0-20250418-8cfc0b832.
|
|
55
68
|
|
|
56
69
|
### Fixed
|
|
57
70
|
|
|
58
71
|
- [doorLock]: Fixed supportedOperatingModes inverted bitmap (Thanks Apollon).
|
|
72
|
+
- [DevicesIcon]: Fixed rendering of leak freeze and rain sensors.
|
|
73
|
+
- [QRCode]: Fixed rendering of QRCode panel when advertising stops.
|
|
74
|
+
- [matterbridge]: Fixed wrong message when advertising stops and the node has been paired.
|
|
59
75
|
|
|
60
|
-
## [2.2.
|
|
76
|
+
## [2.2.9] - 2025-04-18
|
|
61
77
|
|
|
62
78
|
### Added
|
|
63
79
|
|
|
64
|
-
- [
|
|
80
|
+
- [deviceTypes]: Added extendedColorLight device type.
|
|
81
|
+
|
|
82
|
+
### Changed
|
|
83
|
+
|
|
84
|
+
- [package]: Update dependencies.
|
|
85
|
+
|
|
86
|
+
### Fixed
|
|
87
|
+
|
|
88
|
+
- [QRCode]: Fixed update when the server node is no more advertising.
|
|
89
|
+
- [frontend]: Fixed wrong notification when the server node has been paired.
|
|
90
|
+
|
|
91
|
+
<a href="https://www.buymeacoffee.com/luligugithub">
|
|
92
|
+
<img src="bmc-button.svg" alt="Buy me a coffee" width="80">
|
|
93
|
+
</a>
|
|
94
|
+
|
|
95
|
+
## [2.2.8] - 2025-04-10
|
|
96
|
+
|
|
97
|
+
### Added
|
|
98
|
+
|
|
99
|
+
- [platform]: Added stack to error messages.
|
|
100
|
+
- [endpoint]: Added createLevelControlClusterServer()
|
|
65
101
|
- [endpoint]: Added createLevelTvocMeasurementClusterServer()
|
|
102
|
+
- [frontend]: Added a restart button on the QRCode panel when the advertising for a not paired node is expired.
|
|
66
103
|
|
|
67
104
|
### Changed
|
|
68
105
|
|
|
69
106
|
- [package]: Update dependencies.
|
|
107
|
+
- [package]: Use node:https.
|
|
108
|
+
- [endpoint]: Modified createOnOffClusterServer().
|
|
109
|
+
|
|
110
|
+
### Fixed
|
|
111
|
+
|
|
112
|
+
- [homepage]: Fixed warning log for homepage property in package.json.
|
|
113
|
+
- [DevicesIcon]: Fixed rendering of rain, freeze and leak sensors.
|
|
70
114
|
|
|
71
115
|
<a href="https://www.buymeacoffee.com/luligugithub">
|
|
72
116
|
<img src="bmc-button.svg" alt="Buy me a coffee" width="80">
|
package/dist/cli.js
CHANGED
|
@@ -3,6 +3,7 @@ import { Matterbridge } from './matterbridge.js';
|
|
|
3
3
|
import { getIntParameter, hasParameter } from './utils/export.js';
|
|
4
4
|
import { AnsiLogger, BRIGHT, CYAN, db, YELLOW } from './logger/export.js';
|
|
5
5
|
import { EventEmitter } from 'node:events';
|
|
6
|
+
import { inspect } from 'node:util';
|
|
6
7
|
export const cliEmitter = new EventEmitter();
|
|
7
8
|
export let instance;
|
|
8
9
|
let session;
|
|
@@ -186,5 +187,7 @@ async function main() {
|
|
|
186
187
|
}
|
|
187
188
|
process.title = 'matterbridge';
|
|
188
189
|
main().catch((error) => {
|
|
189
|
-
|
|
190
|
+
const errorMessage = error instanceof Error ? error.message : error;
|
|
191
|
+
const errorInspect = inspect(error, { depth: 10 });
|
|
192
|
+
log.error(`Matterbridge.loadInstance() failed with error: ${errorMessage}\n${errorInspect}`);
|
|
190
193
|
});
|
package/dist/frontend.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EndpointServer, Logger, LogLevel as MatterLogLevel, LogFormat as MatterLogFormat, Lifecycle } from '@matter/main';
|
|
2
2
|
import { createServer } from 'node:http';
|
|
3
|
+
import https from 'node:https';
|
|
3
4
|
import os from 'node:os';
|
|
4
5
|
import path from 'node:path';
|
|
5
6
|
import { promises as fs } from 'node:fs';
|
|
6
|
-
import https from 'https';
|
|
7
7
|
import express from 'express';
|
|
8
8
|
import WebSocket, { WebSocketServer } from 'ws';
|
|
9
9
|
import multer from 'multer';
|
|
@@ -814,9 +814,8 @@ export class Frontend {
|
|
|
814
814
|
res.status(500).send(`Error uploading or installing plugin package ${filename}`);
|
|
815
815
|
}
|
|
816
816
|
});
|
|
817
|
-
this.expressApp.
|
|
817
|
+
this.expressApp.use((req, res) => {
|
|
818
818
|
this.log.debug('The frontend sent:', req.url);
|
|
819
|
-
this.log.debug('Response send file:', path.join(this.matterbridge.rootDirectory, 'frontend/build/index.html'));
|
|
820
819
|
res.sendFile(path.join(this.matterbridge.rootDirectory, 'frontend/build/index.html'));
|
|
821
820
|
});
|
|
822
821
|
this.log.debug(`Frontend initialized on port ${YELLOW}${this.port}${db} static ${UNDERLINE}${path.join(this.matterbridge.rootDirectory, 'frontend/build')}${UNDERLINEOFF}${rs}`);
|
package/dist/matterbridge.js
CHANGED
|
@@ -15,8 +15,8 @@ import { Frontend } from './frontend.js';
|
|
|
15
15
|
import { DeviceTypeId, Endpoint as EndpointNode, Logger, LogLevel as MatterLogLevel, LogFormat as MatterLogFormat, VendorId, StorageService, Environment, ServerNode } from '@matter/main';
|
|
16
16
|
import { DeviceCommissioner, FabricAction, MdnsService, PaseClient } from '@matter/main/protocol';
|
|
17
17
|
import { AggregatorEndpoint } from '@matter/main/endpoints';
|
|
18
|
-
import { BridgedDeviceBasicInformationServer } from '@matter/main/behaviors/bridged-device-basic-information';
|
|
19
18
|
import { BasicInformationServer } from '@matter/main/behaviors/basic-information';
|
|
19
|
+
import { BridgedDeviceBasicInformationServer } from '@matter/main/behaviors/bridged-device-basic-information';
|
|
20
20
|
const plg = '\u001B[38;5;33m';
|
|
21
21
|
const dev = '\u001B[38;5;79m';
|
|
22
22
|
const typ = '\u001B[38;5;207m';
|
|
@@ -122,7 +122,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
122
122
|
matterStorageService;
|
|
123
123
|
matterStorageManager;
|
|
124
124
|
matterbridgeContext;
|
|
125
|
-
|
|
125
|
+
controllerContext;
|
|
126
126
|
mdnsInterface;
|
|
127
127
|
ipv4address;
|
|
128
128
|
ipv6address;
|
|
@@ -1337,6 +1337,19 @@ export class Matterbridge extends EventEmitter {
|
|
|
1337
1337
|
}, 1000);
|
|
1338
1338
|
}
|
|
1339
1339
|
async startController() {
|
|
1340
|
+
if (!this.matterStorageManager) {
|
|
1341
|
+
this.log.error('No storage manager initialized');
|
|
1342
|
+
await this.cleanup('No storage manager initialized');
|
|
1343
|
+
return;
|
|
1344
|
+
}
|
|
1345
|
+
this.log.info('Creating context: mattercontrollerContext');
|
|
1346
|
+
this.controllerContext = this.matterStorageManager.createContext('mattercontrollerContext');
|
|
1347
|
+
if (!this.controllerContext) {
|
|
1348
|
+
this.log.error('No storage context mattercontrollerContext initialized');
|
|
1349
|
+
await this.cleanup('No storage context mattercontrollerContext initialized');
|
|
1350
|
+
return;
|
|
1351
|
+
}
|
|
1352
|
+
this.log.debug('Starting matterbridge in mode', this.bridgeMode);
|
|
1340
1353
|
}
|
|
1341
1354
|
async startMatterStorage() {
|
|
1342
1355
|
this.log.info(`Starting matter node storage...`);
|
|
@@ -1494,6 +1507,8 @@ export class Matterbridge extends EventEmitter {
|
|
|
1494
1507
|
}
|
|
1495
1508
|
}
|
|
1496
1509
|
setTimeout(() => {
|
|
1510
|
+
if (serverNode.lifecycle.isCommissioned)
|
|
1511
|
+
return;
|
|
1497
1512
|
if (this.bridgeMode === 'bridge') {
|
|
1498
1513
|
this.matterbridgeQrPairingCode = undefined;
|
|
1499
1514
|
this.matterbridgeManualPairingCode = undefined;
|
|
@@ -1503,10 +1518,12 @@ export class Matterbridge extends EventEmitter {
|
|
|
1503
1518
|
if (plugin) {
|
|
1504
1519
|
plugin.qrPairingCode = undefined;
|
|
1505
1520
|
plugin.manualPairingCode = undefined;
|
|
1506
|
-
this.frontend.wssSendRefreshRequired('plugins');
|
|
1507
1521
|
}
|
|
1508
1522
|
}
|
|
1523
|
+
this.frontend.wssSendRefreshRequired('plugins');
|
|
1509
1524
|
this.frontend.wssSendRefreshRequired('settings');
|
|
1525
|
+
this.frontend.wssSendRefreshRequired('fabrics');
|
|
1526
|
+
this.frontend.wssSendRefreshRequired('sessions');
|
|
1510
1527
|
this.frontend.wssSendSnackbarMessage(`Advertising on server node for ${storeId} stopped. Restart to commission.`, 0);
|
|
1511
1528
|
this.log.notice(`Advertising on server node for ${storeId} stopped. Restart to commission.`);
|
|
1512
1529
|
}, 15 * 60 * 1000).unref();
|
|
@@ -1728,12 +1745,14 @@ export class Matterbridge extends EventEmitter {
|
|
|
1728
1745
|
this.devices.remove(device);
|
|
1729
1746
|
}
|
|
1730
1747
|
async removeAllBridgedEndpoints(pluginName, delay = 0) {
|
|
1731
|
-
this.log.debug(`Removing all bridged endpoints for plugin ${plg}${pluginName}${db}`);
|
|
1748
|
+
this.log.debug(`Removing all bridged endpoints for plugin ${plg}${pluginName}${db}${delay > 0 ? ` with delay ${delay} ms` : ''}`);
|
|
1732
1749
|
for (const device of this.devices.array().filter((device) => device.plugin === pluginName)) {
|
|
1733
1750
|
await this.removeBridgedEndpoint(pluginName, device);
|
|
1734
1751
|
if (delay > 0)
|
|
1735
1752
|
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
1736
1753
|
}
|
|
1754
|
+
if (delay > 0)
|
|
1755
|
+
await new Promise((resolve) => setTimeout(resolve, 2000));
|
|
1737
1756
|
}
|
|
1738
1757
|
async subscribeAttributeChanged(plugin, device) {
|
|
1739
1758
|
this.log.info(`Subscribing attributes for endpoint ${dev}${device.deviceName}${nf} (${dev}${device.id}${nf}) plugin ${plg}${plugin.name}${nf}`);
|
|
@@ -19,7 +19,7 @@ import { ValveConfigurationAndControlBehavior } from '@matter/main/behaviors/val
|
|
|
19
19
|
import { ModeSelectServer } from '@matter/main/behaviors/mode-select';
|
|
20
20
|
import { SmokeCoAlarmServer } from '@matter/main/behaviors/smoke-co-alarm';
|
|
21
21
|
import { SwitchServer } from '@matter/main/behaviors/switch';
|
|
22
|
-
export class
|
|
22
|
+
export class MatterbridgeServerDevice {
|
|
23
23
|
log;
|
|
24
24
|
commandHandler;
|
|
25
25
|
device;
|
|
@@ -141,107 +141,107 @@ export class MatterbridgeBehaviorDevice {
|
|
|
141
141
|
this.commandHandler.executeHandler('enableDisableAlarm', { request: { alarmsToEnableDisable }, attributes: {}, endpoint: { number: this.endpointNumber, uniqueStorageKey: this.endpointId } });
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
export class
|
|
144
|
+
export class MatterbridgeServer extends Behavior {
|
|
145
145
|
static id = 'matterbridge';
|
|
146
146
|
}
|
|
147
|
-
(function (
|
|
147
|
+
(function (MatterbridgeServer) {
|
|
148
148
|
class State {
|
|
149
149
|
deviceCommand;
|
|
150
150
|
}
|
|
151
|
-
|
|
152
|
-
})(
|
|
151
|
+
MatterbridgeServer.State = State;
|
|
152
|
+
})(MatterbridgeServer || (MatterbridgeServer = {}));
|
|
153
153
|
export class MatterbridgeIdentifyServer extends IdentifyServer {
|
|
154
154
|
initialize() {
|
|
155
|
-
const device = this.agent.get(
|
|
155
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
156
156
|
device.setEndpointId(this.endpoint.maybeId);
|
|
157
157
|
device.setEndpointNumber(this.endpoint.maybeNumber);
|
|
158
158
|
super.initialize();
|
|
159
159
|
}
|
|
160
160
|
identify({ identifyTime }) {
|
|
161
|
-
const device = this.agent.get(
|
|
161
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
162
162
|
device.identify({ identifyTime });
|
|
163
163
|
super.identify({ identifyTime });
|
|
164
164
|
}
|
|
165
165
|
triggerEffect({ effectIdentifier, effectVariant }) {
|
|
166
|
-
const device = this.agent.get(
|
|
166
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
167
167
|
device.triggerEffect({ effectIdentifier, effectVariant });
|
|
168
168
|
super.triggerEffect({ effectIdentifier, effectVariant });
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
export class MatterbridgeOnOffServer extends OnOffServer {
|
|
172
172
|
async on() {
|
|
173
|
-
const device = this.agent.get(
|
|
173
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
174
174
|
device.on();
|
|
175
175
|
super.on();
|
|
176
176
|
}
|
|
177
177
|
async off() {
|
|
178
|
-
const device = this.agent.get(
|
|
178
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
179
179
|
device.off();
|
|
180
180
|
super.off();
|
|
181
181
|
}
|
|
182
182
|
async toggle() {
|
|
183
|
-
const device = this.agent.get(
|
|
183
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
184
184
|
device.toggle();
|
|
185
185
|
super.toggle();
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
export class MatterbridgeLevelControlServer extends LevelControlServer {
|
|
189
189
|
async moveToLevel({ level, transitionTime, optionsMask, optionsOverride }) {
|
|
190
|
-
const device = this.agent.get(
|
|
190
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
191
191
|
device.moveToLevel({ level, transitionTime, optionsMask, optionsOverride });
|
|
192
192
|
super.moveToLevel({ level, transitionTime, optionsMask, optionsOverride });
|
|
193
193
|
}
|
|
194
194
|
async moveToLevelWithOnOff({ level, transitionTime, optionsMask, optionsOverride }) {
|
|
195
|
-
const device = this.agent.get(
|
|
195
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
196
196
|
device.moveToLevelWithOnOff({ level, transitionTime, optionsMask, optionsOverride });
|
|
197
197
|
super.moveToLevelWithOnOff({ level, transitionTime, optionsMask, optionsOverride });
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
200
|
export class MatterbridgeColorControlServer extends ColorControlServer.with(ColorControl.Feature.HueSaturation, ColorControl.Feature.Xy, ColorControl.Feature.ColorTemperature) {
|
|
201
201
|
async moveToHue({ optionsMask, optionsOverride, hue, direction, transitionTime }) {
|
|
202
|
-
const device = this.agent.get(
|
|
202
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
203
203
|
device.moveToHue({ optionsMask, optionsOverride, hue, direction, transitionTime });
|
|
204
204
|
super.moveToHue({ optionsMask, optionsOverride, hue, direction, transitionTime });
|
|
205
205
|
}
|
|
206
206
|
async moveToSaturation({ optionsMask, optionsOverride, saturation, transitionTime }) {
|
|
207
|
-
const device = this.agent.get(
|
|
207
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
208
208
|
device.moveToSaturation({ optionsMask, optionsOverride, saturation, transitionTime });
|
|
209
209
|
super.moveToSaturation({ optionsMask, optionsOverride, saturation, transitionTime });
|
|
210
210
|
}
|
|
211
211
|
async moveToHueAndSaturation({ optionsOverride, optionsMask, saturation, hue, transitionTime }) {
|
|
212
|
-
const device = this.agent.get(
|
|
212
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
213
213
|
device.moveToHueAndSaturation({ optionsOverride, optionsMask, saturation, hue, transitionTime });
|
|
214
214
|
super.moveToHueAndSaturation({ optionsOverride, optionsMask, saturation, hue, transitionTime });
|
|
215
215
|
}
|
|
216
216
|
async moveToColor({ optionsMask, optionsOverride, colorX, colorY, transitionTime }) {
|
|
217
|
-
const device = this.agent.get(
|
|
217
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
218
218
|
device.moveToColor({ optionsMask, optionsOverride, colorX, colorY, transitionTime });
|
|
219
219
|
super.moveToColor({ optionsMask, optionsOverride, colorX, colorY, transitionTime });
|
|
220
220
|
}
|
|
221
221
|
async moveToColorTemperature({ optionsOverride, optionsMask, colorTemperatureMireds, transitionTime }) {
|
|
222
|
-
const device = this.agent.get(
|
|
222
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
223
223
|
device.moveToColorTemperature({ optionsOverride, optionsMask, colorTemperatureMireds, transitionTime });
|
|
224
224
|
super.moveToColorTemperature({ optionsOverride, optionsMask, colorTemperatureMireds, transitionTime });
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
export class MatterbridgeWindowCoveringServer extends WindowCoveringServer.with(WindowCovering.Feature.Lift, WindowCovering.Feature.PositionAwareLift) {
|
|
228
228
|
async upOrOpen() {
|
|
229
|
-
const device = this.agent.get(
|
|
229
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
230
230
|
device.upOrOpen();
|
|
231
231
|
super.upOrOpen();
|
|
232
232
|
}
|
|
233
233
|
async downOrClose() {
|
|
234
|
-
const device = this.agent.get(
|
|
234
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
235
235
|
device.downOrClose();
|
|
236
236
|
super.downOrClose();
|
|
237
237
|
}
|
|
238
238
|
stopMotion() {
|
|
239
|
-
const device = this.agent.get(
|
|
239
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
240
240
|
device.stopMotion();
|
|
241
241
|
super.stopMotion();
|
|
242
242
|
}
|
|
243
243
|
goToLiftPercentage({ liftPercent100thsValue }) {
|
|
244
|
-
const device = this.agent.get(
|
|
244
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
245
245
|
device.goToLiftPercentage({ liftPercent100thsValue });
|
|
246
246
|
super.goToLiftPercentage({ liftPercent100thsValue });
|
|
247
247
|
}
|
|
@@ -250,26 +250,26 @@ export class MatterbridgeWindowCoveringServer extends WindowCoveringServer.with(
|
|
|
250
250
|
}
|
|
251
251
|
export class MatterbridgeDoorLockServer extends DoorLockServer {
|
|
252
252
|
async lockDoor() {
|
|
253
|
-
const device = this.agent.get(
|
|
253
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
254
254
|
device.lockDoor();
|
|
255
255
|
super.lockDoor();
|
|
256
256
|
}
|
|
257
257
|
async unlockDoor() {
|
|
258
|
-
const device = this.agent.get(
|
|
258
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
259
259
|
device.unlockDoor();
|
|
260
260
|
super.unlockDoor();
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
export class MatterbridgeModeSelectServer extends ModeSelectServer {
|
|
264
264
|
async changeToMode({ newMode }) {
|
|
265
|
-
const device = this.agent.get(
|
|
265
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
266
266
|
device.changeToMode({ newMode });
|
|
267
267
|
super.changeToMode({ newMode });
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
270
|
export class MatterbridgeFanControlServer extends FanControlServer.with(FanControl.Feature.MultiSpeed, FanControl.Feature.Auto, FanControl.Feature.Step) {
|
|
271
271
|
async step({ direction, wrap, lowestOff }) {
|
|
272
|
-
const device = this.agent.get(
|
|
272
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
273
273
|
device.step({ direction, wrap, lowestOff });
|
|
274
274
|
const lookupStepDirection = ['Increase', 'Decrease'];
|
|
275
275
|
device.log.debug(`Command step called with direction: ${lookupStepDirection[direction]} wrap: ${wrap} lowestOff: ${lowestOff}`);
|
|
@@ -294,7 +294,7 @@ export class MatterbridgeFanControlServer extends FanControlServer.with(FanContr
|
|
|
294
294
|
}
|
|
295
295
|
export class MatterbridgeThermostatServer extends ThermostatBehavior.with(Thermostat.Feature.Cooling, Thermostat.Feature.Heating, Thermostat.Feature.AutoMode) {
|
|
296
296
|
async setpointRaiseLower({ mode, amount }) {
|
|
297
|
-
const device = this.agent.get(
|
|
297
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
298
298
|
device.setpointRaiseLower({ mode, amount });
|
|
299
299
|
const lookupSetpointAdjustMode = ['Heat', 'Cool', 'Both'];
|
|
300
300
|
device.log.debug(`Command setpointRaiseLower called with mode: ${lookupSetpointAdjustMode[mode]} amount: ${amount / 10}`);
|
|
@@ -316,14 +316,14 @@ export class MatterbridgeValveConfigurationAndControlServer extends ValveConfigu
|
|
|
316
316
|
initialize() {
|
|
317
317
|
}
|
|
318
318
|
open({ openDuration, targetLevel }) {
|
|
319
|
-
const device = this.agent.get(
|
|
319
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
320
320
|
device.log.debug(`Command open called with openDuration: ${openDuration} targetLevel: ${targetLevel}`);
|
|
321
321
|
device.open({ openDuration, targetLevel });
|
|
322
322
|
this.state.targetLevel = targetLevel ?? 100;
|
|
323
323
|
this.state.currentLevel = targetLevel ?? 100;
|
|
324
324
|
}
|
|
325
325
|
close() {
|
|
326
|
-
const device = this.agent.get(
|
|
326
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
327
327
|
device.log.debug(`Command close called`);
|
|
328
328
|
device.close();
|
|
329
329
|
this.state.targetLevel = 0;
|
|
@@ -332,14 +332,14 @@ export class MatterbridgeValveConfigurationAndControlServer extends ValveConfigu
|
|
|
332
332
|
}
|
|
333
333
|
export class MatterbridgeSmokeCoAlarmServer extends SmokeCoAlarmServer.with(SmokeCoAlarm.Feature.SmokeAlarm, SmokeCoAlarm.Feature.CoAlarm) {
|
|
334
334
|
async selfTestRequest() {
|
|
335
|
-
const device = this.agent.get(
|
|
335
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
336
336
|
device.selfTestRequest();
|
|
337
337
|
super.selfTestRequest();
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
340
|
export class MatterbridgeBooleanStateConfigurationServer extends BooleanStateConfigurationServer.with(BooleanStateConfiguration.Feature.Visual, BooleanStateConfiguration.Feature.Audible, BooleanStateConfiguration.Feature.SensitivityLevel) {
|
|
341
341
|
async enableDisableAlarm({ alarmsToEnableDisable }) {
|
|
342
|
-
const device = this.agent.get(
|
|
342
|
+
const device = this.agent.get(MatterbridgeServer).state.deviceCommand;
|
|
343
343
|
device.enableDisableAlarm({ alarmsToEnableDisable });
|
|
344
344
|
super.enableDisableAlarm({ alarmsToEnableDisable });
|
|
345
345
|
}
|
|
@@ -44,41 +44,48 @@ import { EnergyPreference } from '@matter/main/clusters/energy-preference';
|
|
|
44
44
|
import { RvcRunMode } from '@matter/main/clusters/rvc-run-mode';
|
|
45
45
|
import { RvcOperationalState } from '@matter/main/clusters/rvc-operational-state';
|
|
46
46
|
import { RvcCleanMode } from '@matter/main/clusters/rvc-clean-mode';
|
|
47
|
-
import { ScenesManagement } from '@matter/main/clusters/scenes-management';
|
|
48
47
|
import { HepaFilterMonitoring } from '@matter/main/clusters/hepa-filter-monitoring';
|
|
49
48
|
import { ActivatedCarbonFilterMonitoring } from '@matter/main/clusters/activated-carbon-filter-monitoring';
|
|
50
49
|
import { DeviceEnergyManagementMode } from '@matter/main/clusters/device-energy-management-mode';
|
|
51
50
|
import { AdministratorCommissioning } from '@matter/main/clusters/administrator-commissioning';
|
|
52
51
|
import { EcosystemInformation } from '@matter/main/clusters/ecosystem-information';
|
|
53
|
-
import { AccessControl } from '@matter/main/clusters/access-control';
|
|
54
52
|
import { CommissionerControl } from '@matter/main/clusters/commissioner-control';
|
|
55
|
-
import {
|
|
53
|
+
import { DishwasherAlarm } from '@matter/main/clusters/dishwasher-alarm';
|
|
54
|
+
import { DishwasherMode } from '@matter/main/clusters/dishwasher-mode';
|
|
55
|
+
import { LaundryDryerControls } from '@matter/main/clusters/laundry-dryer-controls';
|
|
56
|
+
import { LaundryWasherControls } from '@matter/main/clusters/laundry-washer-controls';
|
|
57
|
+
import { LaundryWasherMode } from '@matter/main/clusters/laundry-washer-mode';
|
|
58
|
+
import { MicrowaveOvenControl } from '@matter/main/clusters/microwave-oven-control';
|
|
59
|
+
import { MicrowaveOvenMode } from '@matter/main/clusters/microwave-oven-mode';
|
|
60
|
+
import { OperationalState } from '@matter/main/clusters/operational-state';
|
|
61
|
+
import { OvenCavityOperationalState } from '@matter/main/clusters/oven-cavity-operational-state';
|
|
62
|
+
import { OvenMode } from '@matter/main/clusters/oven-mode';
|
|
63
|
+
import { RefrigeratorAlarm } from '@matter/main/clusters/refrigerator-alarm';
|
|
64
|
+
import { RefrigeratorAndTemperatureControlledCabinetMode } from '@matter/main/clusters/refrigerator-and-temperature-controlled-cabinet-mode';
|
|
65
|
+
import { ServiceArea } from '@matter/main/clusters/service-area';
|
|
66
|
+
import { TemperatureControl } from '@matter/main/clusters/temperature-control';
|
|
56
67
|
export var DeviceClasses;
|
|
57
68
|
(function (DeviceClasses) {
|
|
58
69
|
DeviceClasses["Node"] = "Node";
|
|
59
|
-
DeviceClasses["Utility"] = "Utility";
|
|
60
70
|
DeviceClasses["App"] = "App";
|
|
71
|
+
DeviceClasses["Utility"] = "Utility";
|
|
61
72
|
DeviceClasses["Simple"] = "Simple";
|
|
62
73
|
DeviceClasses["Dynamic"] = "Dynamic";
|
|
63
74
|
DeviceClasses["Client"] = "Client";
|
|
64
75
|
DeviceClasses["Server"] = "Server";
|
|
65
76
|
DeviceClasses["Composed"] = "Composed";
|
|
66
|
-
DeviceClasses["
|
|
67
|
-
DeviceClasses["EZInitiator"] = "EZ-Initiator";
|
|
68
|
-
DeviceClasses["EZTarget"] = "EZ-Target";
|
|
77
|
+
DeviceClasses["Duplicate"] = "Duplicate";
|
|
69
78
|
DeviceClasses["BridgedPowerSourceInfo"] = "BridgedPowerSourceInfo";
|
|
70
79
|
})(DeviceClasses || (DeviceClasses = {}));
|
|
71
|
-
export const DeviceTypeDefinition = ({ name, code, deviceClass,
|
|
80
|
+
export const DeviceTypeDefinition = ({ name, code, deviceClass, revision, requiredServerClusters = [], optionalServerClusters = [], requiredClientClusters = [], optionalClientClusters = [], }) => ({
|
|
72
81
|
name,
|
|
73
82
|
code: DeviceTypeId(code),
|
|
74
83
|
deviceClass,
|
|
75
|
-
superSet,
|
|
76
84
|
revision,
|
|
77
85
|
requiredServerClusters,
|
|
78
86
|
optionalServerClusters,
|
|
79
87
|
requiredClientClusters,
|
|
80
88
|
optionalClientClusters,
|
|
81
|
-
unknown,
|
|
82
89
|
});
|
|
83
90
|
export const powerSource = DeviceTypeDefinition({
|
|
84
91
|
name: 'MA-powerSource',
|
|
@@ -161,7 +168,7 @@ export const dimmableOutlet = DeviceTypeDefinition({
|
|
|
161
168
|
optionalServerClusters: [],
|
|
162
169
|
});
|
|
163
170
|
export const onOffMountedSwitch = DeviceTypeDefinition({
|
|
164
|
-
name: 'MA-
|
|
171
|
+
name: 'MA-onoffmountedswitch',
|
|
165
172
|
code: 0x010f,
|
|
166
173
|
deviceClass: DeviceClasses.Simple,
|
|
167
174
|
revision: 1,
|
|
@@ -169,7 +176,7 @@ export const onOffMountedSwitch = DeviceTypeDefinition({
|
|
|
169
176
|
optionalServerClusters: [LevelControl.Cluster.id],
|
|
170
177
|
});
|
|
171
178
|
export const dimmableMountedSwitch = DeviceTypeDefinition({
|
|
172
|
-
name: 'MA-
|
|
179
|
+
name: 'MA-dimmablemountedswitch',
|
|
173
180
|
code: 0x0110,
|
|
174
181
|
deviceClass: DeviceClasses.Simple,
|
|
175
182
|
revision: 1,
|
|
@@ -182,7 +189,7 @@ export const pumpDevice = DeviceTypeDefinition({
|
|
|
182
189
|
deviceClass: DeviceClasses.Simple,
|
|
183
190
|
revision: 3,
|
|
184
191
|
requiredServerClusters: [OnOff.Cluster.id, PumpConfigurationAndControl.Cluster.id, Identify.Cluster.id],
|
|
185
|
-
optionalServerClusters: [LevelControl.Cluster.id, Groups.Cluster.id,
|
|
192
|
+
optionalServerClusters: [LevelControl.Cluster.id, Groups.Cluster.id, TemperatureMeasurement.Cluster.id, PressureMeasurement.Cluster.id, FlowMeasurement.Cluster.id],
|
|
186
193
|
});
|
|
187
194
|
export const waterValve = DeviceTypeDefinition({
|
|
188
195
|
name: 'MA-waterValve',
|
|
@@ -198,7 +205,7 @@ export const onOffSwitch = DeviceTypeDefinition({
|
|
|
198
205
|
deviceClass: DeviceClasses.Simple,
|
|
199
206
|
revision: 3,
|
|
200
207
|
requiredServerClusters: [Identify.Cluster.id, OnOff.Cluster.id],
|
|
201
|
-
optionalServerClusters: [Groups.Cluster.id
|
|
208
|
+
optionalServerClusters: [Groups.Cluster.id],
|
|
202
209
|
});
|
|
203
210
|
export const dimmableSwitch = DeviceTypeDefinition({
|
|
204
211
|
name: 'MA-dimmableswitch',
|
|
@@ -206,7 +213,7 @@ export const dimmableSwitch = DeviceTypeDefinition({
|
|
|
206
213
|
deviceClass: DeviceClasses.Simple,
|
|
207
214
|
revision: 3,
|
|
208
215
|
requiredServerClusters: [Identify.Cluster.id, OnOff.Cluster.id, LevelControl.Cluster.id],
|
|
209
|
-
optionalServerClusters: [Groups.Cluster.id
|
|
216
|
+
optionalServerClusters: [Groups.Cluster.id],
|
|
210
217
|
});
|
|
211
218
|
export const colorTemperatureSwitch = DeviceTypeDefinition({
|
|
212
219
|
name: 'MA-colortemperatureswitch',
|
|
@@ -214,7 +221,7 @@ export const colorTemperatureSwitch = DeviceTypeDefinition({
|
|
|
214
221
|
deviceClass: DeviceClasses.Simple,
|
|
215
222
|
revision: 3,
|
|
216
223
|
requiredServerClusters: [Identify.Cluster.id, Groups.Cluster.id, OnOff.Cluster.id, LevelControl.Cluster.id, ColorControl.Cluster.id],
|
|
217
|
-
optionalServerClusters: [Groups.Cluster.id
|
|
224
|
+
optionalServerClusters: [Groups.Cluster.id],
|
|
218
225
|
});
|
|
219
226
|
export const genericSwitch = DeviceTypeDefinition({
|
|
220
227
|
name: 'MA-genericswitch',
|
|
@@ -333,7 +340,7 @@ export const doorLockDevice = DeviceTypeDefinition({
|
|
|
333
340
|
code: 0xa,
|
|
334
341
|
deviceClass: DeviceClasses.Simple,
|
|
335
342
|
revision: 3,
|
|
336
|
-
requiredServerClusters: [Identify.Cluster.id, DoorLock.Cluster.id
|
|
343
|
+
requiredServerClusters: [Identify.Cluster.id, DoorLock.Cluster.id],
|
|
337
344
|
optionalServerClusters: [],
|
|
338
345
|
});
|
|
339
346
|
export const coverDevice = DeviceTypeDefinition({
|
|
@@ -375,7 +382,7 @@ export const modeSelect = DeviceTypeDefinition({
|
|
|
375
382
|
revision: 1,
|
|
376
383
|
requiredServerClusters: [ModeSelect.Cluster.id],
|
|
377
384
|
});
|
|
378
|
-
export const
|
|
385
|
+
export const aggregator = DeviceTypeDefinition({
|
|
379
386
|
name: 'MA-aggregator',
|
|
380
387
|
code: 0x000e,
|
|
381
388
|
deviceClass: DeviceClasses.Dynamic,
|
|
@@ -383,7 +390,7 @@ export const bridge = DeviceTypeDefinition({
|
|
|
383
390
|
requiredServerClusters: [],
|
|
384
391
|
optionalServerClusters: [Actions.Cluster.id, Identify.Cluster.id, CommissionerControl.Cluster.id],
|
|
385
392
|
});
|
|
386
|
-
export const
|
|
393
|
+
export const bridge = aggregator;
|
|
387
394
|
export const roboticVacuumCleaner = DeviceTypeDefinition({
|
|
388
395
|
name: 'MA-roboticvacuumcleaner',
|
|
389
396
|
code: 0x74,
|
|
@@ -392,11 +399,105 @@ export const roboticVacuumCleaner = DeviceTypeDefinition({
|
|
|
392
399
|
requiredServerClusters: [Identify.Cluster.id, RvcRunMode.Cluster.id, RvcOperationalState.Cluster.id],
|
|
393
400
|
optionalServerClusters: [RvcCleanMode.Cluster.id, ServiceArea.Cluster.id],
|
|
394
401
|
});
|
|
402
|
+
export const laundryWasher = DeviceTypeDefinition({
|
|
403
|
+
name: 'MA-laundrywasher',
|
|
404
|
+
code: 0x73,
|
|
405
|
+
deviceClass: DeviceClasses.Simple,
|
|
406
|
+
revision: 1,
|
|
407
|
+
requiredServerClusters: [OperationalState.Cluster.id],
|
|
408
|
+
optionalServerClusters: [Identify.Cluster.id, LaundryWasherMode.Cluster.id, OnOff.Cluster.id, LaundryWasherControls.Cluster.id, TemperatureControl.Cluster.id],
|
|
409
|
+
});
|
|
410
|
+
export const refrigerator = DeviceTypeDefinition({
|
|
411
|
+
name: 'MA-refrigerator',
|
|
412
|
+
code: 0x70,
|
|
413
|
+
deviceClass: DeviceClasses.Simple,
|
|
414
|
+
revision: 2,
|
|
415
|
+
requiredServerClusters: [Identify.Cluster.id, RefrigeratorAndTemperatureControlledCabinetMode.Cluster.id, RefrigeratorAlarm.Cluster.id],
|
|
416
|
+
optionalServerClusters: [],
|
|
417
|
+
});
|
|
395
418
|
export const airConditioner = DeviceTypeDefinition({
|
|
396
419
|
name: 'MA-airConditioner',
|
|
397
420
|
code: 0x72,
|
|
398
421
|
deviceClass: DeviceClasses.Simple,
|
|
399
422
|
revision: 2,
|
|
400
423
|
requiredServerClusters: [Identify.Cluster.id, OnOff.Cluster.id, Thermostat.Cluster.id],
|
|
401
|
-
optionalServerClusters: [
|
|
424
|
+
optionalServerClusters: [
|
|
425
|
+
Groups.Cluster.id,
|
|
426
|
+
FanControl.Cluster.id,
|
|
427
|
+
ThermostatUserInterfaceConfiguration.Cluster.id,
|
|
428
|
+
TemperatureMeasurement.Cluster.id,
|
|
429
|
+
RelativeHumidityMeasurement.Cluster.id,
|
|
430
|
+
],
|
|
431
|
+
});
|
|
432
|
+
export const temperatureControlledCabinetCooler = DeviceTypeDefinition({
|
|
433
|
+
name: 'MA-temperaturecontrolledcabinetcooler',
|
|
434
|
+
code: 0x71,
|
|
435
|
+
deviceClass: DeviceClasses.Simple,
|
|
436
|
+
revision: 3,
|
|
437
|
+
requiredServerClusters: [TemperatureControl.Cluster.id, RefrigeratorAndTemperatureControlledCabinetMode.Cluster.id],
|
|
438
|
+
optionalServerClusters: [TemperatureMeasurement.Cluster.id],
|
|
439
|
+
});
|
|
440
|
+
export const temperatureControlledCabinetHeater = DeviceTypeDefinition({
|
|
441
|
+
name: 'MA-temperaturecontrolledcabinetheater',
|
|
442
|
+
code: 0x71,
|
|
443
|
+
deviceClass: DeviceClasses.Simple,
|
|
444
|
+
revision: 3,
|
|
445
|
+
requiredServerClusters: [TemperatureControl.Cluster.id, OvenMode.Cluster.id, OvenCavityOperationalState.Cluster.id],
|
|
446
|
+
optionalServerClusters: [TemperatureMeasurement.Cluster.id],
|
|
447
|
+
});
|
|
448
|
+
export const dishwasher = DeviceTypeDefinition({
|
|
449
|
+
name: 'MA-dishwasher',
|
|
450
|
+
code: 0x75,
|
|
451
|
+
deviceClass: DeviceClasses.Simple,
|
|
452
|
+
revision: 1,
|
|
453
|
+
requiredServerClusters: [OperationalState.Cluster.id],
|
|
454
|
+
optionalServerClusters: [Identify.Cluster.id, OnOff.Cluster.id, TemperatureControl.Cluster.id, DishwasherMode.Cluster.id, DishwasherAlarm.Cluster.id],
|
|
455
|
+
});
|
|
456
|
+
export const laundryDryer = DeviceTypeDefinition({
|
|
457
|
+
name: 'MA-laundrydryer',
|
|
458
|
+
code: 0x7c,
|
|
459
|
+
deviceClass: DeviceClasses.Simple,
|
|
460
|
+
revision: 1,
|
|
461
|
+
requiredServerClusters: [OperationalState.Cluster.id],
|
|
462
|
+
optionalServerClusters: [Identify.Cluster.id, LaundryWasherMode.Cluster.id, OnOff.Cluster.id, LaundryDryerControls.Cluster.id, TemperatureControl.Cluster.id],
|
|
463
|
+
});
|
|
464
|
+
export const cookSurface = DeviceTypeDefinition({
|
|
465
|
+
name: 'MA-cooksurface',
|
|
466
|
+
code: 0x77,
|
|
467
|
+
deviceClass: DeviceClasses.Simple,
|
|
468
|
+
revision: 1,
|
|
469
|
+
requiredServerClusters: [TemperatureControl.Cluster.id, TemperatureMeasurement.Cluster.id],
|
|
470
|
+
optionalServerClusters: [OnOff.Cluster.id],
|
|
471
|
+
});
|
|
472
|
+
export const cooktop = DeviceTypeDefinition({
|
|
473
|
+
name: 'MA-cooktop',
|
|
474
|
+
code: 0x78,
|
|
475
|
+
deviceClass: DeviceClasses.Simple,
|
|
476
|
+
revision: 1,
|
|
477
|
+
requiredServerClusters: [OnOff.Cluster.id],
|
|
478
|
+
optionalServerClusters: [Identify.Cluster.id],
|
|
479
|
+
});
|
|
480
|
+
export const oven = DeviceTypeDefinition({
|
|
481
|
+
name: 'MA-oven',
|
|
482
|
+
code: 0x7b,
|
|
483
|
+
deviceClass: DeviceClasses.Simple,
|
|
484
|
+
revision: 2,
|
|
485
|
+
requiredServerClusters: [Identify.Cluster.id],
|
|
486
|
+
optionalServerClusters: [],
|
|
487
|
+
});
|
|
488
|
+
export const extractorHood = DeviceTypeDefinition({
|
|
489
|
+
name: 'MA-extractorhood',
|
|
490
|
+
code: 0x7a,
|
|
491
|
+
deviceClass: DeviceClasses.Simple,
|
|
492
|
+
revision: 1,
|
|
493
|
+
requiredServerClusters: [FanControl.Cluster.id],
|
|
494
|
+
optionalServerClusters: [Identify.Cluster.id, HepaFilterMonitoring.Cluster.id, ActivatedCarbonFilterMonitoring.Cluster.id],
|
|
495
|
+
});
|
|
496
|
+
export const microwaveOven = DeviceTypeDefinition({
|
|
497
|
+
name: 'MA-microwaveoven',
|
|
498
|
+
code: 0x79,
|
|
499
|
+
deviceClass: DeviceClasses.Simple,
|
|
500
|
+
revision: 1,
|
|
501
|
+
requiredServerClusters: [OperationalState.Cluster.id, MicrowaveOvenMode.Cluster.id, MicrowaveOvenControl.Cluster.id],
|
|
502
|
+
optionalServerClusters: [Identify.Cluster.id, FanControl.Cluster.id],
|
|
402
503
|
});
|