matterbridge 1.6.8-dev.1 → 1.6.8-dev.4
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 +9 -6
- package/README-SERVICE.md +12 -3
- package/README.md +2 -0
- package/dist/matterbridge.js +106 -2
- package/dist/matterbridgeDevice.js +15 -0
- package/dist/matterbridgeEdge.js +2 -2
- package/dist/matterbridgeEndpoint.js +14 -0
- package/npm-shrinkwrap.json +6 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -13,15 +13,13 @@ It is also available the official Matterbridge Home Assistant plugin https://git
|
|
|
13
13
|
|
|
14
14
|
Tamer (https://github.com/tammeryousef1006) has created the Matterbridge Discord group: https://discord.gg/QX58CDe6hd.
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
In this release some device types and the OnOff, LevelControl and ColorControl have been updated to be fully compliant with Matter 1.3 specifications.
|
|
19
|
-
It is possible that some controllers see them as new devices or need time to read the new clusters. It can be useful after the upgrade to power off the controller, wait a few minutes and power it on again.
|
|
20
|
-
|
|
21
|
-
## [1.6.8-dev.1] - 2024-12-16
|
|
16
|
+
## [1.6.8-dev.4] - 2024-12-17
|
|
22
17
|
|
|
23
18
|
### Added
|
|
24
19
|
|
|
20
|
+
- [storage]: Added conversion from old matter storage to the new api format with fabrics, resumptionRecords, network, commissioning, operationalCredentials, acl and parts number. The conversion is automatic the first time you run this release.
|
|
21
|
+
- [package]: Update README.md and README-SERVICE.md to include instructions for using SSL on port 443.
|
|
22
|
+
|
|
25
23
|
### Changed
|
|
26
24
|
|
|
27
25
|
- [edge]: Fixes to edge mode.
|
|
@@ -35,6 +33,11 @@ It is possible that some controllers see them as new devices or need time to rea
|
|
|
35
33
|
|
|
36
34
|
## [1.6.7] - 2024-12-15
|
|
37
35
|
|
|
36
|
+
### Breaking Changes
|
|
37
|
+
|
|
38
|
+
In this release some device types and the OnOff, LevelControl and ColorControl have been updated to be fully compliant with Matter 1.3 specifications.
|
|
39
|
+
It is possible that some controllers see them as new devices or need time to read the new clusters. It can be useful after the upgrade to power off the controller, wait a few minutes and power it on again.
|
|
40
|
+
|
|
38
41
|
### Added
|
|
39
42
|
|
|
40
43
|
- [readme]: Update README to clarify Node.js installation instructions and emphasize LTS version.
|
package/README-SERVICE.md
CHANGED
|
@@ -35,7 +35,7 @@ Create a systemctl configuration file for Matterbridge
|
|
|
35
35
|
sudo nano /etc/systemd/system/matterbridge.service
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
Add the following to this file, replacing
|
|
38
|
+
Add the following to this file, replacing 3 times (!) USER with your user name (e.g. WorkingDirectory=/home/pi/Matterbridge, User=pi and Group=pi):
|
|
39
39
|
|
|
40
40
|
You may need to adapt the configuration to your setup:
|
|
41
41
|
|
|
@@ -49,18 +49,27 @@ After=network-online.target
|
|
|
49
49
|
[Service]
|
|
50
50
|
Type=simple
|
|
51
51
|
ExecStart=matterbridge -service
|
|
52
|
-
WorkingDirectory=/home/<USER>/Matterbridge
|
|
52
|
+
WorkingDirectory=/home/<USER>/Matterbridge # Replace <USER> with your system username
|
|
53
53
|
StandardOutput=inherit
|
|
54
54
|
StandardError=inherit
|
|
55
55
|
Restart=always
|
|
56
56
|
RestartSec=10s
|
|
57
57
|
TimeoutStopSec=30s
|
|
58
|
-
User=<USER>
|
|
58
|
+
User=<USER> # Replace <USER> with your system username
|
|
59
|
+
Group=<USER> # Replace <USER> with your system username
|
|
59
60
|
|
|
60
61
|
[Install]
|
|
61
62
|
WantedBy=multi-user.target
|
|
62
63
|
```
|
|
63
64
|
|
|
65
|
+
If you use the frontend with -ssl -frontend 443 and get an error message: "Port 443 requires elevated privileges",
|
|
66
|
+
add this:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
[Service]
|
|
70
|
+
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
|
71
|
+
```
|
|
72
|
+
|
|
64
73
|
If you modify it after, then run:
|
|
65
74
|
|
|
66
75
|
```
|
package/README.md
CHANGED
|
@@ -116,6 +116,8 @@ Here's how to specify a different port number:
|
|
|
116
116
|
matterbridge -frontend [port number]
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
+
To use the frontend with ssl place the certificates in the .matterbridge/certs directory: cert.pem, key.pem and ca.pem (optional).
|
|
120
|
+
|
|
119
121
|
From the frontend you can do all operations in an easy way.
|
|
120
122
|
|
|
121
123
|
Home page:
|
package/dist/matterbridge.js
CHANGED
|
@@ -17,12 +17,13 @@ import { logInterfaces, wait, waiter, createZip, copyDirectory, getParameter, ge
|
|
|
17
17
|
import { PluginManager } from './pluginManager.js';
|
|
18
18
|
import { DeviceManager } from './deviceManager.js';
|
|
19
19
|
import { MatterbridgeEndpoint } from './matterbridgeEndpoint.js';
|
|
20
|
-
import { DeviceTypeId, Logger, LogLevel as MatterLogLevel, LogFormat as MatterLogFormat, VendorId, StorageManager, EndpointServer } from '@matter/main';
|
|
20
|
+
import { DeviceTypeId, Logger, LogLevel as MatterLogLevel, LogFormat as MatterLogFormat, VendorId, StorageManager, EndpointServer, StorageService, Environment } from '@matter/main';
|
|
21
21
|
import { BasicInformationCluster, BridgedDeviceBasicInformation, BridgedDeviceBasicInformationCluster, FixedLabelCluster, GeneralCommissioning, PowerSourceCluster, SwitchCluster, ThreadNetworkDiagnosticsCluster, UserLabelCluster, } from '@matter/main/clusters';
|
|
22
22
|
import { getClusterNameById, ManualPairingCodeCodec, QrCodeSchema } from '@matter/main/types';
|
|
23
23
|
import { StorageBackendDisk, StorageBackendJsonFile } from '@matter/nodejs';
|
|
24
24
|
import { CommissioningController, CommissioningServer, MatterServer } from '@project-chip/matter.js';
|
|
25
25
|
import { Aggregator, DeviceTypes, NodeStateInformation } from '@project-chip/matter.js/device';
|
|
26
|
+
import { aggregator } from './matterbridgeDeviceTypes.js';
|
|
26
27
|
const plg = '\u001B[38;5;33m';
|
|
27
28
|
const dev = '\u001B[38;5;79m';
|
|
28
29
|
const typ = '\u001B[38;5;207m';
|
|
@@ -1539,7 +1540,110 @@ export class Matterbridge extends EventEmitter {
|
|
|
1539
1540
|
}
|
|
1540
1541
|
}
|
|
1541
1542
|
this.log.debug(`Creating commissioning server context for ${plg}Matterbridge${db}`);
|
|
1542
|
-
this.matterbridgeContext = await this.createCommissioningServerContext('Matterbridge', 'Matterbridge',
|
|
1543
|
+
this.matterbridgeContext = await this.createCommissioningServerContext('Matterbridge', 'Matterbridge', aggregator.code, 0xfff1, 'Matterbridge', 0x8000, 'Matterbridge aggregator');
|
|
1544
|
+
await this.matterbridgeContext.set('port', this.port);
|
|
1545
|
+
await this.matterbridgeContext.set('passcode', this.passcode);
|
|
1546
|
+
await this.matterbridgeContext.set('discriminator', this.discriminator);
|
|
1547
|
+
}
|
|
1548
|
+
async convertStorage(context, pluginName) {
|
|
1549
|
+
if (!this.matterbridgeContext)
|
|
1550
|
+
return;
|
|
1551
|
+
const storageService = Environment.default.get(StorageService);
|
|
1552
|
+
Environment.default.vars.set('path.root', path.join(this.matterbridgeDirectory, 'matterstorage' + (this.profile ? '.' + this.profile : '')));
|
|
1553
|
+
const nodeStorage = await storageService.open('Matterbridge');
|
|
1554
|
+
if ((await nodeStorage.createContext('persist').get('upgraded', false)) === true) {
|
|
1555
|
+
this.log.info(`Matter node storage already upgraded to Matterbridge edge for ${plg}Matterbridge${nf}`);
|
|
1556
|
+
return;
|
|
1557
|
+
}
|
|
1558
|
+
else {
|
|
1559
|
+
this.log.info(`Upgrading matter node storage to Matterbridge edge for ${plg}Matterbridge${nf}`);
|
|
1560
|
+
}
|
|
1561
|
+
const fabricManagerContext = this.matterbridgeContext.createContext('FabricManager');
|
|
1562
|
+
const fabrics = (await fabricManagerContext.get('fabrics', []));
|
|
1563
|
+
const nextFabricIndex = await fabricManagerContext.get('nextFabricIndex', 1);
|
|
1564
|
+
const eventHandlerContext = this.matterbridgeContext.createContext('EventHandler');
|
|
1565
|
+
const sessionManagerContext = this.matterbridgeContext.createContext('SessionManager');
|
|
1566
|
+
const endpointStructureContext = this.matterbridgeContext.createContext('EndpointStructure');
|
|
1567
|
+
const generalCommissioningContext = this.matterbridgeContext.createContext('Cluster-0-48');
|
|
1568
|
+
const basicInformationContext = this.matterbridgeContext.createContext('Cluster-0-40');
|
|
1569
|
+
const fabricInfo = {};
|
|
1570
|
+
const fabricInfoArray = [];
|
|
1571
|
+
const nocArray = [];
|
|
1572
|
+
const trcArray = [];
|
|
1573
|
+
const aclArray = [];
|
|
1574
|
+
this.log.debug(`Found ${CYAN}${fabrics.length}${db} fabrics (nextFabricIndex ${CYAN}${nextFabricIndex}${db}) for ${plg}Matterbridge${db}:`);
|
|
1575
|
+
for (const fabric of fabrics) {
|
|
1576
|
+
this.log.debug(`- fabricIndex ${CYAN}${fabric.fabricIndex}${db} fabricId ${CYAN}${fabric.fabricId}${db} nodeId ${CYAN}${fabric.nodeId}${db} rootNodeId ${CYAN}${fabric.rootNodeId}${db} rootVendorId ${CYAN}${fabric.rootVendorId}${db} label ${CYAN}${fabric.label}${db}`);
|
|
1577
|
+
fabricInfo[fabric.fabricIndex] = {
|
|
1578
|
+
fabricIndex: fabric.fabricIndex,
|
|
1579
|
+
fabricId: fabric.fabricId,
|
|
1580
|
+
nodeId: fabric.nodeId,
|
|
1581
|
+
rootNodeId: fabric.rootNodeId,
|
|
1582
|
+
rootVendorId: fabric.rootVendorId,
|
|
1583
|
+
label: fabric.label,
|
|
1584
|
+
};
|
|
1585
|
+
fabricInfoArray.push({
|
|
1586
|
+
fabricIndex: fabric.fabricIndex,
|
|
1587
|
+
fabricId: fabric.fabricId,
|
|
1588
|
+
nodeId: fabric.nodeId,
|
|
1589
|
+
vendorId: fabric.rootVendorId,
|
|
1590
|
+
rootPublicKey: fabric.rootPublicKey,
|
|
1591
|
+
label: fabric.label,
|
|
1592
|
+
});
|
|
1593
|
+
nocArray.push({ noc: fabric.operationalCert, icac: null, fabricIndex: fabric.fabricIndex });
|
|
1594
|
+
trcArray.push('{\"__object__\":\"Uint8Array\",\"__value__\":\"' + Buffer.from(fabric.rootCert).toString('hex') + '\"}');
|
|
1595
|
+
aclArray.push({ fabricIndex: fabric.fabricIndex, privilege: 5, authMode: 2, subjects: ['{\"__object__\":\"BigInt\",\"__value__\":\"' + fabric.rootNodeId.toString().replace('n', '') + '\"}'], targets: null });
|
|
1596
|
+
}
|
|
1597
|
+
await nodeStorage.createContext('fabrics').set('fabrics', fabrics);
|
|
1598
|
+
await nodeStorage.createContext('fabrics').set('nextFabricIndex', nextFabricIndex);
|
|
1599
|
+
await nodeStorage.createContext('sessions').set('resumptionRecords', await sessionManagerContext.get('resumptionRecords', []));
|
|
1600
|
+
await nodeStorage.createContext('events').set('lastEventNumber', await eventHandlerContext.get('lastEventNumber', 1));
|
|
1601
|
+
await nodeStorage.createContext('root').set('__number__', 0);
|
|
1602
|
+
await nodeStorage.createContext('root').set('__nextNumber__', 1);
|
|
1603
|
+
await nodeStorage.createContext('root').createContext('commissioning').set('enabled', true);
|
|
1604
|
+
await nodeStorage.createContext('root').createContext('commissioning').set('commissioned', true);
|
|
1605
|
+
await nodeStorage.createContext('root').createContext('commissioning').set('fabrics', fabricInfo);
|
|
1606
|
+
await nodeStorage.createContext('root').createContext('operationalCredentials').set('commissionedFabrics', fabricInfoArray.length);
|
|
1607
|
+
await nodeStorage.createContext('root').createContext('operationalCredentials').set('fabrics', fabricInfoArray);
|
|
1608
|
+
await nodeStorage.createContext('root').createContext('operationalCredentials').set('nocs', nocArray);
|
|
1609
|
+
await nodeStorage.createContext('root').createContext('operationalCredentials').set('trustedRootCertificates', trcArray);
|
|
1610
|
+
await nodeStorage.createContext('root').createContext('accessControl').set('acl', aclArray);
|
|
1611
|
+
await nodeStorage
|
|
1612
|
+
.createContext('root')
|
|
1613
|
+
.createContext('generalCommissioning')
|
|
1614
|
+
.set('breadcrumb', await generalCommissioningContext.get('breadcrumb', BigInt(0)));
|
|
1615
|
+
await nodeStorage
|
|
1616
|
+
.createContext('root')
|
|
1617
|
+
.createContext('basicInformation')
|
|
1618
|
+
.set('location', await basicInformationContext.get('location', 'XX'));
|
|
1619
|
+
await nodeStorage.createContext('root').createContext('network').set('ble', false);
|
|
1620
|
+
await nodeStorage.createContext('root').createContext('network').set('operationalPort', 5540);
|
|
1621
|
+
await nodeStorage.createContext('root').createContext('productDescription').set('productId', 0x8000);
|
|
1622
|
+
await nodeStorage.createContext('root').createContext('productDescription').set('vendorId', 0xfff1);
|
|
1623
|
+
for (const key of await endpointStructureContext.keys()) {
|
|
1624
|
+
if (key === 'nextEndpointId')
|
|
1625
|
+
continue;
|
|
1626
|
+
const parts = key.split('-');
|
|
1627
|
+
const number = await endpointStructureContext.get(key);
|
|
1628
|
+
if (parts.length === 2) {
|
|
1629
|
+
this.log.debug(`Converting Matterbridge.EndpointStructure:${key}:${number} to root.parts.Matterbridge.__number__:${number}`);
|
|
1630
|
+
await nodeStorage.createContext('root').createContext('parts').createContext('Matterbridge').set('__number__', number);
|
|
1631
|
+
}
|
|
1632
|
+
else if (parts.length === 3 && parts[2].startsWith('custom_')) {
|
|
1633
|
+
this.log.debug(`Converting Matterbridge.EndpointStructure:${key}:${number} to root.parts.Matterbridge.parts.${parts[2].replace('custom_', '')}.__number__:${number}`);
|
|
1634
|
+
await nodeStorage.createContext('root').createContext('parts').createContext('Matterbridge').createContext('parts').createContext(parts[2].replace('custom_', '')).set('__number__', number);
|
|
1635
|
+
}
|
|
1636
|
+
else if (parts.length === 3 && parts[2].startsWith('unique_')) {
|
|
1637
|
+
const device = this.devices.get(parts[2].replace('unique_', ''));
|
|
1638
|
+
if (device && device.deviceName && device.maybeNumber) {
|
|
1639
|
+
this.log.debug(`Converting Matterbridge.EndpointStructure:${key}:${number} to root.parts.Matterbridge.parts.${device.deviceName.replace(/[ .]/g, '')}.__number__:${device.maybeNumber}`);
|
|
1640
|
+
await nodeStorage.createContext('root').createContext('parts').createContext('Matterbridge').createContext('parts').createContext(device.deviceName.replace(/[ .]/g, '')).set('__number__', device.maybeNumber);
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
await nodeStorage.createContext('root').createContext('parts').createContext('Matterbridge').set('__number__', 1);
|
|
1645
|
+
await nodeStorage.createContext('persist').set('upgraded', true);
|
|
1646
|
+
await this.matterbridgeContext.set('upgraded', true);
|
|
1543
1647
|
}
|
|
1544
1648
|
async backupMatterStorage(storageName, backupName) {
|
|
1545
1649
|
try {
|
|
@@ -30,6 +30,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
30
30
|
firstDefinition = definition[0];
|
|
31
31
|
else
|
|
32
32
|
firstDefinition = definition;
|
|
33
|
+
options.uniqueStorageKey?.replace(/[ .]/g, '');
|
|
33
34
|
super(firstDefinition, options);
|
|
34
35
|
this.log = new AnsiLogger({ logName: 'MatterbridgeDevice', logTimestampFormat: 4, logLevel: debug === true ? "debug" : MatterbridgeDevice.logLevel });
|
|
35
36
|
this.log.debug(`new MatterbridgeDevice with deviceType: ${zb}${firstDefinition.code}${db}-${zb}${firstDefinition.name}${db}`);
|
|
@@ -430,10 +431,12 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
430
431
|
}
|
|
431
432
|
createDefaultGroupsClusterServer() {
|
|
432
433
|
this.addClusterServer(this.getDefaultGroupsClusterServer());
|
|
434
|
+
return this;
|
|
433
435
|
}
|
|
434
436
|
getDefaultScenesClusterServer() {
|
|
435
437
|
}
|
|
436
438
|
createDefaultScenesClusterServer() {
|
|
439
|
+
return this;
|
|
437
440
|
}
|
|
438
441
|
createUniqueId(param1, param2, param3, param4) {
|
|
439
442
|
const hash = createHash('md5');
|
|
@@ -487,6 +490,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
487
490
|
return;
|
|
488
491
|
}
|
|
489
492
|
this.addClusterServer(this.getDefaultBasicInformationClusterServer(deviceName, serialNumber, vendorId, vendorName, productId, productName, softwareVersion, softwareVersionString, hardwareVersion, hardwareVersionString));
|
|
493
|
+
return this;
|
|
490
494
|
}
|
|
491
495
|
getDefaultBridgedDeviceBasicInformationClusterServer(deviceName, serialNumber, vendorId, vendorName, productName, softwareVersion = 1, softwareVersionString = '1.0.0', hardwareVersion = 1, hardwareVersionString = '1.0.0') {
|
|
492
496
|
this.log.logName = deviceName;
|
|
@@ -524,6 +528,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
524
528
|
}
|
|
525
529
|
createDefaultBridgedDeviceBasicInformationClusterServer(deviceName, serialNumber, vendorId, vendorName, productName, softwareVersion = 1, softwareVersionString = '1.0.0', hardwareVersion = 1, hardwareVersionString = '1.0.0') {
|
|
526
530
|
this.addClusterServer(this.getDefaultBridgedDeviceBasicInformationClusterServer(deviceName, serialNumber, vendorId, vendorName, productName, softwareVersion, softwareVersionString, hardwareVersion, hardwareVersionString));
|
|
531
|
+
return this;
|
|
527
532
|
}
|
|
528
533
|
getDefaultPowerTopologyClusterServer() {
|
|
529
534
|
return ClusterServer(PowerTopologyCluster.with(PowerTopology.Feature.TreeTopology), {}, {}, {});
|
|
@@ -647,6 +652,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
647
652
|
}
|
|
648
653
|
createDefaultOnOffClusterServer(onOff = false, globalSceneControl = false, onTime = 0, offWaitTime = 0, startUpOnOff = null) {
|
|
649
654
|
this.addClusterServer(this.getDefaultOnOffClusterServer(onOff, globalSceneControl, onTime, offWaitTime, startUpOnOff));
|
|
655
|
+
return this;
|
|
650
656
|
}
|
|
651
657
|
getDeadFrontOnOffClusterServer(onOff = false) {
|
|
652
658
|
return ClusterServer(OnOffCluster.with(OnOff.Feature.DeadFrontBehavior), {
|
|
@@ -668,6 +674,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
668
674
|
}
|
|
669
675
|
createDeadFrontOnOffClusterServer(onOff = false) {
|
|
670
676
|
this.addClusterServer(this.getDeadFrontOnOffClusterServer(onOff));
|
|
677
|
+
return this;
|
|
671
678
|
}
|
|
672
679
|
getOnOffClusterServer(onOff = false) {
|
|
673
680
|
return ClusterServer(OnOffCluster, {
|
|
@@ -689,6 +696,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
689
696
|
}
|
|
690
697
|
createOnOffClusterServer(onOff = false) {
|
|
691
698
|
this.addClusterServer(this.getOnOffClusterServer(onOff));
|
|
699
|
+
return this;
|
|
692
700
|
}
|
|
693
701
|
getDefaultLevelControlClusterServer(currentLevel = 254, minLevel = 1, maxLevel = 254, onLevel = null, startUpCurrentLevel = null) {
|
|
694
702
|
return ClusterServer(LevelControlCluster.with(LevelControl.Feature.OnOff, LevelControl.Feature.Lighting), {
|
|
@@ -733,6 +741,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
733
741
|
}
|
|
734
742
|
createDefaultLevelControlClusterServer(currentLevel = 254, minLevel = 1, maxLevel = 254, onLevel = null, startUpCurrentLevel = null) {
|
|
735
743
|
this.addClusterServer(this.getDefaultLevelControlClusterServer(currentLevel, minLevel, maxLevel, onLevel, startUpCurrentLevel));
|
|
744
|
+
return this;
|
|
736
745
|
}
|
|
737
746
|
getDefaultColorControlClusterServer(currentX = 0, currentY = 0, currentHue = 0, currentSaturation = 0, colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
738
747
|
return ClusterServer(ColorControlCluster.with(ColorControl.Feature.Xy, ColorControl.Feature.HueSaturation, ColorControl.Feature.ColorTemperature), {
|
|
@@ -805,6 +814,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
805
814
|
}
|
|
806
815
|
createDefaultColorControlClusterServer(currentX = 0, currentY = 0, currentHue = 0, currentSaturation = 0, colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
807
816
|
this.addClusterServer(this.getDefaultColorControlClusterServer(currentX, currentY, currentHue, currentSaturation, colorTemperatureMireds, colorTempPhysicalMinMireds, colorTempPhysicalMaxMireds));
|
|
817
|
+
return this;
|
|
808
818
|
}
|
|
809
819
|
getXyColorControlClusterServer(currentX = 0, currentY = 0, colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
810
820
|
return ClusterServer(ColorControlCluster.with(ColorControl.Feature.Xy, ColorControl.Feature.ColorTemperature), {
|
|
@@ -851,6 +861,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
851
861
|
}
|
|
852
862
|
createXyColorControlClusterServer(currentX = 0, currentY = 0, colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
853
863
|
this.addClusterServer(this.getXyColorControlClusterServer(currentX, currentY, colorTemperatureMireds, colorTempPhysicalMinMireds, colorTempPhysicalMaxMireds));
|
|
864
|
+
return this;
|
|
854
865
|
}
|
|
855
866
|
getHsColorControlClusterServer(currentHue = 0, currentSaturation = 0, colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
856
867
|
return ClusterServer(ColorControlCluster.with(ColorControl.Feature.HueSaturation, ColorControl.Feature.ColorTemperature), {
|
|
@@ -911,6 +922,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
911
922
|
}
|
|
912
923
|
createHsColorControlClusterServer(currentHue = 0, currentSaturation = 0, colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
913
924
|
this.addClusterServer(this.getHsColorControlClusterServer(currentHue, currentSaturation, colorTemperatureMireds, colorTempPhysicalMinMireds, colorTempPhysicalMaxMireds));
|
|
925
|
+
return this;
|
|
914
926
|
}
|
|
915
927
|
getCtColorControlClusterServer(colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
916
928
|
return ClusterServer(ColorControlCluster.with(ColorControl.Feature.ColorTemperature), {
|
|
@@ -945,6 +957,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
945
957
|
}
|
|
946
958
|
createCtColorControlClusterServer(colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
947
959
|
this.addClusterServer(this.getCtColorControlClusterServer(colorTemperatureMireds, colorTempPhysicalMinMireds, colorTempPhysicalMaxMireds));
|
|
960
|
+
return this;
|
|
948
961
|
}
|
|
949
962
|
configureColorControlCluster(hueSaturation, xy, colorTemperature, colorMode, endpoint) {
|
|
950
963
|
if (!endpoint)
|
|
@@ -955,6 +968,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
955
968
|
endpoint.getClusterServer(ColorControlCluster)?.setColorModeAttribute(colorMode);
|
|
956
969
|
endpoint.getClusterServer(ColorControlCluster)?.setEnhancedColorModeAttribute(colorMode);
|
|
957
970
|
}
|
|
971
|
+
return this;
|
|
958
972
|
}
|
|
959
973
|
configureColorControlMode(colorMode, endpoint) {
|
|
960
974
|
if (!endpoint)
|
|
@@ -963,6 +977,7 @@ export class MatterbridgeDevice extends extendPublicHandlerMethods(Device) {
|
|
|
963
977
|
endpoint.getClusterServer(ColorControlCluster)?.setColorModeAttribute(colorMode);
|
|
964
978
|
endpoint.getClusterServer(ColorControlCluster)?.setEnhancedColorModeAttribute(colorMode);
|
|
965
979
|
}
|
|
980
|
+
return this;
|
|
966
981
|
}
|
|
967
982
|
getDefaultWindowCoveringClusterServer(positionPercent100ths) {
|
|
968
983
|
return ClusterServer(WindowCoveringCluster.with(WindowCovering.Feature.Lift, WindowCovering.Feature.PositionAwareLift), {
|
package/dist/matterbridgeEdge.js
CHANGED
|
@@ -272,8 +272,8 @@ export class MatterbridgeEdge extends Matterbridge {
|
|
|
272
272
|
}
|
|
273
273
|
async createAggregatorNode(storageContext) {
|
|
274
274
|
this.log.notice(`Creating ${await storageContext.get('storeId')} aggregator `);
|
|
275
|
-
const
|
|
276
|
-
return
|
|
275
|
+
const aggregatorNode = new EndpointNode(AggregatorEndpoint, { id: `${await storageContext.get('storeId')}` });
|
|
276
|
+
return aggregatorNode;
|
|
277
277
|
}
|
|
278
278
|
async addBridgedEndpoint(pluginName, device) {
|
|
279
279
|
const plugin = this.plugins.get(pluginName);
|
|
@@ -690,10 +690,12 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
690
690
|
}
|
|
691
691
|
createDefaultGroupsClusterServer() {
|
|
692
692
|
this.addClusterServer(this.getDefaultGroupsClusterServer());
|
|
693
|
+
return this;
|
|
693
694
|
}
|
|
694
695
|
getDefaultScenesClusterServer() {
|
|
695
696
|
}
|
|
696
697
|
createDefaultScenesClusterServer() {
|
|
698
|
+
return this;
|
|
697
699
|
}
|
|
698
700
|
createUniqueId(param1, param2, param3, param4) {
|
|
699
701
|
const hash = createHash('md5');
|
|
@@ -747,6 +749,7 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
747
749
|
return;
|
|
748
750
|
}
|
|
749
751
|
this.addClusterServer(this.getDefaultBasicInformationClusterServer(deviceName, serialNumber, vendorId, vendorName, productId, productName, softwareVersion, softwareVersionString, hardwareVersion, hardwareVersionString));
|
|
752
|
+
return this;
|
|
750
753
|
}
|
|
751
754
|
getDefaultBridgedDeviceBasicInformationClusterServer(deviceName, serialNumber, vendorId, vendorName, productName, softwareVersion = 1, softwareVersionString = '1.0.0', hardwareVersion = 1, hardwareVersionString = '1.0.0') {
|
|
752
755
|
this.log.logName = deviceName;
|
|
@@ -784,6 +787,7 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
784
787
|
}
|
|
785
788
|
createDefaultBridgedDeviceBasicInformationClusterServer(deviceName, serialNumber, vendorId, vendorName, productName, softwareVersion = 1, softwareVersionString = '1.0.0', hardwareVersion = 1, hardwareVersionString = '1.0.0') {
|
|
786
789
|
this.addClusterServer(this.getDefaultBridgedDeviceBasicInformationClusterServer(deviceName, serialNumber, vendorId, vendorName, productName, softwareVersion, softwareVersionString, hardwareVersion, hardwareVersionString));
|
|
790
|
+
return this;
|
|
787
791
|
}
|
|
788
792
|
getDefaultPowerTopologyClusterServer() {
|
|
789
793
|
return ClusterServer(PowerTopologyCluster.with(PowerTopology.Feature.TreeTopology), {}, {}, {});
|
|
@@ -868,6 +872,7 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
868
872
|
}
|
|
869
873
|
createDefaultOnOffClusterServer(onOff = false, globalSceneControl = false, onTime = 0, offWaitTime = 0, startUpOnOff = null) {
|
|
870
874
|
this.addClusterServer(this.getDefaultOnOffClusterServer(onOff, globalSceneControl, onTime, offWaitTime, startUpOnOff));
|
|
875
|
+
return this;
|
|
871
876
|
}
|
|
872
877
|
getOnOffClusterServer(onOff = false) {
|
|
873
878
|
return ClusterServer(OnOffCluster, {
|
|
@@ -883,6 +888,7 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
883
888
|
}
|
|
884
889
|
createOnOffClusterServer(onOff = false) {
|
|
885
890
|
this.addClusterServer(this.getOnOffClusterServer(onOff));
|
|
891
|
+
return this;
|
|
886
892
|
}
|
|
887
893
|
getDeadFrontOnOffClusterServer(onOff = false) {
|
|
888
894
|
return ClusterServer(OnOffCluster.with(OnOff.Feature.DeadFrontBehavior), {
|
|
@@ -898,6 +904,7 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
898
904
|
}
|
|
899
905
|
createDeadFrontOnOffClusterServer(onOff = false) {
|
|
900
906
|
this.addClusterServer(this.getDeadFrontOnOffClusterServer(onOff));
|
|
907
|
+
return this;
|
|
901
908
|
}
|
|
902
909
|
getDefaultLevelControlClusterServer(currentLevel = 254, minLevel = 1, maxLevel = 254, onLevel = null, startUpCurrentLevel = null) {
|
|
903
910
|
return ClusterServer(LevelControlCluster.with(LevelControl.Feature.OnOff, LevelControl.Feature.Lighting), {
|
|
@@ -932,6 +939,7 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
932
939
|
}
|
|
933
940
|
createDefaultLevelControlClusterServer(currentLevel = 254, minLevel = 1, maxLevel = 254, onLevel = null, startUpCurrentLevel = null) {
|
|
934
941
|
this.addClusterServer(this.getDefaultLevelControlClusterServer(currentLevel, minLevel, maxLevel, onLevel, startUpCurrentLevel));
|
|
942
|
+
return this;
|
|
935
943
|
}
|
|
936
944
|
getDefaultColorControlClusterServer(currentX = 0, currentY = 0, currentHue = 0, currentSaturation = 0, colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
937
945
|
return ClusterServer(ColorControlCluster.with(ColorControl.Feature.Xy, ColorControl.Feature.HueSaturation, ColorControl.Feature.ColorTemperature), {
|
|
@@ -985,6 +993,7 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
985
993
|
}
|
|
986
994
|
createDefaultColorControlClusterServer(currentX = 0, currentY = 0, currentHue = 0, currentSaturation = 0, colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
987
995
|
this.addClusterServer(this.getDefaultColorControlClusterServer(currentX, currentY, currentHue, currentSaturation, colorTemperatureMireds, colorTempPhysicalMinMireds, colorTempPhysicalMaxMireds));
|
|
996
|
+
return this;
|
|
988
997
|
}
|
|
989
998
|
getXyColorControlClusterServer(currentX = 0, currentY = 0, colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
990
999
|
return ClusterServer(ColorControlCluster.with(ColorControl.Feature.Xy, ColorControl.Feature.ColorTemperature), {
|
|
@@ -1022,6 +1031,7 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1022
1031
|
}
|
|
1023
1032
|
createXyColorControlClusterServer(currentX = 0, currentY = 0, colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
1024
1033
|
this.addClusterServer(this.getXyColorControlClusterServer(currentX, currentY, colorTemperatureMireds, colorTempPhysicalMinMireds, colorTempPhysicalMaxMireds));
|
|
1034
|
+
return this;
|
|
1025
1035
|
}
|
|
1026
1036
|
getHsColorControlClusterServer(currentHue = 0, currentSaturation = 0, colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
1027
1037
|
return ClusterServer(ColorControlCluster.with(ColorControl.Feature.HueSaturation, ColorControl.Feature.ColorTemperature), {
|
|
@@ -1067,6 +1077,7 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1067
1077
|
}
|
|
1068
1078
|
createHsColorControlClusterServer(currentHue = 0, currentSaturation = 0, colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
1069
1079
|
this.addClusterServer(this.getHsColorControlClusterServer(currentHue, currentSaturation, colorTemperatureMireds, colorTempPhysicalMinMireds, colorTempPhysicalMaxMireds));
|
|
1080
|
+
return this;
|
|
1070
1081
|
}
|
|
1071
1082
|
getCtColorControlClusterServer(colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
1072
1083
|
return ClusterServer(ColorControlCluster.with(ColorControl.Feature.ColorTemperature), {
|
|
@@ -1096,6 +1107,7 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1096
1107
|
}
|
|
1097
1108
|
createCtColorControlClusterServer(colorTemperatureMireds = 500, colorTempPhysicalMinMireds = 147, colorTempPhysicalMaxMireds = 500) {
|
|
1098
1109
|
this.addClusterServer(this.getCtColorControlClusterServer(colorTemperatureMireds, colorTempPhysicalMinMireds, colorTempPhysicalMaxMireds));
|
|
1110
|
+
return this;
|
|
1099
1111
|
}
|
|
1100
1112
|
isColorControlConfigured = false;
|
|
1101
1113
|
async configureColorControlCluster(hueSaturation, xy, colorTemperature, colorMode, endpoint) {
|
|
@@ -1119,6 +1131,7 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1119
1131
|
await endpoint.setAttribute(ColorControlCluster.id, 'enhancedColorMode', colorMode, this.log, endpoint);
|
|
1120
1132
|
}
|
|
1121
1133
|
this.isColorControlConfigured = true;
|
|
1134
|
+
return this;
|
|
1122
1135
|
}
|
|
1123
1136
|
async configureColorControlMode(colorMode, endpoint) {
|
|
1124
1137
|
if (!endpoint)
|
|
@@ -1127,6 +1140,7 @@ export class MatterbridgeEndpoint extends Endpoint {
|
|
|
1127
1140
|
await endpoint.setAttribute(ColorControlCluster.id, 'colorMode', colorMode, this.log, endpoint);
|
|
1128
1141
|
await endpoint.setAttribute(ColorControlCluster.id, 'enhancedColorMode', colorMode, this.log, endpoint);
|
|
1129
1142
|
}
|
|
1143
|
+
return this;
|
|
1130
1144
|
}
|
|
1131
1145
|
getDefaultWindowCoveringClusterServer(positionPercent100ths) {
|
|
1132
1146
|
return ClusterServer(WindowCoveringCluster.with(WindowCovering.Feature.Lift, WindowCovering.Feature.PositionAwareLift), {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matterbridge",
|
|
3
|
-
"version": "1.6.8-dev.
|
|
3
|
+
"version": "1.6.8-dev.4",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "matterbridge",
|
|
9
|
-
"version": "1.6.8-dev.
|
|
9
|
+
"version": "1.6.8-dev.4",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@matter/main": "0.11.9",
|
|
@@ -652,12 +652,12 @@
|
|
|
652
652
|
}
|
|
653
653
|
},
|
|
654
654
|
"node_modules/dunder-proto": {
|
|
655
|
-
"version": "1.0.
|
|
656
|
-
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.
|
|
657
|
-
"integrity": "sha512-
|
|
655
|
+
"version": "1.0.1",
|
|
656
|
+
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
|
|
657
|
+
"integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
|
|
658
658
|
"license": "MIT",
|
|
659
659
|
"dependencies": {
|
|
660
|
-
"call-bind-apply-helpers": "^1.0.
|
|
660
|
+
"call-bind-apply-helpers": "^1.0.1",
|
|
661
661
|
"es-errors": "^1.3.0",
|
|
662
662
|
"gopd": "^1.2.0"
|
|
663
663
|
},
|