matterbridge 1.2.10 → 1.2.11
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 +21 -1
- package/README.md +97 -4
- package/dist/matterbridge.d.ts +2 -0
- package/dist/matterbridge.d.ts.map +1 -1
- package/dist/matterbridge.js +35 -13
- package/dist/matterbridge.js.map +1 -1
- package/dist/matterbridgeDevice.d.ts +13 -14
- package/dist/matterbridgeDevice.d.ts.map +1 -1
- package/dist/matterbridgeDevice.js +81 -48
- package/dist/matterbridgeDevice.js.map +1 -1
- package/frontend/build/asset-manifest.json +6 -6
- package/frontend/build/index.html +1 -1
- package/frontend/build/static/css/main.1880392b.css +2 -0
- package/frontend/build/static/css/main.1880392b.css.map +1 -0
- package/frontend/build/static/js/{main.cf64bc64.js → main.60e6f24a.js} +3 -3
- package/frontend/build/static/js/main.60e6f24a.js.map +1 -0
- package/package.json +5 -1
- package/frontend/build/static/css/main.4c325919.css +0 -2
- package/frontend/build/static/css/main.4c325919.css.map +0 -1
- package/frontend/build/static/js/main.cf64bc64.js.map +0 -1
- /package/frontend/build/static/js/{main.cf64bc64.js.LICENSE.txt → main.60e6f24a.js.LICENSE.txt} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## [1.2.
|
|
5
|
+
## [1.2.11] - 2024-04-25
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- [matterbridge]: Added user to system information.
|
|
10
|
+
- [frontend]: Persist the filter selection (debug level and search criteria) in the Logs route.
|
|
11
|
+
- [frontend]: Added version and two badges for bridgeMode and restartMode.
|
|
12
|
+
- [frontend]: Frontend updated to 0.8.8.
|
|
13
|
+
- [docker]: Added support for docker (BETA). The Matterbridge image is published on the docker hub.
|
|
14
|
+
- [docker]: See the guidelines on https://github.com/Luligu/matterbridge?tab=readme-ov-file#Run-the-Docker-container-and-start-it.
|
|
15
|
+
- [docker compose]: See the guidelines on https://github.com/Luligu/matterbridge?tab=readme-ov-file#Run-with-docker-compose.
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- [matterbridge]: Fixed the case when a plugin throws errors.
|
|
20
|
+
|
|
21
|
+
### New plugin
|
|
22
|
+
|
|
23
|
+
- Matterbridge Somfy Tahoma https://github.com/Luligu/matterbridge-somfy-tahoma
|
|
24
|
+
|
|
25
|
+
## [1.2.10] - 2024-04-23
|
|
6
26
|
|
|
7
27
|
### Added
|
|
8
28
|
|
package/README.md
CHANGED
|
@@ -57,7 +57,7 @@ Test the installation with:
|
|
|
57
57
|
matterbridge -bridge
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
Now it is possible to open the frontend at the link provided (default: http://localhost:
|
|
60
|
+
Now it is possible to open the frontend at the link provided (default: http://localhost:8283)
|
|
61
61
|
|
|
62
62
|
## Usage
|
|
63
63
|
|
|
@@ -153,6 +153,14 @@ The Eve app only shows the history when the plugins run like an AccessoryPlatfor
|
|
|
153
153
|
|
|
154
154
|
[zigbee2mqtt](https://github.com/Luligu/matterbridge-zigbee2mqtt)
|
|
155
155
|
|
|
156
|
+
Matterbridge zigbee2mqtt is a matterbridge production-level plugin that expose all zigbee2mqtt devices and groups to Matter.
|
|
157
|
+
|
|
158
|
+
No hub or dedicated hardware needed.
|
|
159
|
+
|
|
160
|
+
[somy-tahoma](https://github.com/Luligu/matterbridge-somfy-tahoma)
|
|
161
|
+
|
|
162
|
+
Matterbridge Somfy Tahoma is a matterbridge production-level plugin that expose all Somfy Tahoma devices to Matter.
|
|
163
|
+
|
|
156
164
|
## How to install and register a production-level plugin (from npm)
|
|
157
165
|
|
|
158
166
|
To install i.e. https://github.com/Luligu/matterbridge-zigbee2mqtt
|
|
@@ -253,7 +261,7 @@ The easiest way is to clone:
|
|
|
253
261
|
|
|
254
262
|
- https://github.com/Luligu/matterbridge-example-dynamic-platform if you want to create a Dynamic Platform Plugin.
|
|
255
263
|
|
|
256
|
-
Then change the name, version, description and author in the package.json.
|
|
264
|
+
Then change the name (keep matterbridge- at the beginning of the name), version, description and author in the package.json.
|
|
257
265
|
|
|
258
266
|
Add your plugin logic in platform.ts.
|
|
259
267
|
|
|
@@ -309,7 +317,7 @@ Create a systemctl configuration file for Matterbridge
|
|
|
309
317
|
sudo nano /etc/systemd/system/matterbridge.service
|
|
310
318
|
```
|
|
311
319
|
|
|
312
|
-
Add the following to this file, replacing twice USER with your user name (e.g. pi):
|
|
320
|
+
Add the following to this file, replacing twice (!) USER with your user name (e.g. WorkingDirectory=/home/pi/Matterbridge and User=pi):
|
|
313
321
|
|
|
314
322
|
```
|
|
315
323
|
[Unit]
|
|
@@ -318,7 +326,7 @@ After=network-online.target
|
|
|
318
326
|
|
|
319
327
|
[Service]
|
|
320
328
|
Type=simple
|
|
321
|
-
ExecStart=/usr/bin/matterbridge -bridge -service
|
|
329
|
+
ExecStart=/usr/bin/matterbridge -bridge -service -port 5550
|
|
322
330
|
WorkingDirectory=/home/<USER>/Matterbridge
|
|
323
331
|
StandardOutput=inherit
|
|
324
332
|
StandardError=inherit
|
|
@@ -373,6 +381,91 @@ sudo systemctl enable matterbridge.service
|
|
|
373
381
|
sudo systemctl disable matterbridge.service
|
|
374
382
|
```
|
|
375
383
|
|
|
384
|
+
## Run matterbridge with docker (Linux only) BETA
|
|
385
|
+
|
|
386
|
+
The Matterbridge docker image is published on the docker hub.
|
|
387
|
+
|
|
388
|
+
### Run the Docker container and start it
|
|
389
|
+
The container has full access to the host network (needed for mdns).
|
|
390
|
+
|
|
391
|
+
The volume matterbridge_plugin connects to the internal Matterbridge plugin directory (Matterbridge).
|
|
392
|
+
|
|
393
|
+
The volume matterbridge_storage connects to the internal Matterbridge storage directory (.matterbridge).
|
|
394
|
+
|
|
395
|
+
```
|
|
396
|
+
docker volume create matterbridge_plugin
|
|
397
|
+
docker volume create matterbridge_storage
|
|
398
|
+
docker run --name matterbridge \
|
|
399
|
+
-v matterbridge_plugin:/root/Matterbridge \
|
|
400
|
+
-v matterbridge_storage:/root/.matterbridge \
|
|
401
|
+
--network host --restart always -d luligu/matterbridge:latest
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
### Run with docker compose
|
|
405
|
+
|
|
406
|
+
The docker-compose.yml file is available in the root of the package
|
|
407
|
+
|
|
408
|
+
```
|
|
409
|
+
services:
|
|
410
|
+
matterbridge:
|
|
411
|
+
container_name: matterbridge
|
|
412
|
+
image: luligu/matterbridge:latest # Matterbridge image with the latest tag
|
|
413
|
+
network_mode: host # Ensures the Matter mdns works
|
|
414
|
+
restart: always # Ensures the container always restarts automatically
|
|
415
|
+
volumes:
|
|
416
|
+
- plugin:/root/Matterbridge
|
|
417
|
+
- storage:/root/.matterbridge
|
|
418
|
+
|
|
419
|
+
volumes:
|
|
420
|
+
plugin:
|
|
421
|
+
storage:
|
|
422
|
+
```
|
|
423
|
+
Run with docker compose
|
|
424
|
+
|
|
425
|
+
```
|
|
426
|
+
docker compose up -d
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
### Stop with docker compose
|
|
430
|
+
```
|
|
431
|
+
docker compose down
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
### Start the Docker container
|
|
435
|
+
```
|
|
436
|
+
docker start matterbridge
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
### Stop the Docker container
|
|
440
|
+
```
|
|
441
|
+
docker stop matterbridge
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
### Restart the Docker container
|
|
445
|
+
```
|
|
446
|
+
docker restart matterbridge
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
### Shows the logs
|
|
450
|
+
```
|
|
451
|
+
docker logs matterbridge
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
### Shows the logs real time (tail)
|
|
455
|
+
```
|
|
456
|
+
docker logs --tail 1000 -f matterbridge
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
### Inspect the Matterbridge plugin volume
|
|
460
|
+
```
|
|
461
|
+
docker volume inspect matterbridge_plugin
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
### Inspect the Matterbridge storage volume
|
|
465
|
+
```
|
|
466
|
+
docker volume inspect matterbridge_storage
|
|
467
|
+
```
|
|
468
|
+
|
|
376
469
|
# Contribution Guidelines
|
|
377
470
|
|
|
378
471
|
Thank you for your interest in contributing to my project!
|
package/dist/matterbridge.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ interface SystemInformation {
|
|
|
32
32
|
ipv6Address: string;
|
|
33
33
|
nodeVersion: string;
|
|
34
34
|
hostname: string;
|
|
35
|
+
user: string;
|
|
35
36
|
osType: string;
|
|
36
37
|
osRelease: string;
|
|
37
38
|
osPlatform: string;
|
|
@@ -49,6 +50,7 @@ interface MatterbridgeInformation {
|
|
|
49
50
|
matterbridgeVersion: string;
|
|
50
51
|
matterbridgeLatestVersion: string;
|
|
51
52
|
bridgeMode: string;
|
|
53
|
+
restartMode: string;
|
|
52
54
|
debugEnabled: boolean;
|
|
53
55
|
}
|
|
54
56
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matterbridge.d.ts","sourceRoot":"","sources":["../src/matterbridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;AAEH,OAAO,EAAE,kBAAkB,EAAgC,MAAM,yBAAyB,CAAC;AAS3F,OAAO,YAAY,MAAM,QAAQ,CAAC;AA2ClC,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;AAEjG,MAAM,MAAM,cAAc,GAAG;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAAC;CACpC,CAAC;AA0CF,UAAU,iBAAiB;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAA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AIG;IACG,kBAAkB,CAAC,IAAI,GAAE,MAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAkY5D;;;;OAIG;IACH,OAAO,CAAC,wBAAwB;CAyBjC"}
|
package/dist/matterbridge.js
CHANGED
|
@@ -55,6 +55,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
55
55
|
ipv6Address: '',
|
|
56
56
|
nodeVersion: '',
|
|
57
57
|
hostname: '',
|
|
58
|
+
user: '',
|
|
58
59
|
osType: '',
|
|
59
60
|
osRelease: '',
|
|
60
61
|
osPlatform: '',
|
|
@@ -72,6 +73,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
72
73
|
matterbridgeVersion: '',
|
|
73
74
|
matterbridgeLatestVersion: '',
|
|
74
75
|
bridgeMode: '',
|
|
76
|
+
restartMode: '',
|
|
75
77
|
debugEnabled: false,
|
|
76
78
|
};
|
|
77
79
|
homeDirectory = '';
|
|
@@ -624,12 +626,17 @@ export class Matterbridge extends EventEmitter {
|
|
|
624
626
|
this.log.debug('All listeners removed');
|
|
625
627
|
// Calling the shutdown functions with a reason
|
|
626
628
|
for (const plugin of this.registeredPlugins) {
|
|
627
|
-
if (!plugin.enabled)
|
|
629
|
+
if (!plugin.enabled || plugin.error)
|
|
628
630
|
continue;
|
|
629
631
|
this.log.info(`*Shutting down plugin ${plg}${plugin.name}${nf}`);
|
|
630
632
|
if (plugin.platform) {
|
|
631
|
-
|
|
632
|
-
|
|
633
|
+
try {
|
|
634
|
+
await plugin.platform.onShutdown('Matterbridge is closing: ' + message);
|
|
635
|
+
await this.savePluginConfig(plugin);
|
|
636
|
+
}
|
|
637
|
+
catch (error) {
|
|
638
|
+
this.log.error(`Plugin ${plg}${plugin.name}${er} shutting down error: ${error}`);
|
|
639
|
+
}
|
|
633
640
|
}
|
|
634
641
|
else {
|
|
635
642
|
this.log.warn(`Plugin ${plg}${plugin.name}${wr} platform not found`);
|
|
@@ -1190,13 +1197,15 @@ export class Matterbridge extends EventEmitter {
|
|
|
1190
1197
|
return Promise.resolve();
|
|
1191
1198
|
})
|
|
1192
1199
|
.catch((err) => {
|
|
1200
|
+
plugin.error = true;
|
|
1193
1201
|
this.log.error(`Failed to start plugin ${plg}${plugin.name}${er}: ${err}`);
|
|
1194
|
-
return Promise.reject(new Error(`Failed to start plugin ${plg}${plugin.name}${er}: ${err}`));
|
|
1202
|
+
// return Promise.reject(new Error(`Failed to start plugin ${plg}${plugin.name}${er}: ${err}`));
|
|
1195
1203
|
});
|
|
1196
1204
|
}
|
|
1197
1205
|
catch (err) {
|
|
1206
|
+
plugin.error = true;
|
|
1198
1207
|
this.log.error(`Failed to start plugin ${plg}${plugin.name}${er}: ${err}`);
|
|
1199
|
-
return Promise.reject(new Error(`Failed to start plugin ${plg}${plugin.name}${er}: ${err}`));
|
|
1208
|
+
// return Promise.reject(new Error(`Failed to start plugin ${plg}${plugin.name}${er}: ${err}`));
|
|
1200
1209
|
}
|
|
1201
1210
|
}
|
|
1202
1211
|
/**
|
|
@@ -1224,13 +1233,15 @@ export class Matterbridge extends EventEmitter {
|
|
|
1224
1233
|
return Promise.resolve();
|
|
1225
1234
|
})
|
|
1226
1235
|
.catch((err) => {
|
|
1236
|
+
plugin.error = true;
|
|
1227
1237
|
this.log.error(`Failed to configure plugin ${plg}${plugin.name}${er}: ${err}`);
|
|
1228
|
-
return Promise.reject(new Error(`Failed to configure plugin ${plg}${plugin.name}${er}: ${err}`));
|
|
1238
|
+
// return Promise.reject(new Error(`Failed to configure plugin ${plg}${plugin.name}${er}: ${err}`));
|
|
1229
1239
|
});
|
|
1230
1240
|
}
|
|
1231
1241
|
catch (err) {
|
|
1242
|
+
plugin.error = true;
|
|
1232
1243
|
this.log.error(`Failed to configure plugin ${plg}${plugin.name}${er}: ${err}`);
|
|
1233
|
-
return Promise.reject(new Error(`Failed to configure plugin ${plg}${plugin.name}${er}: ${err}`));
|
|
1244
|
+
// return Promise.reject(new Error(`Failed to configure plugin ${plg}${plugin.name}${er}: ${err}`));
|
|
1234
1245
|
}
|
|
1235
1246
|
}
|
|
1236
1247
|
/**
|
|
@@ -1286,12 +1297,14 @@ export class Matterbridge extends EventEmitter {
|
|
|
1286
1297
|
}
|
|
1287
1298
|
else {
|
|
1288
1299
|
this.log.error(`Plugin ${plg}${plugin.name}${er} does not provide a default export`);
|
|
1300
|
+
plugin.error = true;
|
|
1289
1301
|
return;
|
|
1290
1302
|
//return Promise.reject(new Error(`Plugin ${plg}${plugin.name}${er} does not provide a default export`));
|
|
1291
1303
|
}
|
|
1292
1304
|
}
|
|
1293
1305
|
catch (err) {
|
|
1294
1306
|
this.log.error(`Failed to load plugin ${plg}${plugin.name}${er}: ${err}`);
|
|
1307
|
+
plugin.error = true;
|
|
1295
1308
|
return;
|
|
1296
1309
|
//return Promise.reject(new Error(`Failed to load plugin ${plg}${plugin.name}${er}: ${err}`));
|
|
1297
1310
|
}
|
|
@@ -1480,10 +1493,10 @@ export class Matterbridge extends EventEmitter {
|
|
|
1480
1493
|
let failCount = 0;
|
|
1481
1494
|
const startInterval = setInterval(async () => {
|
|
1482
1495
|
for (const plugin of this.registeredPlugins) {
|
|
1483
|
-
if (!plugin.enabled)
|
|
1496
|
+
if (!plugin.enabled || plugin.error)
|
|
1484
1497
|
continue;
|
|
1485
1498
|
if (!plugin.loaded) {
|
|
1486
|
-
this.log.
|
|
1499
|
+
this.log.debug(`***Waiting (failSafeCount=${failCount}/30) in startMatterbridge interval for plugin ${plg}${plugin.name}${db} loaded: ${plugin.loaded}...`);
|
|
1487
1500
|
failCount++;
|
|
1488
1501
|
if (failCount > 30) {
|
|
1489
1502
|
this.log.error(`***Failed to load plugin ${plg}${plugin.name}${er}`);
|
|
@@ -1542,7 +1555,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
1542
1555
|
let failCount = 0;
|
|
1543
1556
|
const startInterval = setInterval(async () => {
|
|
1544
1557
|
if (!plugin.loaded || !plugin.started /* || !plugin.configured*/) {
|
|
1545
|
-
this.log.
|
|
1558
|
+
this.log.debug(`***Waiting (failSafeCount=${failCount}/30) in startMatterbridge interval for plugin ${plg}${plugin.name}${db} loaded: ${plugin.loaded} started: ${plugin.started}...`);
|
|
1546
1559
|
failCount++;
|
|
1547
1560
|
if (failCount > 30) {
|
|
1548
1561
|
this.log.error(`***Failed to load plugin ${plg}${plugin.name}${er}`);
|
|
@@ -1885,9 +1898,15 @@ export class Matterbridge extends EventEmitter {
|
|
|
1885
1898
|
if (this.bridgeMode === 'bridge') {
|
|
1886
1899
|
//Logger.defaultLogLevel = Level.INFO;
|
|
1887
1900
|
for (const plugin of this.registeredPlugins) {
|
|
1888
|
-
if (!plugin.enabled)
|
|
1901
|
+
if (!plugin.enabled || !plugin.loaded || plugin.error)
|
|
1889
1902
|
continue;
|
|
1890
|
-
|
|
1903
|
+
try {
|
|
1904
|
+
this.startPlugin(plugin, 'Matterbridge is commissioned and controllers are connected', true); // No await do it asyncronously with also configurePlugin
|
|
1905
|
+
}
|
|
1906
|
+
catch (error) {
|
|
1907
|
+
plugin.error = true;
|
|
1908
|
+
this.log.error(`Error starting plugin ${plg}${plugin.name}${er}`, error);
|
|
1909
|
+
}
|
|
1891
1910
|
}
|
|
1892
1911
|
Logger.defaultLogLevel = this.debugEnabled ? Level.DEBUG : Level.INFO;
|
|
1893
1912
|
}
|
|
@@ -2076,6 +2095,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
2076
2095
|
const versionPatch = parseInt(this.systemInformation.nodeVersion.split('.')[2]);
|
|
2077
2096
|
// Host system information
|
|
2078
2097
|
this.systemInformation.hostname = os.hostname();
|
|
2098
|
+
this.systemInformation.user = os.userInfo().username;
|
|
2079
2099
|
this.systemInformation.osType = os.type(); // "Windows_NT", "Darwin", etc.
|
|
2080
2100
|
this.systemInformation.osRelease = os.release(); // Kernel version
|
|
2081
2101
|
this.systemInformation.osPlatform = os.platform(); // "win32", "linux", "darwin", etc.
|
|
@@ -2086,6 +2106,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
2086
2106
|
// Log the system information
|
|
2087
2107
|
this.log.debug('Host System Information:');
|
|
2088
2108
|
this.log.debug(`- Hostname: ${this.systemInformation.hostname}`);
|
|
2109
|
+
this.log.debug(`- User: ${this.systemInformation.user}`);
|
|
2089
2110
|
this.log.debug(`- IPv4 Address: ${this.systemInformation.ipv4Address}`);
|
|
2090
2111
|
this.log.debug(`- IPv6 Address: ${this.systemInformation.ipv6Address}`);
|
|
2091
2112
|
this.log.debug(`- Node.js: ${versionMajor}.${versionMinor}.${versionPatch}`);
|
|
@@ -2267,7 +2288,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
2267
2288
|
args.unshift(command);
|
|
2268
2289
|
command = 'sudo';
|
|
2269
2290
|
}
|
|
2270
|
-
this.log.debug(`
|
|
2291
|
+
this.log.debug(`Spawn command ${command} with ${debugStringify(args)}`);
|
|
2271
2292
|
return new Promise((resolve, reject) => {
|
|
2272
2293
|
const childProcess = spawn(command, args, {
|
|
2273
2294
|
stdio: ['inherit', 'pipe', 'pipe'],
|
|
@@ -2431,6 +2452,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
2431
2452
|
res.json({});
|
|
2432
2453
|
}
|
|
2433
2454
|
this.matterbridgeInformation.bridgeMode = this.bridgeMode;
|
|
2455
|
+
this.matterbridgeInformation.restartMode = this.restartMode;
|
|
2434
2456
|
this.matterbridgeInformation.debugEnabled = this.debugEnabled;
|
|
2435
2457
|
const response = { wssHost, qrPairingCode, manualPairingCode, systemInformation: this.systemInformation, matterbridgeInformation: this.matterbridgeInformation };
|
|
2436
2458
|
this.log.debug('The frontend sent /api/settings');
|