matterbridge-example-dynamic-platform 3.0.4-dev-20260905-cd9c2f3 → 3.0.4-dev-20260906-2c181fe
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.md +2 -1
- package/dist/module.js +31 -5
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -35,6 +35,11 @@ If you like this project and find it useful, please consider giving it a star on
|
|
|
35
35
|
|
|
36
36
|
- [matterbridge]: Require matterbridge v.3.10.8 with matter v.1.6.0.
|
|
37
37
|
|
|
38
|
+
### Added
|
|
39
|
+
|
|
40
|
+
- [platform]: Add `RfidLock` device: a door lock with the User, PinCredential, and RfidCredential (RID) features, testing the `numberOfRfidUsersSupported` parameter of `createUserPinDoorLockClusterServer()` (Matter 1.6.0 § 5.2.4). `SetCredential`, `GetCredentialStatus`, and `ClearCredential` already handle `DoorLock.CredentialType.Rfid` generically in `MatterbridgeDoorLockServer`, so no RFID-specific command handlers were needed for this device.
|
|
41
|
+
- [Oven]/[Refrigerator]: Add a `TemperatureAlarm` example to the demo cabinets.
|
|
42
|
+
|
|
38
43
|
### Changed
|
|
39
44
|
|
|
40
45
|
- [package]: Upgrade package.
|
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
Matterbridge dynamic platform example plugin is a template to develop your own plugin using the dynamic platform.
|
|
25
25
|
|
|
26
|
-
It exposes
|
|
26
|
+
It exposes 78 virtual devices:
|
|
27
27
|
|
|
28
28
|
- a door contact sensor
|
|
29
29
|
- a motion sensor
|
|
@@ -51,6 +51,7 @@ It exposes 77 virtual devices:
|
|
|
51
51
|
- a lock with doorLock cluster
|
|
52
52
|
- a lock with doorLock cluster and User and PinCredential support (userPinLock)
|
|
53
53
|
- a lock with doorLock cluster, User and PinCredential support, and WeekDay, YearDay and Holiday access schedules (scheduleLock)
|
|
54
|
+
- a lock with doorLock cluster, User and PinCredential support, and RfidCredential support (DoorLock.Feature.RfidCredential) via the numberOfRfidUsersSupported attribute (rfidLock)
|
|
54
55
|
- a thermostat auto mode (i.e. with Auto Heat and Cool features) with thermostat cluster and 3 sub endpoints with flowMeasurement cluster, temperatureMeasurement cluster
|
|
55
56
|
and relativeHumidityMeasurement cluster (to show how to create a composed device with sub endpoints)
|
|
56
57
|
- a thermostat with auto mode (i.e. with Auto Heat and Cool features), occupancy and outdoorTemperature
|
package/dist/module.js
CHANGED
|
@@ -46,6 +46,7 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
|
46
46
|
lock;
|
|
47
47
|
userPinLock;
|
|
48
48
|
scheduleLock;
|
|
49
|
+
rfidLock;
|
|
49
50
|
thermoAuto;
|
|
50
51
|
thermoAutoOccupancy;
|
|
51
52
|
thermoAutoPresets;
|
|
@@ -887,6 +888,25 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
|
887
888
|
this.scheduleLock?.subscribeAttribute(DoorLock, 'operatingMode', (value) => {
|
|
888
889
|
this.scheduleLock?.log.info(`Subscribe operatingMode called with: ${getEnumDescription(DoorLock.OperatingMode, value)}`);
|
|
889
890
|
}, this.scheduleLock.log);
|
|
891
|
+
this.rfidLock = new MatterbridgeEndpoint([doorLock, bridgedNode, powerSource], { id: 'RfidLock' }, this.config.debug)
|
|
892
|
+
.createDefaultIdentifyClusterServer()
|
|
893
|
+
.createDefaultBridgedDeviceBasicInformationClusterServer('Lock with RFID', 'LRF00090', 0xfff1, 'Matterbridge', 'Matterbridge Lock')
|
|
894
|
+
.createUserPinDoorLockClusterServer(DoorLock.LockState.Locked, DoorLock.LockType.DeadBolt, 0, 4, 10, undefined, undefined, undefined, undefined, 10)
|
|
895
|
+
.createDefaultPowerSourceRechargeableBatteryClusterServer(95)
|
|
896
|
+
.addRequiredClusterServers();
|
|
897
|
+
this.rfidLock = await this.addDevice(this.rfidLock);
|
|
898
|
+
this.rfidLock?.addCommandHandler('Identify.identify', ({ request: { identifyTime } }) => {
|
|
899
|
+
this.rfidLock?.log.info(`Command identify called identifyTime:${identifyTime}`);
|
|
900
|
+
});
|
|
901
|
+
this.rfidLock?.addCommandHandler('DoorLock.lockDoor', () => {
|
|
902
|
+
this.rfidLock?.log.info('Command lockDoor called');
|
|
903
|
+
});
|
|
904
|
+
this.rfidLock?.addCommandHandler('DoorLock.unlockDoor', () => {
|
|
905
|
+
this.rfidLock?.log.info('Command unlockDoor called');
|
|
906
|
+
});
|
|
907
|
+
this.rfidLock?.subscribeAttribute(DoorLock, 'operatingMode', (value) => {
|
|
908
|
+
this.rfidLock?.log.info(`Subscribe operatingMode called with: ${getEnumDescription(DoorLock.OperatingMode, value)}`);
|
|
909
|
+
}, this.rfidLock.log);
|
|
890
910
|
this.thermoAuto = new MatterbridgeEndpoint([thermostat, bridgedNode, powerSource], { id: 'Thermostat (AutoMode)' }, this.config.debug)
|
|
891
911
|
.createDefaultIdentifyClusterServer()
|
|
892
912
|
.createDefaultBridgedDeviceBasicInformationClusterServer('Thermostat (Auto)', 'TAU00023', 0xfff1, 'Matterbridge', 'Matterbridge Thermostat')
|
|
@@ -1736,7 +1756,7 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
|
1736
1756
|
this.microwaveOven = new MicrowaveOven('Microwave Oven', 'MWO00053');
|
|
1737
1757
|
this.microwaveOven = await this.addDevice(this.microwaveOven);
|
|
1738
1758
|
this.oven = new Oven('Oven', 'OVN00054');
|
|
1739
|
-
this.oven.addCabinet('Upper Cabinet', {
|
|
1759
|
+
const ovenUpperCabinet = this.oven.addCabinet('Upper Cabinet', {
|
|
1740
1760
|
tagList: [{ mfgCode: null, namespaceId: CommonPositionTag.Top.namespaceId, tag: CommonPositionTag.Top.tag, label: CommonPositionTag.Top.label }],
|
|
1741
1761
|
currentMode: 2,
|
|
1742
1762
|
supportedModes: [
|
|
@@ -1760,7 +1780,8 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
|
1760
1780
|
currentPhase: 2,
|
|
1761
1781
|
phaseList: ['pre-heating', 'pre-heated', 'cooling down'],
|
|
1762
1782
|
});
|
|
1763
|
-
|
|
1783
|
+
ovenUpperCabinet.createDefaultTemperatureAlarmClusterServer(280_00);
|
|
1784
|
+
const ovenLowerCabinet = this.oven.addCabinet('Lower Cabinet', {
|
|
1764
1785
|
tagList: [{ mfgCode: null, namespaceId: CommonPositionTag.Bottom.namespaceId, tag: CommonPositionTag.Bottom.tag, label: CommonPositionTag.Bottom.label }],
|
|
1765
1786
|
currentMode: 3,
|
|
1766
1787
|
supportedModes: [
|
|
@@ -1777,6 +1798,7 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
|
1777
1798
|
currentPhase: 1,
|
|
1778
1799
|
phaseList: ['pre-heating', 'pre-heated', 'cooling down'],
|
|
1779
1800
|
});
|
|
1801
|
+
ovenLowerCabinet.createDefaultTemperatureAlarmClusterServer(280_00);
|
|
1780
1802
|
this.oven = await this.addDevice(this.oven);
|
|
1781
1803
|
this.cooktop = new Cooktop('Cooktop', 'CKT00055');
|
|
1782
1804
|
this.cooktop.addSurface('Surface Top Left', {
|
|
@@ -1805,7 +1827,7 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
|
1805
1827
|
});
|
|
1806
1828
|
this.cooktop = await this.addDevice(this.cooktop);
|
|
1807
1829
|
const refrigerator = new Refrigerator('Refrigerator', 'REF00056');
|
|
1808
|
-
refrigerator.addCabinet('Refrigerator Top', {
|
|
1830
|
+
const refrigeratorTopCabinet = refrigerator.addCabinet('Refrigerator Top', {
|
|
1809
1831
|
tagList: [
|
|
1810
1832
|
{ mfgCode: null, namespaceId: CommonPositionTag.Top.namespaceId, tag: CommonPositionTag.Top.tag, label: 'Refrigerator Top' },
|
|
1811
1833
|
{ mfgCode: null, namespaceId: RefrigeratorTag.Refrigerator.namespaceId, tag: RefrigeratorTag.Refrigerator.tag, label: RefrigeratorTag.Refrigerator.label },
|
|
@@ -1816,17 +1838,19 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
|
1816
1838
|
step: 1 * 100,
|
|
1817
1839
|
currentTemperature: 1200,
|
|
1818
1840
|
});
|
|
1819
|
-
|
|
1841
|
+
refrigeratorTopCabinet.createDefaultTemperatureAlarmClusterServer(20_00, 5_00);
|
|
1842
|
+
const freezerBottomCabinet = refrigerator.addCabinet('Freezer Bottom', {
|
|
1820
1843
|
tagList: [
|
|
1821
1844
|
{ mfgCode: null, namespaceId: CommonPositionTag.Bottom.namespaceId, tag: CommonPositionTag.Bottom.tag, label: 'Freezer Bottom' },
|
|
1822
1845
|
{ mfgCode: null, namespaceId: RefrigeratorTag.Freezer.namespaceId, tag: RefrigeratorTag.Freezer.tag, label: RefrigeratorTag.Freezer.label },
|
|
1823
1846
|
],
|
|
1824
1847
|
targetTemperature: -18 * 100,
|
|
1825
|
-
minTemperature: -
|
|
1848
|
+
minTemperature: -25 * 100,
|
|
1826
1849
|
maxTemperature: -10 * 100,
|
|
1827
1850
|
step: 1 * 100,
|
|
1828
1851
|
currentTemperature: -1800,
|
|
1829
1852
|
});
|
|
1853
|
+
freezerBottomCabinet.createDefaultTemperatureAlarmClusterServer(-5_00, -30_00);
|
|
1830
1854
|
this.refrigerator = await this.addDevice(refrigerator);
|
|
1831
1855
|
this.airConditioner = new AirConditioner('Air Conditioner', 'ACO00027', {
|
|
1832
1856
|
localTemperature: 20,
|
|
@@ -2367,6 +2391,8 @@ export class ExampleMatterbridgeDynamicPlatform extends MatterbridgeDynamicPlatf
|
|
|
2367
2391
|
}
|
|
2368
2392
|
await this.scheduleLock?.setAttribute(DoorLock.id, 'lockState', DoorLock.LockState.Locked, this.scheduleLock.log);
|
|
2369
2393
|
this.scheduleLock?.log.info('Set schedule lock initial lockState to Locked');
|
|
2394
|
+
await this.rfidLock?.setAttribute(DoorLock.id, 'lockState', DoorLock.LockState.Locked, this.rfidLock.log);
|
|
2395
|
+
this.rfidLock?.log.info('Set rfid lock initial lockState to Locked');
|
|
2370
2396
|
await this.thermoAuto?.setAttribute(Thermostat.id, 'localTemperature', 16 * 100, this.thermoAuto.log);
|
|
2371
2397
|
await this.thermoAuto?.setAttribute(Thermostat.id, 'systemMode', Thermostat.SystemMode.Auto, this.thermoAuto.log);
|
|
2372
2398
|
if (this.thermoAuto?.hasAttributeServer(Thermostat.id, 'thermostatRunningState')) {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matterbridge-example-dynamic-platform",
|
|
3
|
-
"version": "3.0.4-dev-
|
|
3
|
+
"version": "3.0.4-dev-20260906-2c181fe",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "matterbridge-example-dynamic-platform",
|
|
9
|
-
"version": "3.0.4-dev-
|
|
9
|
+
"version": "3.0.4-dev-20260906-2c181fe",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"node-ansi-logger": "3.3.1",
|
package/package.json
CHANGED