matterbridge 1.6.6-dev.6 → 1.6.6-dev.9

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 CHANGED
@@ -14,19 +14,23 @@ If you want to run Matterbridge in Home Assistant please use the official add-on
14
14
 
15
15
  Tamer (https://github.com/tammeryousef1006) has created the Matterbridge Discord group: https://discord.gg/QX58CDe6hd.
16
16
 
17
- ## [1.6.6] - 2024-12-05
17
+ ## [1.6.6] - 2024-12-06
18
18
 
19
19
  ### Added
20
20
 
21
21
  - [frontend]: Add the possibility to install a specific version or the dev of any plugin (i.e. you can install matterbridge-hass@dev or matterbridge-hass@0.0.3).
22
22
  It is also possible to use the install plugin to install a specific version of matterbridge (i.e. you can install matterbridge@dev or matterbridge@1.6.5)
23
+ - [frontend]: Add the possibility to set the matter discriminator for commissioning (you can always override passing **-discriminator [DISCRIMINATOR]** on the command line).
24
+ - [frontend]: Add the possibility to set the matter passcode for commissioning (you can always override passing **-passcode [PASSCODE]** on the command line).
23
25
  - [frontend]: Add the possibility to set the matter port for commissioning (you can always override passing **-port [PORT]** on the command line).
24
26
  - [deviceTypes]: Add device type airConditioner (not supported by the Apple Home).
25
27
  - [docker]: Add matterbridge-hass to docker dev.
26
- - [platform]: Added validateDeviceWhiteBlackList and validateEntityBlackList to be use consistently by all plugins.
28
+ - [platform]: Added validateDeviceWhiteBlackList and validateEntityBlackList to be used consistently by all plugins.
27
29
 
28
30
  ### Changed
29
31
 
32
+ - [package]: Update matter.js to 0.11.9-alpha.0-20241206-22f23333.
33
+ - [package]: Update matter.js to 0.11.9-alpha.0-20241207-b604cfa44
30
34
  - [plugin]: Removed check on package types since we are moving to production plugins.
31
35
  - [package]: Set required node version to 18, 20 and 22.
32
36
  - [package]: Update dependencies.
@@ -69,6 +69,8 @@ export class Matterbridge extends EventEmitter {
69
69
  matteripv4address: undefined,
70
70
  matteripv6address: undefined,
71
71
  matterPort: 5540,
72
+ matterDiscriminator: undefined,
73
+ matterPasscode: undefined,
72
74
  restartRequired: false,
73
75
  refreshRequired: false,
74
76
  };
@@ -199,8 +201,8 @@ export class Matterbridge extends EventEmitter {
199
201
  throw new Error('Fatal error creating node storage manager and context for matterbridge');
200
202
  }
201
203
  this.port = getIntParameter('port') ?? (await this.nodeContext.get('matterport', 5540)) ?? 5540;
202
- this.passcode = getIntParameter('passcode');
203
- this.discriminator = getIntParameter('discriminator');
204
+ this.passcode = getIntParameter('passcode') ?? (await this.nodeContext.get('matterpasscode'));
205
+ this.discriminator = getIntParameter('discriminator') ?? (await this.nodeContext.get('matterdiscriminator'));
204
206
  if (hasParameter('logger')) {
205
207
  const level = getParameter('logger');
206
208
  if (level === 'debug') {
@@ -1647,7 +1649,7 @@ export class Matterbridge extends EventEmitter {
1647
1649
  this.log.debug(`Creating matter commissioning server for plugin ${plg}${pluginName}${db} with uniqueId ${uniqueId} serialNumber ${serialNumber}`);
1648
1650
  this.log.debug(`Creating matter commissioning server for plugin ${plg}${pluginName}${db} with softwareVersion ${softwareVersion} softwareVersionString ${softwareVersionString}`);
1649
1651
  this.log.debug(`Creating matter commissioning server for plugin ${plg}${pluginName}${db} with hardwareVersion ${hardwareVersion} hardwareVersionString ${hardwareVersionString}`);
1650
- this.log.debug(`Creating matter commissioning server for plugin ${plg}${pluginName}${db} with nodeLabel '${productName}' port ${CYAN}${this.port}${db} passcode ${CYAN}${this.passcode}${db} discriminator ${CYAN}${this.discriminator}${db}`);
1652
+ this.log.debug(`Creating matter commissioning server for plugin ${plg}${pluginName}${db} with nodeLabel '${productName}' port ${CYAN}${this.port}${db} discriminator ${CYAN}${this.discriminator}${db} passcode ${CYAN}${this.passcode}${db} `);
1651
1653
  if (this.ipv4address) {
1652
1654
  const networkInterfaces = os.networkInterfaces();
1653
1655
  const availableAddresses = Object.values(networkInterfaces)
@@ -2313,7 +2315,9 @@ export class Matterbridge extends EventEmitter {
2313
2315
  this.matterbridgeInformation.mattermdnsinterface = (await this.nodeContext?.get('mattermdnsinterface', '')) || '';
2314
2316
  this.matterbridgeInformation.matteripv4address = (await this.nodeContext?.get('matteripv4address', '')) || '';
2315
2317
  this.matterbridgeInformation.matteripv6address = (await this.nodeContext?.get('matteripv6address', '')) || '';
2316
- this.matterbridgeInformation.matterPort = (await this.nodeContext?.get('matterport', 5540)) || 5540;
2318
+ this.matterbridgeInformation.matterPort = (await this.nodeContext?.get('matterport', 5540)) ?? 5540;
2319
+ this.matterbridgeInformation.matterDiscriminator = await this.nodeContext?.get('matterdiscriminator');
2320
+ this.matterbridgeInformation.matterPasscode = await this.nodeContext?.get('matterpasscode');
2317
2321
  this.matterbridgeInformation.matterbridgePaired = this.matterbridgePaired;
2318
2322
  this.matterbridgeInformation.matterbridgeConnected = this.matterbridgeConnected;
2319
2323
  this.matterbridgeInformation.matterbridgeQrPairingCode = this.matterbridgeQrPairingCode;
@@ -2634,11 +2638,27 @@ export class Matterbridge extends EventEmitter {
2634
2638
  if (command === 'setmatterport') {
2635
2639
  const port = Math.min(Math.max(parseInt(param), 5540), 5560);
2636
2640
  this.matterbridgeInformation.matterPort = port;
2637
- this.log.debug(`Set matter.js port to ${port}`);
2641
+ this.log.debug(`Set matter commissioning port to ${CYAN}${port}${db}`);
2638
2642
  await this.nodeContext?.set('matterport', port);
2639
2643
  res.json({ message: 'Command received' });
2640
2644
  return;
2641
2645
  }
2646
+ if (command === 'setmatterdiscriminator') {
2647
+ const discriminator = Math.min(Math.max(parseInt(param), 1000), 4095);
2648
+ this.matterbridgeInformation.matterDiscriminator = discriminator;
2649
+ this.log.debug(`Set matter commissioning discriminator to ${CYAN}${discriminator}${db}`);
2650
+ await this.nodeContext?.set('matterdiscriminator', discriminator);
2651
+ res.json({ message: 'Command received' });
2652
+ return;
2653
+ }
2654
+ if (command === 'setmatterpasscode') {
2655
+ const passcode = Math.min(Math.max(parseInt(param), 10000000), 90000000);
2656
+ this.matterbridgeInformation.matterPasscode = passcode;
2657
+ this.log.debug(`Set matter commissioning passcode to ${CYAN}${passcode}${db}`);
2658
+ await this.nodeContext?.set('matterpasscode', passcode);
2659
+ res.json({ message: 'Command received' });
2660
+ return;
2661
+ }
2642
2662
  if (command === 'setmblogfile') {
2643
2663
  this.log.debug('Matterbridge file log:', param);
2644
2664
  this.matterbridgeInformation.fileLogger = param === 'true';
@@ -48,9 +48,6 @@ export class MatterbridgeEdge extends Matterbridge {
48
48
  await super.initialize();
49
49
  if (this.mdnsInterface)
50
50
  this.environment.vars.set('mdns.networkInterface', this.mdnsInterface);
51
- this.port = 5540;
52
- this.passcode = 20242025;
53
- this.discriminator = 3840;
54
51
  }
55
52
  async startMatterStorage(storageType, storageName) {
56
53
  this.log.info(`Starting matter node storage...`);
@@ -70,24 +70,28 @@ export class MatterbridgePlatform {
70
70
  return false;
71
71
  return true;
72
72
  }
73
- validateDeviceWhiteBlackList(device) {
73
+ validateDeviceWhiteBlackList(device, log = true) {
74
74
  if (isValidArray(this.config.whiteList, 1) && !this.config.whiteList.includes(device)) {
75
- this.log.info(`Skipping device ${CYAN}${device}${nf} because not in whitelist`);
75
+ if (log)
76
+ this.log.info(`Skipping device ${CYAN}${device}${nf} because not in whitelist`);
76
77
  return false;
77
78
  }
78
79
  if (isValidArray(this.config.blackList, 1) && this.config.blackList.includes(device)) {
79
- this.log.info(`Skipping device ${CYAN}${device}${nf} because in blacklist`);
80
+ if (log)
81
+ this.log.info(`Skipping device ${CYAN}${device}${nf} because in blacklist`);
80
82
  return false;
81
83
  }
82
84
  return true;
83
85
  }
84
- validateEntityBlackList(device, entity) {
86
+ validateEntityBlackList(device, entity, log = true) {
85
87
  if (isValidArray(this.config.entityBlackList, 1) && this.config.entityBlackList.find((e) => e === entity)) {
86
- this.log.info(`Skipping entity ${CYAN}${entity}${nf} because in entityBlackList`);
88
+ if (log)
89
+ this.log.info(`Skipping entity ${CYAN}${entity}${nf} because in entityBlackList`);
87
90
  return false;
88
91
  }
89
92
  if (isValidObject(this.config.deviceEntityBlackList, 1) && device in this.config.deviceEntityBlackList && this.config.deviceEntityBlackList[device].includes(entity)) {
90
- this.log.info(`Skipping entity ${CYAN}${entity}${wr} for device ${CYAN}${device}${nf} because in deviceEntityBlackList`);
93
+ if (log)
94
+ this.log.info(`Skipping entity ${CYAN}${entity}${wr} for device ${CYAN}${device}${nf} because in deviceEntityBlackList`);
91
95
  return false;
92
96
  }
93
97
  return true;
@@ -81,7 +81,9 @@ export async function wsMessageHandler(client, message) {
81
81
  this.matterbridgeInformation.mattermdnsinterface = (await this.nodeContext?.get('mattermdnsinterface', '')) || '';
82
82
  this.matterbridgeInformation.matteripv4address = (await this.nodeContext?.get('matteripv4address', '')) || '';
83
83
  this.matterbridgeInformation.matteripv6address = (await this.nodeContext?.get('matteripv6address', '')) || '';
84
- this.matterbridgeInformation.matterPort = (await this.nodeContext?.get('matterport', 5540)) || 5540;
84
+ this.matterbridgeInformation.matterPort = (await this.nodeContext?.get('matterport', 5540)) ?? 5540;
85
+ this.matterbridgeInformation.matterDiscriminator = await this.nodeContext?.get('matterdiscriminator');
86
+ this.matterbridgeInformation.matterPasscode = await this.nodeContext?.get('matterpasscode');
85
87
  this.matterbridgeInformation.matterbridgePaired = this.matterbridgePaired;
86
88
  this.matterbridgeInformation.matterbridgeConnected = this.matterbridgeConnected;
87
89
  this.matterbridgeInformation.matterbridgeQrPairingCode = this.matterbridgeQrPairingCode;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "files": {
3
3
  "main.css": "./static/css/main.823e08b6.css",
4
- "main.js": "./static/js/main.1bf53a29.js",
4
+ "main.js": "./static/js/main.565ff6ba.js",
5
5
  "static/js/453.abd36b29.chunk.js": "./static/js/453.abd36b29.chunk.js",
6
6
  "static/media/roboto-latin-700-normal.woff2": "./static/media/roboto-latin-700-normal.4535474e1cf8598695ad.woff2",
7
7
  "static/media/roboto-latin-500-normal.woff2": "./static/media/roboto-latin-500-normal.7077203b1982951ecf76.woff2",
@@ -61,11 +61,11 @@
61
61
  "static/media/roboto-greek-ext-400-normal.woff": "./static/media/roboto-greek-ext-400-normal.16eb83b4a3b1ea994243.woff",
62
62
  "index.html": "./index.html",
63
63
  "main.823e08b6.css.map": "./static/css/main.823e08b6.css.map",
64
- "main.1bf53a29.js.map": "./static/js/main.1bf53a29.js.map",
64
+ "main.565ff6ba.js.map": "./static/js/main.565ff6ba.js.map",
65
65
  "453.abd36b29.chunk.js.map": "./static/js/453.abd36b29.chunk.js.map"
66
66
  },
67
67
  "entrypoints": [
68
68
  "static/css/main.823e08b6.css",
69
- "static/js/main.1bf53a29.js"
69
+ "static/js/main.565ff6ba.js"
70
70
  ]
71
71
  }
@@ -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.1bf53a29.js"></script><link href="./static/css/main.823e08b6.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
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.565ff6ba.js"></script><link href="./static/css/main.823e08b6.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>