matterbridge 3.0.0-edge.13 → 3.0.0-edge.14
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 -0
- package/README-DOCKER.md +13 -13
- package/README-SERVICE.md +27 -21
- package/dist/frontend.js +24 -1
- package/dist/utils/parameter.js +39 -7
- package/frontend/build/asset-manifest.json +3 -3
- package/frontend/build/index.html +1 -1
- package/frontend/build/static/js/{main.cf5d7dfe.js → main.13560e6f.js} +3 -3
- package/frontend/build/static/js/{main.cf5d7dfe.js.map → main.13560e6f.js.map} +1 -1
- package/npm-shrinkwrap.json +44 -44
- package/package.json +2 -2
- package/dist/utils/isvalid.d.ts +0 -9
- package/dist/utils/isvalid.d.ts.map +0 -1
- /package/frontend/build/static/js/{main.cf5d7dfe.js.LICENSE.txt → main.13560e6f.js.LICENSE.txt} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -67,8 +67,13 @@ Modified clusters:
|
|
|
67
67
|
- [matter.js]: Update to 0.13.0-alpha.0-20250415-475996bb5.
|
|
68
68
|
- [matter.js]: Update to 0.13.0-alpha.0-20250418-8cfc0b832.
|
|
69
69
|
- [matter.js]: Update to 0.13.0-alpha.0-20250420-9f45e4f77.
|
|
70
|
+
- [matter.js]: Update to 0.13.0-alpha.0-20250422-0d27f26be.
|
|
71
|
+
- [matter.js]: Update to 0.13.0-alpha.0-20250423-8917d1d1d.
|
|
72
|
+
- [matter.js]: Update to 0.13.0-alpha.0-20250424-4760af1f3.
|
|
73
|
+
- [matter.js]: Update to 0.13.0-alpha.0-20250425-94b33ff98.
|
|
70
74
|
- [help]: Updated cli help screen.
|
|
71
75
|
- [logger]: Improved frontend logger cleaning.
|
|
76
|
+
- [parameter]: Added getIntArrayParameter and getStringArrayParameter.
|
|
72
77
|
|
|
73
78
|
### Fixed
|
|
74
79
|
|
package/README-DOCKER.md
CHANGED
|
@@ -38,7 +38,7 @@ docker exec -it matterbridge curl -v http://localhost:8283/health
|
|
|
38
38
|
|
|
39
39
|
This will create the required directories in your home directory if they don't exist
|
|
40
40
|
|
|
41
|
-
```
|
|
41
|
+
```bash
|
|
42
42
|
cd ~
|
|
43
43
|
mkdir -p ./Matterbridge
|
|
44
44
|
mkdir -p ./.matterbridge
|
|
@@ -51,7 +51,7 @@ You may need to adapt the script to your setup.
|
|
|
51
51
|
|
|
52
52
|
If you don't want to use sudo with docker commands, run this command:
|
|
53
53
|
|
|
54
|
-
```
|
|
54
|
+
```bash
|
|
55
55
|
sudo groupadd docker
|
|
56
56
|
sudo usermod -aG docker $USER
|
|
57
57
|
```
|
|
@@ -62,7 +62,7 @@ After adding your user to the docker group, you need to log out and log back in
|
|
|
62
62
|
|
|
63
63
|
The container must have full access to the host network (needed for mdns).
|
|
64
64
|
|
|
65
|
-
```
|
|
65
|
+
```bash
|
|
66
66
|
sudo docker run --name matterbridge \
|
|
67
67
|
-v /home/<USER>/Matterbridge:/root/Matterbridge \
|
|
68
68
|
-v /home/<USER>/.matterbridge:/root/.matterbridge \
|
|
@@ -95,55 +95,55 @@ copy it in the home directory or edit the existing one to add the matterbridge s
|
|
|
95
95
|
|
|
96
96
|
Then start docker compose with:
|
|
97
97
|
|
|
98
|
-
```
|
|
98
|
+
```bash
|
|
99
99
|
docker compose up -d
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
### Stop with docker compose
|
|
103
103
|
|
|
104
|
-
```
|
|
104
|
+
```bash
|
|
105
105
|
docker compose down
|
|
106
106
|
```
|
|
107
107
|
|
|
108
108
|
### Update with docker compose
|
|
109
109
|
|
|
110
|
-
```
|
|
110
|
+
```bash
|
|
111
111
|
docker compose pull
|
|
112
112
|
```
|
|
113
113
|
|
|
114
114
|
### Inspect the container
|
|
115
115
|
|
|
116
|
-
```
|
|
116
|
+
```bash
|
|
117
117
|
docker container inspect matterbridge
|
|
118
118
|
```
|
|
119
119
|
|
|
120
120
|
### Start the Docker container
|
|
121
121
|
|
|
122
|
-
```
|
|
122
|
+
```bash
|
|
123
123
|
docker start matterbridge
|
|
124
124
|
```
|
|
125
125
|
|
|
126
126
|
### Stop the Docker container
|
|
127
127
|
|
|
128
|
-
```
|
|
128
|
+
```bash
|
|
129
129
|
docker stop matterbridge
|
|
130
130
|
```
|
|
131
131
|
|
|
132
132
|
### Restart the Docker container
|
|
133
133
|
|
|
134
|
-
```
|
|
134
|
+
```bash
|
|
135
135
|
docker restart matterbridge
|
|
136
136
|
```
|
|
137
137
|
|
|
138
138
|
### Shows the logs
|
|
139
139
|
|
|
140
|
-
```
|
|
140
|
+
```bash
|
|
141
141
|
docker logs matterbridge
|
|
142
142
|
```
|
|
143
143
|
|
|
144
144
|
### Shows the logs for a time interval
|
|
145
145
|
|
|
146
|
-
```
|
|
146
|
+
```bash
|
|
147
147
|
docker logs \
|
|
148
148
|
--since "2025-04-19T00:00:00" \
|
|
149
149
|
--until "2025-04-19T00:02:00" \
|
|
@@ -152,6 +152,6 @@ docker logs \
|
|
|
152
152
|
|
|
153
153
|
### Shows the logs real time (tail)
|
|
154
154
|
|
|
155
|
-
```
|
|
155
|
+
```bash
|
|
156
156
|
docker logs --tail 1000 -f matterbridge
|
|
157
157
|
```
|
package/README-SERVICE.md
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
This will create the required directories if they don't exist
|
|
22
22
|
|
|
23
|
-
```
|
|
23
|
+
```bash
|
|
24
24
|
cd ~
|
|
25
25
|
mkdir -p ./Matterbridge
|
|
26
26
|
mkdir -p ./.matterbridge
|
|
@@ -31,7 +31,7 @@ sudo chown -R $USER:$USER ./Matterbridge ./.matterbridge
|
|
|
31
31
|
|
|
32
32
|
Create a systemctl configuration file for Matterbridge
|
|
33
33
|
|
|
34
|
-
```
|
|
34
|
+
```bash
|
|
35
35
|
sudo nano /etc/systemd/system/matterbridge.service
|
|
36
36
|
```
|
|
37
37
|
|
|
@@ -53,8 +53,6 @@ WorkingDirectory=/home/<USER>/Matterbridge
|
|
|
53
53
|
StandardOutput=inherit
|
|
54
54
|
StandardError=inherit
|
|
55
55
|
Restart=always
|
|
56
|
-
RestartSec=10s
|
|
57
|
-
TimeoutStopSec=30s
|
|
58
56
|
User=<USER>
|
|
59
57
|
Group=<USER>
|
|
60
58
|
|
|
@@ -70,45 +68,53 @@ add this:
|
|
|
70
68
|
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
|
71
69
|
```
|
|
72
70
|
|
|
73
|
-
If you
|
|
71
|
+
If you use the matterbridge-bthome plugin add this:
|
|
74
72
|
|
|
75
73
|
```
|
|
74
|
+
[Service]
|
|
75
|
+
AmbientCapabilities=CAP_NET_BIND_SERVICE CAP_NET_RAW CAP_NET_ADMIN
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
If you modify it after, then run:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
76
81
|
sudo systemctl daemon-reload
|
|
82
|
+
sudo systemctl restart matterbridge.service
|
|
77
83
|
```
|
|
78
84
|
|
|
79
85
|
### Start Matterbridge
|
|
80
86
|
|
|
81
|
-
```
|
|
87
|
+
```bash
|
|
82
88
|
sudo systemctl start matterbridge
|
|
83
89
|
```
|
|
84
90
|
|
|
85
91
|
### Stop Matterbridge
|
|
86
92
|
|
|
87
|
-
```
|
|
93
|
+
```bash
|
|
88
94
|
sudo systemctl stop matterbridge
|
|
89
95
|
```
|
|
90
96
|
|
|
91
97
|
### Show Matterbridge status
|
|
92
98
|
|
|
93
|
-
```
|
|
99
|
+
```bash
|
|
94
100
|
sudo systemctl status matterbridge.service
|
|
95
101
|
```
|
|
96
102
|
|
|
97
103
|
### Enable Matterbridge to start automatically on boot
|
|
98
104
|
|
|
99
|
-
```
|
|
105
|
+
```bash
|
|
100
106
|
sudo systemctl enable matterbridge.service
|
|
101
107
|
```
|
|
102
108
|
|
|
103
109
|
### Disable Matterbridge from starting automatically on boot
|
|
104
110
|
|
|
105
|
-
```
|
|
111
|
+
```bash
|
|
106
112
|
sudo systemctl disable matterbridge.service
|
|
107
113
|
```
|
|
108
114
|
|
|
109
115
|
### View the log of Matterbridge in real time (this will show the log with colors)
|
|
110
116
|
|
|
111
|
-
```
|
|
117
|
+
```bash
|
|
112
118
|
sudo journalctl -u matterbridge.service -n 1000 -f --output cat
|
|
113
119
|
```
|
|
114
120
|
|
|
@@ -116,13 +122,13 @@ sudo journalctl -u matterbridge.service -n 1000 -f --output cat
|
|
|
116
122
|
|
|
117
123
|
Check the space used
|
|
118
124
|
|
|
119
|
-
```
|
|
125
|
+
```bash
|
|
120
126
|
sudo journalctl --disk-usage
|
|
121
127
|
```
|
|
122
128
|
|
|
123
129
|
remove all log older then 3 days
|
|
124
130
|
|
|
125
|
-
```
|
|
131
|
+
```bash
|
|
126
132
|
sudo journalctl --rotate
|
|
127
133
|
sudo journalctl --vacuum-time=3d
|
|
128
134
|
```
|
|
@@ -131,13 +137,13 @@ sudo journalctl --vacuum-time=3d
|
|
|
131
137
|
|
|
132
138
|
If you want to make the setting permanent to prevent the journal logs to grow too much, run
|
|
133
139
|
|
|
134
|
-
```
|
|
140
|
+
```bash
|
|
135
141
|
sudo nano /etc/systemd/journald.conf
|
|
136
142
|
```
|
|
137
143
|
|
|
138
144
|
add
|
|
139
145
|
|
|
140
|
-
```
|
|
146
|
+
```bash
|
|
141
147
|
Compress=yes # Compress logs
|
|
142
148
|
MaxRetentionSec=3days # Keep logs for a maximum of 3 days.
|
|
143
149
|
MaxFileSec=1day # Rotate logs daily within the 3-day retention period.
|
|
@@ -148,7 +154,7 @@ RuntimeMaxUse=100M # Limit runtime logs in /run/log/journal to 100 MB.
|
|
|
148
154
|
|
|
149
155
|
save it and run
|
|
150
156
|
|
|
151
|
-
```
|
|
157
|
+
```bash
|
|
152
158
|
sudo systemctl restart systemd-journald
|
|
153
159
|
```
|
|
154
160
|
|
|
@@ -156,7 +162,7 @@ sudo systemctl restart systemd-journald
|
|
|
156
162
|
|
|
157
163
|
Run the following command to verify if you can install Matterbridge globally without being prompted for a password:
|
|
158
164
|
|
|
159
|
-
```
|
|
165
|
+
```bash
|
|
160
166
|
sudo npm install -g matterbridge
|
|
161
167
|
```
|
|
162
168
|
|
|
@@ -164,7 +170,7 @@ If you are not prompted for a password, no further action is required.
|
|
|
164
170
|
|
|
165
171
|
If that is not the case, open the sudoers file for editing using visudo
|
|
166
172
|
|
|
167
|
-
```
|
|
173
|
+
```bash
|
|
168
174
|
sudo visudo
|
|
169
175
|
```
|
|
170
176
|
|
|
@@ -176,8 +182,8 @@ verify the presence of of a line
|
|
|
176
182
|
|
|
177
183
|
exit and create a configuration file for sudoers
|
|
178
184
|
|
|
179
|
-
```
|
|
180
|
-
sudo nano
|
|
185
|
+
```bash
|
|
186
|
+
sudo nano /etc/sudoers.d/matterbridge
|
|
181
187
|
```
|
|
182
188
|
|
|
183
189
|
add this line replacing USER with your user name (e.g. radxa ALL=(ALL) NOPASSWD: ALL)
|
|
@@ -194,6 +200,6 @@ or if you prefers to only give access to npm without password try with (e.g. rad
|
|
|
194
200
|
|
|
195
201
|
save the file and reload the settings with:
|
|
196
202
|
|
|
197
|
-
```
|
|
203
|
+
```bash
|
|
198
204
|
sudo visudo -c
|
|
199
205
|
```
|
package/dist/frontend.js
CHANGED
|
@@ -11,7 +11,7 @@ import { AnsiLogger, stringify, debugStringify, CYAN, db, er, nf, rs, UNDERLINE,
|
|
|
11
11
|
import { createZip, deepCopy, isValidArray, isValidNumber, isValidObject, isValidString } from './utils/export.js';
|
|
12
12
|
import { plg } from './matterbridgeTypes.js';
|
|
13
13
|
import { hasParameter } from './utils/export.js';
|
|
14
|
-
import { BridgedDeviceBasicInformation } from '@matter/main/clusters';
|
|
14
|
+
import { BridgedDeviceBasicInformation, PowerSource } from '@matter/main/clusters';
|
|
15
15
|
export const WS_ID_LOG = 0;
|
|
16
16
|
export const WS_ID_REFRESH_NEEDED = 1;
|
|
17
17
|
export const WS_ID_RESTART_NEEDED = 2;
|
|
@@ -918,6 +918,28 @@ export class Frontend {
|
|
|
918
918
|
return true;
|
|
919
919
|
return false;
|
|
920
920
|
}
|
|
921
|
+
getPowerSource(device) {
|
|
922
|
+
if (!device.lifecycle.isReady || device.construction.status !== Lifecycle.Status.Active)
|
|
923
|
+
return undefined;
|
|
924
|
+
const powerSource = (device) => {
|
|
925
|
+
const featureMap = device.getAttribute(PowerSource.Cluster.id, 'featureMap');
|
|
926
|
+
if (featureMap.wired) {
|
|
927
|
+
const wiredCurrentType = device.getAttribute(PowerSource.Cluster.id, 'wiredCurrentType');
|
|
928
|
+
return ['ac', 'dc'][wiredCurrentType];
|
|
929
|
+
}
|
|
930
|
+
if (featureMap.battery) {
|
|
931
|
+
const batChargeLevel = device.getAttribute(PowerSource.Cluster.id, 'batChargeLevel');
|
|
932
|
+
return ['ok', 'warning', 'critical'][batChargeLevel];
|
|
933
|
+
}
|
|
934
|
+
return;
|
|
935
|
+
};
|
|
936
|
+
if (device.hasClusterServer(PowerSource.Cluster.id))
|
|
937
|
+
return powerSource(device);
|
|
938
|
+
for (const child of device.getChildEndpoints()) {
|
|
939
|
+
if (child.hasClusterServer(PowerSource.Cluster.id))
|
|
940
|
+
return powerSource(child);
|
|
941
|
+
}
|
|
942
|
+
}
|
|
921
943
|
getClusterTextFromDevice(device) {
|
|
922
944
|
if (!device.lifecycle.isReady || device.construction.status !== Lifecycle.Status.Active)
|
|
923
945
|
return '';
|
|
@@ -1243,6 +1265,7 @@ export class Frontend {
|
|
|
1243
1265
|
configUrl: device.configUrl,
|
|
1244
1266
|
uniqueId: device.uniqueId,
|
|
1245
1267
|
reachable: this.getReachability(device),
|
|
1268
|
+
powerSource: this.getPowerSource(device),
|
|
1246
1269
|
cluster: cluster,
|
|
1247
1270
|
});
|
|
1248
1271
|
});
|
package/dist/utils/parameter.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
export function hasParameter(name) {
|
|
2
|
+
const commandArguments = process.argv.slice(2);
|
|
3
|
+
let markerIncluded = commandArguments.includes(`-${name}`);
|
|
4
|
+
if (!markerIncluded)
|
|
5
|
+
markerIncluded = commandArguments.includes(`--${name}`);
|
|
6
|
+
return markerIncluded;
|
|
7
|
+
}
|
|
1
8
|
import { isValidNumber } from './export.js';
|
|
2
9
|
export function getParameter(name) {
|
|
3
10
|
const commandArguments = process.argv.slice(2);
|
|
@@ -8,13 +15,6 @@ export function getParameter(name) {
|
|
|
8
15
|
return undefined;
|
|
9
16
|
return commandArguments[markerIndex + 1];
|
|
10
17
|
}
|
|
11
|
-
export function hasParameter(name) {
|
|
12
|
-
const commandArguments = process.argv.slice(2);
|
|
13
|
-
let markerIncluded = commandArguments.includes(`-${name}`);
|
|
14
|
-
if (!markerIncluded)
|
|
15
|
-
markerIncluded = commandArguments.includes(`--${name}`);
|
|
16
|
-
return markerIncluded;
|
|
17
|
-
}
|
|
18
18
|
export function getIntParameter(name) {
|
|
19
19
|
const value = getParameter(name);
|
|
20
20
|
if (value === undefined)
|
|
@@ -24,3 +24,35 @@ export function getIntParameter(name) {
|
|
|
24
24
|
return undefined;
|
|
25
25
|
return intValue;
|
|
26
26
|
}
|
|
27
|
+
export function getIntArrayParameter(name) {
|
|
28
|
+
const commandArguments = process.argv.slice(2);
|
|
29
|
+
let markerIndex = commandArguments.indexOf(`--${name}`);
|
|
30
|
+
if (markerIndex < 0)
|
|
31
|
+
markerIndex = commandArguments.indexOf(`-${name}`);
|
|
32
|
+
if (markerIndex < 0)
|
|
33
|
+
return undefined;
|
|
34
|
+
const intValues = [];
|
|
35
|
+
for (let i = markerIndex + 1; i < commandArguments.length && !commandArguments[i].startsWith('-'); i++) {
|
|
36
|
+
const intValue = parseInt(commandArguments[i], 10);
|
|
37
|
+
if (isValidNumber(intValue))
|
|
38
|
+
intValues.push(intValue);
|
|
39
|
+
}
|
|
40
|
+
if (intValues.length === 0)
|
|
41
|
+
return undefined;
|
|
42
|
+
return intValues;
|
|
43
|
+
}
|
|
44
|
+
export function getStringArrayParameter(name) {
|
|
45
|
+
const commandArguments = process.argv.slice(2);
|
|
46
|
+
let markerIndex = commandArguments.indexOf(`--${name}`);
|
|
47
|
+
if (markerIndex < 0)
|
|
48
|
+
markerIndex = commandArguments.indexOf(`-${name}`);
|
|
49
|
+
if (markerIndex < 0)
|
|
50
|
+
return undefined;
|
|
51
|
+
const values = [];
|
|
52
|
+
for (let i = markerIndex + 1; i < commandArguments.length && !commandArguments[i].startsWith('-'); i++) {
|
|
53
|
+
values.push(commandArguments[i]);
|
|
54
|
+
}
|
|
55
|
+
if (values.length === 0)
|
|
56
|
+
return undefined;
|
|
57
|
+
return values;
|
|
58
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"files": {
|
|
3
3
|
"main.css": "./static/css/main.944b63c3.css",
|
|
4
|
-
"main.js": "./static/js/main.
|
|
4
|
+
"main.js": "./static/js/main.13560e6f.js",
|
|
5
5
|
"static/js/453.d855a71b.chunk.js": "./static/js/453.d855a71b.chunk.js",
|
|
6
6
|
"static/media/roboto-latin-700-normal.woff2": "./static/media/roboto-latin-700-normal.c4d6cab43bec89049809.woff2",
|
|
7
7
|
"static/media/roboto-latin-500-normal.woff2": "./static/media/roboto-latin-500-normal.599f66a60bdf974e578e.woff2",
|
|
@@ -77,11 +77,11 @@
|
|
|
77
77
|
"static/media/roboto-greek-ext-300-normal.woff": "./static/media/roboto-greek-ext-300-normal.60729cafbded24073dfb.woff",
|
|
78
78
|
"index.html": "./index.html",
|
|
79
79
|
"main.944b63c3.css.map": "./static/css/main.944b63c3.css.map",
|
|
80
|
-
"main.
|
|
80
|
+
"main.13560e6f.js.map": "./static/js/main.13560e6f.js.map",
|
|
81
81
|
"453.d855a71b.chunk.js.map": "./static/js/453.d855a71b.chunk.js.map"
|
|
82
82
|
},
|
|
83
83
|
"entrypoints": [
|
|
84
84
|
"static/css/main.944b63c3.css",
|
|
85
|
-
"static/js/main.
|
|
85
|
+
"static/js/main.13560e6f.js"
|
|
86
86
|
]
|
|
87
87
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><base href="./"><link rel="icon" href="./matterbridge 32x32.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><title>Matterbridge</title><link rel="manifest" href="./manifest.json"/><script defer="defer" src="./static/js/main.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><base href="./"><link rel="icon" href="./matterbridge 32x32.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><title>Matterbridge</title><link rel="manifest" href="./manifest.json"/><script defer="defer" src="./static/js/main.13560e6f.js"></script><link href="./static/css/main.944b63c3.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|