matterbridge 3.4.1-dev-20251126-9e86094 → 3.4.1-dev-20251128-441f8db
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 +115 -113
- package/README-DEV.md +22 -6
- package/README-DOCKER.md +1 -1
- package/README-MACOS-PLIST.md +1 -1
- package/README-NGINX.md +1 -1
- package/README-PODMAN.md +1 -1
- package/README-SERVICE-LOCAL.md +1 -1
- package/README-SERVICE-OPT.md +6 -1
- package/README-SERVICE.md +1 -1
- package/README.md +59 -49
- package/dist/broadcastServer.js +15 -4
- package/dist/frontend.js +5 -1
- package/dist/jestutils/jestHelpers.js +49 -0
- package/dist/matterbridge.js +46 -1
- package/dist/matterbridgePlatform.js +1 -21
- package/dist/pluginManager.js +24 -0
- package/dist/shelly.js +12 -12
- package/dist/update.js +69 -53
- package/frontend/build/assets/index.css +1 -1
- package/frontend/build/assets/index.js +1 -1
- package/marked.ps1 +15 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/README-DEV.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# <img src="
|
|
1
|
+
# <img src="https://matterbridge.io/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px"> Matterbridge development
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/matterbridge)
|
|
4
4
|
[](https://www.npmjs.com/package/matterbridge)
|
|
@@ -22,7 +22,7 @@ The easiest way is to clone the [Matterbridge Plugin Template](https://github.co
|
|
|
22
22
|
|
|
23
23
|
After you clone it locally, change the name (keep always matterbridge- at the beginning of the name), version, description, author, homepage, repository, bugs and funding in the package.json.
|
|
24
24
|
|
|
25
|
-
It is also possible to add two custom properties to the package.json: **help** and **changelog** with a url that will be used in the frontend instead of the default (/blob/main/README
|
|
25
|
+
It is also possible to add two custom properties to the package.json: **help** and **changelog** with a url that will be used in the frontend instead of the default (/blob/main/README and /blob/main/CHANGELOG).
|
|
26
26
|
|
|
27
27
|
Add your plugin logic in module.ts.
|
|
28
28
|
|
|
@@ -251,9 +251,25 @@ It is called when the plugin config has been updated.
|
|
|
251
251
|
|
|
252
252
|
Retrieves the devices registered with the platform.
|
|
253
253
|
|
|
254
|
+
### getDeviceByName(deviceName: string): MatterbridgeEndpoint | undefined
|
|
255
|
+
|
|
256
|
+
### getDeviceByUniqueId(uniqueId: string): MatterbridgeEndpoint | undefined
|
|
257
|
+
|
|
258
|
+
### getDeviceBySerialNumber(serialNumber: string): MatterbridgeEndpoint | undefined
|
|
259
|
+
|
|
260
|
+
### getDeviceById(id: string): MatterbridgeEndpoint | undefined
|
|
261
|
+
|
|
262
|
+
### getDeviceByOriginalId(originalId: string): MatterbridgeEndpoint | undefined
|
|
263
|
+
|
|
264
|
+
### getDeviceByNumber(number: EndpointNumber | number): MatterbridgeEndpoint | undefined
|
|
265
|
+
|
|
266
|
+
They all return MatterbridgeEndpoint or undefined if not found.
|
|
267
|
+
|
|
254
268
|
### hasDeviceName(deviceName: string): boolean
|
|
255
269
|
|
|
256
|
-
|
|
270
|
+
### hasDeviceUniqueId(deviceUniqueId: string): boolean
|
|
271
|
+
|
|
272
|
+
Checks if a device with this name or uniqueId is already registered in the platform.
|
|
257
273
|
|
|
258
274
|
### async registerDevice(device: MatterbridgeEndpoint)
|
|
259
275
|
|
|
@@ -288,7 +304,7 @@ You create a Matter device with a new instance of MatterbridgeEndpoint(definitio
|
|
|
288
304
|
|
|
289
305
|
In the above example we create a contact sensor device type with also a power source device type feature replaceble battery.
|
|
290
306
|
|
|
291
|
-
All device types are defined in src\matterbridgeDeviceTypes.ts and taken from the 'Matter-1.4.
|
|
307
|
+
All device types are defined in src\matterbridgeDeviceTypes.ts and taken from the 'Matter-1.4.2-Device-Library-Specification.pdf'.
|
|
292
308
|
|
|
293
309
|
All default cluster helpers are available as methods of MatterbridgeEndpoint.
|
|
294
310
|
|
|
@@ -388,7 +404,7 @@ const heatPump = new HeatPump('Heat Pump', 'HP1234567890');
|
|
|
388
404
|
|
|
389
405
|
## Plugin config file
|
|
390
406
|
|
|
391
|
-
Each plugin has a minimal default config file injected by Matterbridge when it is loaded:
|
|
407
|
+
Each plugin has a minimal default config file injected by Matterbridge when it is loaded and the plugin doesn't have its own default one:
|
|
392
408
|
|
|
393
409
|
```typescript
|
|
394
410
|
{
|
|
@@ -408,7 +424,7 @@ In all subsequent loads the config file is loaded from the '.matterbridge' direc
|
|
|
408
424
|
|
|
409
425
|
## Plugin schema file
|
|
410
426
|
|
|
411
|
-
Each plugin has a minimal default schema file injected by Matterbridge when it is loaded:
|
|
427
|
+
Each plugin has a minimal default schema file injected by Matterbridge when it is loaded and the plugin doesn't have its own default one:
|
|
412
428
|
|
|
413
429
|
```typescript
|
|
414
430
|
{
|
package/README-DOCKER.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# <img src="
|
|
1
|
+
# <img src="https://matterbridge.io/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px"> Matterbridge docker configuration
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/matterbridge)
|
|
4
4
|
[](https://www.npmjs.com/package/matterbridge)
|
package/README-MACOS-PLIST.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# <img src="
|
|
1
|
+
# <img src="https://matterbridge.io/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px"> Matterbridge launchctl configuration (macOS)
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/matterbridge)
|
|
4
4
|
[](https://www.npmjs.com/package/matterbridge)
|
package/README-NGINX.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# <img src="
|
|
1
|
+
# <img src="https://matterbridge.io/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px"> Matterbridge NGINX configuration
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/matterbridge)
|
|
4
4
|
[](https://www.npmjs.com/package/matterbridge)
|
package/README-PODMAN.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# <img src="
|
|
1
|
+
# <img src="https://matterbridge.io/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px"> Matterbridge Podman configuration
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/matterbridge)
|
|
4
4
|
[](https://www.npmjs.com/package/matterbridge)
|
package/README-SERVICE-LOCAL.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# <img src="
|
|
1
|
+
# <img src="https://matterbridge.io/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px"> Matterbridge systemd configuration with local global node_modules
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/matterbridge)
|
|
4
4
|
[](https://www.npmjs.com/package/matterbridge)
|
package/README-SERVICE-OPT.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# <img src="
|
|
1
|
+
# <img src="https://matterbridge.io/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px"> Matterbridge systemd configuration with private global node_modules
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/matterbridge)
|
|
4
4
|
[](https://www.npmjs.com/package/matterbridge)
|
|
@@ -22,8 +22,12 @@ The advantage of this setup is that the global node_modules are private for matt
|
|
|
22
22
|
|
|
23
23
|
The service runs with group and user matterbridge and the system has full protection.
|
|
24
24
|
|
|
25
|
+
### Important
|
|
26
|
+
|
|
25
27
|
The storage position is **not compatible** with the traditional setup (~/Matterbridge ~/.matterbridge ~/.mattercert).
|
|
26
28
|
|
|
29
|
+
Also various script don't work if you choose this configuration.
|
|
30
|
+
|
|
27
31
|
### 1 - Create the matterbridge user and group
|
|
28
32
|
|
|
29
33
|
```bash
|
|
@@ -72,6 +76,7 @@ matterbridge --version
|
|
|
72
76
|
The storage position is **not compatible** with the traditional setup (~/Matterbridge ~/.matterbridge ~/.mattercert).
|
|
73
77
|
|
|
74
78
|
If you are migrating from the traditional service setup, before removing the old diretories, you may want to copy the contents of ~/Matterbridge ~/.matterbridge ~/.mattercert to the new directories /opt/matterbridge/Matterbridge /opt/matterbridge/.matterbridge /opt/matterbridge/.mattercert.
|
|
79
|
+
This will save all the plugin configs and the fabrics but you need to remove all plugins and readd them cause the path will be different.
|
|
75
80
|
|
|
76
81
|
Copy the old diretories content
|
|
77
82
|
|
package/README-SERVICE.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# <img src="
|
|
1
|
+
# <img src="https://matterbridge.io/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px"> Matterbridge systemd configuration
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/matterbridge)
|
|
4
4
|
[](https://www.npmjs.com/package/matterbridge)
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# <img src="
|
|
1
|
+
# <img src="https://matterbridge.io/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px"> Matterbridge
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/matterbridge)
|
|
4
4
|
[](https://www.npmjs.com/package/matterbridge)
|
|
@@ -36,26 +36,28 @@ Matterbridge is lightweight and also runs on slow Linux machines with as little
|
|
|
36
36
|
|
|
37
37
|
It runs perfectly on Linux, macOS and Windows.
|
|
38
38
|
|
|
39
|
-
If you like this project and find it useful, please consider giving it a star on GitHub
|
|
39
|
+
If you like this project and find it useful, please consider giving it a star on [GitHub](https://github.com/Luligu/matterbridge) and sponsoring it.
|
|
40
40
|
|
|
41
41
|
<a href="https://www.buymeacoffee.com/luligugithub">
|
|
42
|
-
<img src="bmc-button.svg" alt="Buy me a coffee" width="120">
|
|
42
|
+
<img src="https://matterbridge.io/bmc-button.svg" alt="Buy me a coffee" width="120">
|
|
43
43
|
</a>
|
|
44
44
|
|
|
45
45
|
## Acknowledgements
|
|
46
46
|
|
|
47
|
-
The project is build on top of https://github.com/project-chip/matter.js.
|
|
47
|
+
The project is build on top of [matter.js](https://github.com/project-chip/matter.js).
|
|
48
48
|
|
|
49
49
|
A special thanks to Apollon77 for his incredible work.
|
|
50
50
|
|
|
51
51
|
## Discord
|
|
52
52
|
|
|
53
|
-
Join us in the Matterbridge Discord group
|
|
53
|
+
Join us in the Matterbridge [Discord group](https://discord.gg/QX58CDe6hd) created by [Tamer](https://github.com/tammeryousef1006).
|
|
54
54
|
|
|
55
55
|
## Videos
|
|
56
56
|
|
|
57
57
|
https://www.youtube.com/watch?v=goNB9Cgh_Fk
|
|
58
58
|
|
|
59
|
+
https://www.youtube.com/watch?v=06zzl7o_IqQ
|
|
60
|
+
|
|
59
61
|
## Reviews
|
|
60
62
|
|
|
61
63
|
https://www.matteralpha.com/how-to/how-to-configure-an-open-source-matter-bridge-at-home
|
|
@@ -75,7 +77,7 @@ The supported versions of node are 20 and 22. Please install Node.js 22 LTS. Don
|
|
|
75
77
|
Node.js 23, like all odd-numbered versions, is not supported.
|
|
76
78
|
Nvm is not a good choice and should not be used for production.
|
|
77
79
|
|
|
78
|
-
If you don't have Docker already install, please use this method to install it on a debian device: https://docs.docker.com/
|
|
80
|
+
If you don't have Docker already install, please use this method to install it on a debian device: https://docs.docker.com/engine/install.
|
|
79
81
|
After follow the guidelines for the [Docker configurations](README-DOCKER.md).
|
|
80
82
|
|
|
81
83
|
I suggest using Docker for its simplicity.
|
|
@@ -108,7 +110,7 @@ Test the installation with:
|
|
|
108
110
|
matterbridge
|
|
109
111
|
```
|
|
110
112
|
|
|
111
|
-
Now it is possible to open the frontend at the link provided in the log (e.g. http://MATTERBRIDGE-IPV4-ADDRESS:8283).
|
|
113
|
+
Now it is possible to open the frontend at the link provided in the log (e.g. `http://MATTERBRIDGE-IPV4-ADDRESS:8283`).
|
|
112
114
|
|
|
113
115
|
You can then change the bridge mode and other parameters from the frontend.
|
|
114
116
|
|
|
@@ -117,7 +119,7 @@ You can then change the bridge mode and other parameters from the frontend.
|
|
|
117
119
|
### mode bridge
|
|
118
120
|
|
|
119
121
|
```bash
|
|
120
|
-
matterbridge
|
|
122
|
+
matterbridge --bridge
|
|
121
123
|
```
|
|
122
124
|
|
|
123
125
|
This force Matterbridge to load in bridge mode.
|
|
@@ -127,46 +129,50 @@ Matterbridge only exposes itself, and you have to pair it scanning the QR code s
|
|
|
127
129
|
### mode childbridge
|
|
128
130
|
|
|
129
131
|
```bash
|
|
130
|
-
matterbridge
|
|
132
|
+
matterbridge --childbridge
|
|
131
133
|
```
|
|
132
134
|
|
|
133
135
|
This force Matterbridge to load in childbridge mode.
|
|
134
136
|
|
|
135
137
|
Matterbridge exposes each registered plugins, and you have to pair each one by scanning the QR code shown in the frontend or in the console.
|
|
136
138
|
|
|
137
|
-
### Use matterbridge
|
|
139
|
+
### Use matterbridge --help to see the command line syntax
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
matterbridge --help
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Use matterbridge --version to see the current version
|
|
138
146
|
|
|
139
147
|
```bash
|
|
140
|
-
matterbridge
|
|
148
|
+
matterbridge --version
|
|
141
149
|
```
|
|
142
150
|
|
|
143
151
|
## Frontend
|
|
144
152
|
|
|
145
|
-
Matterbridge has a frontend available on http://MATTERBIDGE-IPV4-ADDRESS:8283 and http://[MATTERBIDGE-IPV6-ADDRESS]:8283
|
|
153
|
+
Matterbridge has a frontend available on IPv4 `http://localhost:8283` or `http://MATTERBIDGE-IPV4-ADDRESS:8283` and IPv6 `http://[::1]:8283` or `http://[MATTERBIDGE-IPV6-ADDRESS]:8283`.
|
|
146
154
|
|
|
147
155
|
You can change the default port by adding the frontend parameter when you run it.
|
|
148
156
|
|
|
149
157
|
Here's how to specify a different port number:
|
|
150
158
|
|
|
151
159
|
```bash
|
|
152
|
-
matterbridge
|
|
160
|
+
matterbridge --frontend [port number]
|
|
153
161
|
```
|
|
154
162
|
|
|
155
163
|
To use the frontend with ssl see below.
|
|
156
164
|
|
|
157
165
|
From the frontend you can do all operations in an easy way.
|
|
158
166
|
|
|
159
|
-
Home page
|
|
160
|
-
|
|
167
|
+
Home page
|
|
168
|
+
|
|
169
|
+

|
|
161
170
|
|
|
162
|
-
Devices page
|
|
163
|
-
[See the screenshot here](screenshot/Screenshot%20devices.jpg)
|
|
171
|
+
[Devices page](./screenshot/Screenshot%20devices.jpg)
|
|
164
172
|
|
|
165
|
-
Logs page
|
|
166
|
-
[See the screenshot here](screenshot/Screenshot%20logs.jpg)
|
|
173
|
+
[Logs page](./screenshot/Screenshot%20logs.jpg)
|
|
167
174
|
|
|
168
|
-
Config editor
|
|
169
|
-
[See the screenshot here](screenshot/Screenshot%20config%20editor.jpg)
|
|
175
|
+
[Config editor](./screenshot/Screenshot%20config%20editor.jpg)
|
|
170
176
|
|
|
171
177
|
## Advanced configurations
|
|
172
178
|
|
|
@@ -180,6 +186,10 @@ or with local global node_modules (no sudo required)
|
|
|
180
186
|
|
|
181
187
|
[Service configurations with local global node_modules](README-SERVICE-LOCAL.md)
|
|
182
188
|
|
|
189
|
+
or with user matterbridge and with private global node_modules (no sudo required)
|
|
190
|
+
|
|
191
|
+
[Service configurations with user matterbridge and private global node_modules](README-SERVICE-OPT.md)
|
|
192
|
+
|
|
183
193
|
### Run matterbridge as a system service with launchctl (macOS only)
|
|
184
194
|
|
|
185
195
|
[Launchctl configurations](README-MACOS-PLIST.md)
|
|
@@ -213,7 +223,7 @@ The other Home Assistant Community Add-ons and plugins are not verified to work
|
|
|
213
223
|
### Shelly
|
|
214
224
|
|
|
215
225
|
<a href="https://github.com/Luligu/matterbridge-shelly">
|
|
216
|
-
<img src="screenshot/Shelly.svg" alt="Shelly plugin logo" width="100" />
|
|
226
|
+
<img src="./screenshot/Shelly.svg" alt="Shelly plugin logo" width="100" />
|
|
217
227
|
</a>
|
|
218
228
|
|
|
219
229
|
Matterbridge shelly plugin allows you to expose all Shelly Gen 1, Gen 2, Gen 3 and Gen 4 and BLU devices to Matter.
|
|
@@ -242,7 +252,7 @@ Features:
|
|
|
242
252
|
### Zigbee2MQTT
|
|
243
253
|
|
|
244
254
|
<a href="https://github.com/Luligu/matterbridge-zigbee2mqtt">
|
|
245
|
-
<img src="screenshot/Zigbee2MQTT.svg" alt="Zigbee2MQTT plugin logo" width="100" />
|
|
255
|
+
<img src="./screenshot/Zigbee2MQTT.svg" alt="Zigbee2MQTT plugin logo" width="100" />
|
|
246
256
|
</a>
|
|
247
257
|
|
|
248
258
|
Matterbridge zigbee2mqtt is a matterbridge production-level plugin that expose all zigbee2mqtt devices and groups to Matter.
|
|
@@ -252,7 +262,7 @@ No hub or dedicated hardware needed.
|
|
|
252
262
|
### Somfy tahoma
|
|
253
263
|
|
|
254
264
|
<a href="https://github.com/Luligu/matterbridge-somfy-tahoma">
|
|
255
|
-
<img src="screenshot/Somfy.svg" alt="Somfy plugin logo" width="100" />
|
|
265
|
+
<img src="./screenshot/Somfy.svg" alt="Somfy plugin logo" width="100" />
|
|
256
266
|
</a>
|
|
257
267
|
|
|
258
268
|
Matterbridge Somfy Tahoma is a matterbridge production-level plugin that expose the Somfy Tahoma screen devices to Matter.
|
|
@@ -260,17 +270,17 @@ Matterbridge Somfy Tahoma is a matterbridge production-level plugin that expose
|
|
|
260
270
|
### Home Assistant
|
|
261
271
|
|
|
262
272
|
<a href="https://github.com/Luligu/matterbridge-hass">
|
|
263
|
-
<img src="screenshot/HomeAssistant.svg" alt="Hass logo" width="100" />
|
|
273
|
+
<img src="./screenshot/HomeAssistant.svg" alt="Hass logo" width="100" />
|
|
264
274
|
</a>
|
|
265
275
|
|
|
266
276
|
Matterbridge Home Assistant plugin allows you to expose the Home Assistant devices and entities to Matter.
|
|
267
277
|
|
|
268
|
-
It is the ideal companion of the official [Matterbridge Home Assistant Add-on](https://github.com/Luligu/matterbridge-home-assistant-addon
|
|
278
|
+
It is the ideal companion of the official [Matterbridge Home Assistant Add-on](https://github.com/Luligu/matterbridge-home-assistant-addon).
|
|
269
279
|
|
|
270
280
|
### Webhooks
|
|
271
281
|
|
|
272
282
|
<a href="https://github.com/Luligu/matterbridge-webhooks">
|
|
273
|
-
<img src="
|
|
283
|
+
<img src="https://matterbridge.io/matterbridge.svg" alt="Matterbridge logo" width="100" />
|
|
274
284
|
</a>
|
|
275
285
|
|
|
276
286
|
Matterbridge Webhooks plugin allows you to expose any webhooks to Matter.
|
|
@@ -278,7 +288,7 @@ Matterbridge Webhooks plugin allows you to expose any webhooks to Matter.
|
|
|
278
288
|
### BTHome
|
|
279
289
|
|
|
280
290
|
<a href="https://github.com/Luligu/matterbridge-webhooks">
|
|
281
|
-
<img src="
|
|
291
|
+
<img src="https://matterbridge.io/matterbridge.svg" alt="Matterbridge logo" width="100" />
|
|
282
292
|
</a>
|
|
283
293
|
|
|
284
294
|
Matterbridge BTHome allows you to expose any BTHome device to Matter using the native bluetooth of the host machine.
|
|
@@ -370,58 +380,58 @@ On windows:
|
|
|
370
380
|
|
|
371
381
|
```powershell
|
|
372
382
|
cd $HOME\Matterbridge
|
|
373
|
-
npm install -g matterbridge-zigbee2mqtt
|
|
374
|
-
matterbridge
|
|
383
|
+
npm install -g matterbridge-zigbee2mqtt --omit=dev
|
|
384
|
+
matterbridge --add matterbridge-zigbee2mqtt
|
|
375
385
|
```
|
|
376
386
|
|
|
377
387
|
On linux or macOS:
|
|
378
388
|
|
|
379
389
|
```bash
|
|
380
390
|
cd ~/Matterbridge
|
|
381
|
-
sudo npm install -g matterbridge-zigbee2mqtt
|
|
382
|
-
matterbridge
|
|
391
|
+
sudo npm install -g matterbridge-zigbee2mqtt --omit=dev
|
|
392
|
+
matterbridge --add matterbridge-zigbee2mqtt
|
|
383
393
|
```
|
|
384
394
|
|
|
385
395
|
## How to add a plugin to Matterbridge from a terminal
|
|
386
396
|
|
|
387
397
|
```bash
|
|
388
|
-
matterbridge
|
|
398
|
+
matterbridge --add [plugin path or plugin name]
|
|
389
399
|
```
|
|
390
400
|
|
|
391
401
|
## How to remove a plugin from Matterbridge from a terminal
|
|
392
402
|
|
|
393
403
|
```bash
|
|
394
|
-
matterbridge
|
|
404
|
+
matterbridge --remove [plugin path or plugin name]
|
|
395
405
|
```
|
|
396
406
|
|
|
397
407
|
## How to disable a registered plugin from a terminal
|
|
398
408
|
|
|
399
409
|
```bash
|
|
400
|
-
matterbridge
|
|
410
|
+
matterbridge --disable [plugin path or plugin name]
|
|
401
411
|
```
|
|
402
412
|
|
|
403
413
|
## How to enable a registered plugin from a terminal
|
|
404
414
|
|
|
405
415
|
```bash
|
|
406
|
-
matterbridge
|
|
416
|
+
matterbridge --enable [plugin path or plugin name]
|
|
407
417
|
```
|
|
408
418
|
|
|
409
419
|
## How to remove the commissioning information for Matterbridge so you can pair it again (bridge mode). Shutdown Matterbridge before!
|
|
410
420
|
|
|
411
421
|
```bash
|
|
412
|
-
matterbridge
|
|
422
|
+
matterbridge --reset
|
|
413
423
|
```
|
|
414
424
|
|
|
415
425
|
## How to remove the commissioning information for a registered plugin so you can pair it again (childbridge mode). Shutdown Matterbridge before!
|
|
416
426
|
|
|
417
427
|
```bash
|
|
418
|
-
matterbridge
|
|
428
|
+
matterbridge --reset [plugin path or plugin name]
|
|
419
429
|
```
|
|
420
430
|
|
|
421
431
|
## How to factory reset Matterbridge. Shutdown Matterbridge before!
|
|
422
432
|
|
|
423
433
|
```bash
|
|
424
|
-
matterbridge
|
|
434
|
+
matterbridge --factoryreset
|
|
425
435
|
```
|
|
426
436
|
|
|
427
437
|
This will reset the internal storages. All commissioning informations will be lost. All plugins will be unregistered.
|
|
@@ -438,7 +448,7 @@ Place your own certificates in the `.matterbridge/cert` directory:
|
|
|
438
448
|
- `key.pem`
|
|
439
449
|
- `ca.pem` (optional)
|
|
440
450
|
|
|
441
|
-

|
|
451
|
+

|
|
442
452
|
|
|
443
453
|
Matterbridge looks first for .p12 certificate and if it is not found it looks for cert.pem and key.pem.
|
|
444
454
|
|
|
@@ -453,27 +463,27 @@ Matterbridge looks first for .p12 certificate and if it is not found it looks fo
|
|
|
453
463
|
|
|
454
464
|
### Change the command line
|
|
455
465
|
|
|
456
|
-
Add the
|
|
466
|
+
Add the **--ssl** parameter to the command line.
|
|
457
467
|
|
|
458
468
|
If desired, you can also change the frontend port with **-frontend 443**.
|
|
459
469
|
|
|
460
470
|
```bash
|
|
461
|
-
matterbridge
|
|
471
|
+
matterbridge --ssl --frontend 443
|
|
462
472
|
```
|
|
463
473
|
|
|
464
|
-
Add the
|
|
474
|
+
Add the **--mtls** parameter to the command line if you want Matterbridge to request the client (your browser) to authenticate itself (this is the most secure connection possible).
|
|
465
475
|
|
|
466
476
|
The browser must provide the client certificate: on Windows you need to import it in Current User → Personal → Certificates with certmgr.msc.
|
|
467
477
|
|
|
468
478
|
```bash
|
|
469
|
-
matterbridge
|
|
479
|
+
matterbridge --ssl --mtls --frontend 443
|
|
470
480
|
```
|
|
471
481
|
|
|
472
482
|
### Restart
|
|
473
483
|
|
|
474
484
|
If the certificate are correctly configured, you will be able to connect with https to the frontend.
|
|
475
485
|
|
|
476
|
-

|
|
486
|
+

|
|
477
487
|
|
|
478
488
|
## How to send the debug log files
|
|
479
489
|
|
|
@@ -481,9 +491,9 @@ If the certificate are correctly configured, you will be able to connect with ht
|
|
|
481
491
|
|
|
482
492
|
In the frontend, go to settings and enable debug mode as shown below:
|
|
483
493
|
|
|
484
|
-

|
|
494
|
+

|
|
485
495
|
|
|
486
|
-

|
|
496
|
+

|
|
487
497
|
|
|
488
498
|
### Restart
|
|
489
499
|
|
|
@@ -491,7 +501,7 @@ Wait a few minutes to allow the logs to to accumulate.
|
|
|
491
501
|
|
|
492
502
|
Then, from the dots menu in the frontend, download the `matterbridge.log` and `matter.log` files.
|
|
493
503
|
|
|
494
|
-

|
|
504
|
+

|
|
495
505
|
|
|
496
506
|
Don't forget to unselect the debug mode when is no more needed. The network traffic and cpu usage is very high in debug mode.
|
|
497
507
|
|
|
@@ -586,7 +596,7 @@ On my side I sponsor the packages that I use in this project. It would be nice t
|
|
|
586
596
|
Click on the badge below to get started:
|
|
587
597
|
|
|
588
598
|
<a href="https://www.buymeacoffee.com/luligugithub">
|
|
589
|
-
<img src="bmc-button.svg" alt="Buy me a coffee" width="120">
|
|
599
|
+
<img src="https://matterbridge.io/bmc-button.svg" alt="Buy me a coffee" width="120">
|
|
590
600
|
</a>
|
|
591
601
|
|
|
592
602
|
Thank you for your support!
|
package/dist/broadcastServer.js
CHANGED
|
@@ -2,8 +2,9 @@ if (process.argv.includes('--loader') || process.argv.includes('-loader'))
|
|
|
2
2
|
console.log('\u001B[32mBroadcastServer loaded.\u001B[40;0m');
|
|
3
3
|
import { EventEmitter } from 'node:events';
|
|
4
4
|
import { BroadcastChannel } from 'node:worker_threads';
|
|
5
|
-
import { CYAN, db, debugStringify } from 'node-ansi-logger';
|
|
5
|
+
import { CYAN, db, debugStringify, er } from 'node-ansi-logger';
|
|
6
6
|
import { hasParameter } from './utils/commandLine.js';
|
|
7
|
+
import { logError } from './utils/error.js';
|
|
7
8
|
export class BroadcastServer extends EventEmitter {
|
|
8
9
|
name;
|
|
9
10
|
log;
|
|
@@ -56,7 +57,12 @@ export class BroadcastServer extends EventEmitter {
|
|
|
56
57
|
}
|
|
57
58
|
if (this.verbose)
|
|
58
59
|
this.log.debug(`Broadcasting request message: ${debugStringify(message)}`);
|
|
59
|
-
|
|
60
|
+
try {
|
|
61
|
+
this.broadcastChannel.postMessage(message);
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
logError(this.log, `Failed to broadcast request message ${debugStringify(message)}${er}`, error);
|
|
65
|
+
}
|
|
60
66
|
}
|
|
61
67
|
respond(message) {
|
|
62
68
|
if (message.timestamp === undefined) {
|
|
@@ -68,7 +74,12 @@ export class BroadcastServer extends EventEmitter {
|
|
|
68
74
|
}
|
|
69
75
|
if (this.verbose)
|
|
70
76
|
this.log.debug(`Broadcasting response message: ${debugStringify(message)}`);
|
|
71
|
-
|
|
77
|
+
try {
|
|
78
|
+
this.broadcastChannel.postMessage(message);
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
logError(this.log, `Failed to broadcast response message ${debugStringify(message)}${er}`, error);
|
|
82
|
+
}
|
|
72
83
|
}
|
|
73
84
|
async fetch(message, timeout = 250) {
|
|
74
85
|
if (message.id === undefined) {
|
|
@@ -97,7 +108,7 @@ export class BroadcastServer extends EventEmitter {
|
|
|
97
108
|
this.request(message);
|
|
98
109
|
const timeoutId = setTimeout(() => {
|
|
99
110
|
this.off('broadcast_message', responseHandler);
|
|
100
|
-
reject(new Error(`Fetch timeout after ${timeout}ms for message id ${message.id}`));
|
|
111
|
+
reject(new Error(`Fetch timeout after ${timeout}ms for message type ${message.type} id ${message.id} from ${message.src} to ${message.dst}`));
|
|
101
112
|
}, timeout);
|
|
102
113
|
});
|
|
103
114
|
}
|
package/dist/frontend.js
CHANGED
|
@@ -66,7 +66,7 @@ export class Frontend extends EventEmitter {
|
|
|
66
66
|
this.server.respond({ ...msg, response: { success: true } });
|
|
67
67
|
break;
|
|
68
68
|
case 'frontend_refreshrequired':
|
|
69
|
-
this.wssSendRefreshRequired(msg.params.changed, { matter: msg.params.matter });
|
|
69
|
+
this.wssSendRefreshRequired(msg.params.changed, msg.params.matter ? { matter: msg.params.matter } : undefined);
|
|
70
70
|
this.server.respond({ ...msg, response: { success: true } });
|
|
71
71
|
break;
|
|
72
72
|
case 'frontend_restartrequired':
|
|
@@ -93,6 +93,10 @@ export class Frontend extends EventEmitter {
|
|
|
93
93
|
this.wssSendLogMessage(msg.params.level, msg.params.time, msg.params.name, msg.params.message);
|
|
94
94
|
this.server.respond({ ...msg, response: { success: true } });
|
|
95
95
|
break;
|
|
96
|
+
case 'frontend_broadcast_message':
|
|
97
|
+
this.wssBroadcastMessage(msg.params.msg);
|
|
98
|
+
this.server.respond({ ...msg, response: { success: true } });
|
|
99
|
+
break;
|
|
96
100
|
default:
|
|
97
101
|
if (this.verbose)
|
|
98
102
|
this.log.debug(`Unknown broadcast request ${CYAN}${msg.type}${db} from ${CYAN}${msg.src}${db}`);
|
|
@@ -11,6 +11,9 @@ import { NodeStorageManager } from 'node-persist-manager';
|
|
|
11
11
|
import { Matterbridge } from '../matterbridge.js';
|
|
12
12
|
import { MATTER_STORAGE_NAME, NODE_STORAGE_DIR } from '../matterbridgeTypes.js';
|
|
13
13
|
import { bridge } from '../matterbridgeDeviceTypes.js';
|
|
14
|
+
import { PluginManager } from '../pluginManager.js';
|
|
15
|
+
import { Frontend } from '../frontend.js';
|
|
16
|
+
import { BroadcastServer } from '../broadcastServer.js';
|
|
14
17
|
export const originalProcessArgv = Object.freeze([...process.argv]);
|
|
15
18
|
export const originalProcessEnv = Object.freeze({ ...process.env });
|
|
16
19
|
export let loggerLogSpy;
|
|
@@ -28,6 +31,29 @@ export let consoleErrorSpy;
|
|
|
28
31
|
export let addBridgedEndpointSpy;
|
|
29
32
|
export let removeBridgedEndpointSpy;
|
|
30
33
|
export let removeAllBridgedEndpointsSpy;
|
|
34
|
+
export let addVirtualEndpointSpy;
|
|
35
|
+
export let installPluginSpy;
|
|
36
|
+
export let uninstallPluginSpy;
|
|
37
|
+
export let addPluginSpy;
|
|
38
|
+
export let loadPluginSpy;
|
|
39
|
+
export let startPluginSpy;
|
|
40
|
+
export let configurePluginSpy;
|
|
41
|
+
export let shutdownPluginSpy;
|
|
42
|
+
export let removePluginSpy;
|
|
43
|
+
export let enablePluginSpy;
|
|
44
|
+
export let disablePluginSpy;
|
|
45
|
+
export let wssSendSnackbarMessageSpy;
|
|
46
|
+
export let wssSendCloseSnackbarMessageSpy;
|
|
47
|
+
export let wssSendUpdateRequiredSpy;
|
|
48
|
+
export let wssSendRefreshRequiredSpy;
|
|
49
|
+
export let wssSendRestartRequiredSpy;
|
|
50
|
+
export let wssSendRestartNotRequiredSpy;
|
|
51
|
+
export let broadcastServerIsWorkerRequestSpy;
|
|
52
|
+
export let broadcastServerIsWorkerResponseSpy;
|
|
53
|
+
export let broadcastServerRequestSpy;
|
|
54
|
+
export let broadcastServerRespondSpy;
|
|
55
|
+
export let broadcastServerFetchSpy;
|
|
56
|
+
export let broadcastMessageHandlerSpy;
|
|
31
57
|
export let NAME;
|
|
32
58
|
export let HOMEDIR;
|
|
33
59
|
export let matterbridge;
|
|
@@ -71,6 +97,29 @@ export async function setupTest(name, debug = false) {
|
|
|
71
97
|
addBridgedEndpointSpy = jest.spyOn(Matterbridge.prototype, 'addBridgedEndpoint');
|
|
72
98
|
removeBridgedEndpointSpy = jest.spyOn(Matterbridge.prototype, 'removeBridgedEndpoint');
|
|
73
99
|
removeAllBridgedEndpointsSpy = jest.spyOn(Matterbridge.prototype, 'removeAllBridgedEndpoints');
|
|
100
|
+
addVirtualEndpointSpy = jest.spyOn(Matterbridge.prototype, 'addVirtualEndpoint');
|
|
101
|
+
installPluginSpy = jest.spyOn(PluginManager.prototype, 'install');
|
|
102
|
+
uninstallPluginSpy = jest.spyOn(PluginManager.prototype, 'uninstall');
|
|
103
|
+
addPluginSpy = jest.spyOn(PluginManager.prototype, 'add');
|
|
104
|
+
loadPluginSpy = jest.spyOn(PluginManager.prototype, 'load');
|
|
105
|
+
startPluginSpy = jest.spyOn(PluginManager.prototype, 'start');
|
|
106
|
+
configurePluginSpy = jest.spyOn(PluginManager.prototype, 'configure');
|
|
107
|
+
shutdownPluginSpy = jest.spyOn(PluginManager.prototype, 'shutdown');
|
|
108
|
+
removePluginSpy = jest.spyOn(PluginManager.prototype, 'remove');
|
|
109
|
+
enablePluginSpy = jest.spyOn(PluginManager.prototype, 'enable');
|
|
110
|
+
disablePluginSpy = jest.spyOn(PluginManager.prototype, 'disable');
|
|
111
|
+
wssSendSnackbarMessageSpy = jest.spyOn(Frontend.prototype, 'wssSendSnackbarMessage');
|
|
112
|
+
wssSendCloseSnackbarMessageSpy = jest.spyOn(Frontend.prototype, 'wssSendCloseSnackbarMessage');
|
|
113
|
+
wssSendUpdateRequiredSpy = jest.spyOn(Frontend.prototype, 'wssSendUpdateRequired');
|
|
114
|
+
wssSendRefreshRequiredSpy = jest.spyOn(Frontend.prototype, 'wssSendRefreshRequired');
|
|
115
|
+
wssSendRestartRequiredSpy = jest.spyOn(Frontend.prototype, 'wssSendRestartRequired');
|
|
116
|
+
wssSendRestartNotRequiredSpy = jest.spyOn(Frontend.prototype, 'wssSendRestartNotRequired');
|
|
117
|
+
broadcastServerIsWorkerRequestSpy = jest.spyOn(BroadcastServer.prototype, 'isWorkerRequest');
|
|
118
|
+
broadcastServerIsWorkerResponseSpy = jest.spyOn(BroadcastServer.prototype, 'isWorkerResponse');
|
|
119
|
+
broadcastServerRequestSpy = jest.spyOn(BroadcastServer.prototype, 'request');
|
|
120
|
+
broadcastServerRespondSpy = jest.spyOn(BroadcastServer.prototype, 'respond');
|
|
121
|
+
broadcastServerFetchSpy = jest.spyOn(BroadcastServer.prototype, 'fetch');
|
|
122
|
+
broadcastMessageHandlerSpy = jest.spyOn(BroadcastServer.prototype, 'broadcastMessageHandler');
|
|
74
123
|
}
|
|
75
124
|
export async function setDebug(debug) {
|
|
76
125
|
const { jest } = await import('@jest/globals');
|