matterbridge-example-camera 0.0.6 → 0.0.7-dev-20260722-1ce6884

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
@@ -28,6 +28,16 @@ If you like this project and find it useful, please consider giving it a star on
28
28
 
29
29
  <a href="https://www.buymeacoffee.com/luligugithub"><img src="https://matterbridge.io/assets/bmc-button.svg" alt="Buy me a coffee" width="120"></a>
30
30
 
31
+ ## [0.0.7] - Dev branch
32
+
33
+ ### Added
34
+
35
+ - [platform]: Add log of config.
36
+ - [platform]: Add animation interval in 10 phases.
37
+ - [doorbell]: Add use of cluster client Chime of Server Doorbell in the animation. It needs the Server Doorbell and Server Chime to be paired and a binding in Matter Server dashboard from Server Doorbell Chime client cluster to Server Chime Chime server cluster: [bindings](screenshots/bindings.png)
38
+
39
+ <a href="https://www.buymeacoffee.com/luligugithub"><img src="https://matterbridge.io/assets/bmc-button.svg" alt="Buy me a coffee" width="120"></a>
40
+
31
41
  ## [0.0.6] - 2026-07-21
32
42
 
33
43
  ### Added
package/README.md CHANGED
@@ -24,6 +24,12 @@
24
24
 
25
25
  This repository is used to create all Camera Device Types in chapter 16 of Matter specs 1.6.0.
26
26
 
27
+ It also tests the client cluster interaction.
28
+
29
+ ## Credit
30
+
31
+ Thanks to [Ludovic BOUÉ](https://github.com/lboue) for his contributions to this project (and many others).
32
+
27
33
  ## Setup
28
34
 
29
35
  - `src/module.ts` will create all device types for easy testing;
@@ -66,6 +72,10 @@ Features:
66
72
  - Optional Identify cluster support, with configurable identify time and type. Set to Identify.IdentifyType.None to omit the cluster entirely.
67
73
  - Configurable Power Source cluster type: Rechargeable, Replaceable, Battery, Wired, or None to omit the Power Source cluster entirely.
68
74
 
75
+ Supported by:
76
+
77
+ - [Matterserver dashboard](screenshots/matterserver-camera.png)
78
+
69
79
  ### Snapshot Camera
70
80
 
71
81
  Features:
@@ -78,6 +88,10 @@ Features:
78
88
  - Optional Identify cluster support, with configurable identify time and type. Set to Identify.IdentifyType.None to omit the cluster entirely.
79
89
  - Configurable Power Source cluster type: Rechargeable, Replaceable, Battery, Wired, or None to omit the Power Source cluster entirely.
80
90
 
91
+ Supported by:
92
+
93
+ - [Matterserver dashboard](screenshots/matterserver-snapshot-camera.png)
94
+
81
95
  ### Audio Doorbell
82
96
 
83
97
  Features:
@@ -200,10 +214,12 @@ The `assets` directory contains deterministic three-second media fixtures for ex
200
214
  - `test-video.h264`: raw H.264 Constrained Baseline video, 640×360 at 15 FPS, with a moving test pattern. Use this elementary stream when implementing H.264 NAL-unit parsing and RTP packetization.
201
215
  - `test-audio.opus`: Ogg container with mono Opus audio at 48 kHz and 64 kbit/s, containing a 1 kHz test tone. Use the Opus packets for an audio RTP track; the Ogg container itself is not sent over WebRTC.
202
216
  - `test-camera.mp4`: playable reference containing the same 640×360 H.264 test pattern and a mono 1 kHz AAC track. The werift test transfers the complete file over its SCTP data channel and verifies its integrity. This exercises binary file transport, not a WebRTC video RTP track.
203
- - `camera-color-1920-1080.jpeg`: 1920×1080 simplified ffmpeg-generated color-rectangle snapshot returned by the example's `CaptureSnapshot` command.
204
- - `camera-color-1280-720.jpeg`: 1280×720 simplified ffmpeg-generated color-rectangle snapshot returned by the example's `CaptureSnapshot` command.
205
- - `camera-color-640-480.jpeg`: 640×480 simplified ffmpeg-generated color-rectangle snapshot returned by the example's `CaptureSnapshot` command.
206
- - `camera-color-test-1920-1080.jpeg`, `camera-color-test-1280-720.jpeg`, `camera-color-test-960-540.jpeg`, `camera-color-test-640-480.jpeg`, and `camera-color-test-480-270.jpeg`: additional SMPTE color-bars snapshot fixtures.
217
+ - `camera-color-1920-1080.jpeg`: 1920×1080 simplified ffmpeg-generated color-rectangle snapshot.
218
+ - `camera-color-1280-720.jpeg`: 1280×720 simplified ffmpeg-generated color-rectangle snapshot.
219
+ - `camera-color-640-480.jpeg`: 640×480 simplified ffmpeg-generated color-rectangle snapshot.
220
+ - `camera-color-test-1920-1080.jpeg`: 1920×1080 extended color-rectangle snapshot returned by the example's `CaptureSnapshot` command.
221
+ - `camera-color-test-1280-720.jpeg`: 1280×720 extended color-rectangle snapshot returned by the example's `CaptureSnapshot` command.
222
+ - `camera-color-test-640-480.jpeg`: 640×480 extended color-rectangle snapshot returned by the example's `CaptureSnapshot` command.
207
223
 
208
224
  #### Why the snapshot calibration cards stay under ~64 KB
209
225
 
package/dist/module.js CHANGED
@@ -1,5 +1,9 @@
1
1
  import './patches/objectSchemaInjectFieldFix.js';
2
+ import { inspect } from 'node:util';
2
3
  import { MatterbridgeDynamicPlatform } from 'matterbridge';
4
+ import { MatterbridgeBindingServer } from 'matterbridge/behaviors';
5
+ import { RESET } from 'matterbridge/logger';
6
+ import { ChimeClient } from 'matterbridge/matter/behaviors';
3
7
  import { Identify, Chime as ChimeCluster, PowerSource } from 'matterbridge/matter/clusters';
4
8
  import { AudioDoorbell } from './devices/audioDoorbell.js';
5
9
  import { Camera } from './devices/camera.js';
@@ -36,6 +40,13 @@ export class ExampleMatterbridgeCameraPlatform extends MatterbridgeDynamicPlatfo
36
40
  process.env.MATTERBRIDGE_CAMERA_WEBCAM_DEVICE = this.config.webcam;
37
41
  process.env.MATTERBRIDGE_CAMERA_WEBCAM_RESOLUTION = this.config.webcamResolution;
38
42
  process.env.MATTERBRIDGE_CAMERA_WEBCAM_BITRATE = String(this.config.webcamBitrate);
43
+ this.log.debug(`Platform ${this.config.name} config:\n${RESET}${inspect(this.config, { depth: 10, colors: true })}`);
44
+ this.log.debug(`Platform ${this.config.name} environment variables:\n${RESET}${inspect({
45
+ MATTERBRIDGE_CAMERA_VIDEO_SOURCE: process.env.MATTERBRIDGE_CAMERA_VIDEO_SOURCE,
46
+ MATTERBRIDGE_CAMERA_WEBCAM_DEVICE: process.env.MATTERBRIDGE_CAMERA_WEBCAM_DEVICE,
47
+ MATTERBRIDGE_CAMERA_WEBCAM_RESOLUTION: process.env.MATTERBRIDGE_CAMERA_WEBCAM_RESOLUTION,
48
+ MATTERBRIDGE_CAMERA_WEBCAM_BITRATE: process.env.MATTERBRIDGE_CAMERA_WEBCAM_BITRATE,
49
+ }, { depth: 10, colors: true })}`);
39
50
  this.log.info(`Platform ${this.config.name} initialized successfully`);
40
51
  }
41
52
  async onStart(reason) {
@@ -81,8 +92,23 @@ export class ExampleMatterbridgeCameraPlatform extends MatterbridgeDynamicPlatfo
81
92
  lightOptions: { name: 'Floodlight' },
82
93
  });
83
94
  await this.addDevice(exampleFloodlightCamera);
84
- const serverChime = new Chime('Server Chime', 'SERVER-CHIME-001', { mode: 'server' });
95
+ const serverChime = new Chime('Server Chime', 'SERVER-CHIME-001', {
96
+ identifyTime: 5,
97
+ identifyType: Identify.IdentifyType.AudibleBeep,
98
+ powerSourceType: 'Battery',
99
+ installedChimeSounds: [
100
+ { chimeId: 0, name: 'Default' },
101
+ { chimeId: 1, name: 'Phone Ring' },
102
+ { chimeId: 2, name: 'Doorbell Ring' },
103
+ ],
104
+ selectedChime: 0,
105
+ enabled: true,
106
+ mode: 'server',
107
+ });
85
108
  await this.addDevice(serverChime);
109
+ serverChime.subscribeAttribute(ChimeCluster, 'enabled', (newValue, oldValue) => {
110
+ this.log.info(`Server Chime enabled attribute changed from ${oldValue} to ${newValue}`);
111
+ });
86
112
  const serverDoorbell = new Doorbell('Server Doorbell', 'SERVER-DOORBELL-001', { mode: 'server' });
87
113
  await this.addDevice(serverDoorbell);
88
114
  this.log.info(`Platform ${this.config.name} started successfully`);
@@ -93,6 +119,9 @@ export class ExampleMatterbridgeCameraPlatform extends MatterbridgeDynamicPlatfo
93
119
  const exampleChime = this.getDeviceById('Chime-CHIME-001');
94
120
  await exampleChime?.setCluster(PowerSource, { batChargeLevel: PowerSource.BatChargeLevel.Ok, batPercentRemaining: 150, batQuantity: 2, batReplacementDescription: 'AA' }, exampleChime.log);
95
121
  await exampleChime?.setAttribute(ChimeCluster, 'enabled', true, exampleChime.log);
122
+ const serverChime = this.getDeviceById('ServerChime-SERVER-CHIME-001');
123
+ await serverChime?.setCluster(PowerSource, { batChargeLevel: PowerSource.BatChargeLevel.Ok, batPercentRemaining: 150, batVoltage: 2900, batReplacementNeeded: false }, serverChime.log);
124
+ await serverChime?.setAttribute(ChimeCluster, 'enabled', true, serverChime.log);
96
125
  if (this.config.animationInterval > 0) {
97
126
  clearInterval(this.animationInterval);
98
127
  this.animationInterval = setInterval(() => void this.animationHandler(), this.config.animationInterval * 1000);
@@ -110,6 +139,52 @@ export class ExampleMatterbridgeCameraPlatform extends MatterbridgeDynamicPlatfo
110
139
  this.animationPhase = this.animationPhase + 1;
111
140
  this.animationPhase = this.animationPhase > 10 ? 0 : this.animationPhase;
112
141
  this.log.info(`Platform ${this.config.name} animation phase: ${this.animationPhase}`);
142
+ const serverDoorbell = this.getDeviceById('ServerDoorbell-SERVER-DOORBELL-001');
143
+ const serverChime = this.getDeviceById('ServerChime-SERVER-CHIME-001');
144
+ if (serverDoorbell && serverChime) {
145
+ switch (this.animationPhase) {
146
+ case 1:
147
+ case 6:
148
+ this.log.info(`Platform ${this.config.name} disabling server doorbell chime...`);
149
+ await serverDoorbell.act(async (agent) => {
150
+ const chimeEndpoint = agent.get(MatterbridgeBindingServer).getEndpoint(ChimeCluster.id);
151
+ await chimeEndpoint?.setStateOf(ChimeClient, { enabled: false });
152
+ });
153
+ break;
154
+ case 2:
155
+ case 7:
156
+ this.log.info(`Platform ${this.config.name} enabling server doorbell chime...`);
157
+ await serverDoorbell.act(async (agent) => {
158
+ const chimeEndpoint = agent.get(MatterbridgeBindingServer).getEndpoint(ChimeCluster.id);
159
+ await chimeEndpoint?.setStateOf(ChimeClient, { enabled: true });
160
+ });
161
+ break;
162
+ case 3:
163
+ case 8:
164
+ this.log.info(`Platform ${this.config.name} playing server doorbell chime sound 0...`);
165
+ await serverDoorbell.act(async (agent) => {
166
+ const chimeEndpoint = agent.get(MatterbridgeBindingServer).getEndpoint(ChimeCluster.id);
167
+ await chimeEndpoint?.commandsOf(ChimeClient).playChimeSound({ chimeId: 0 });
168
+ });
169
+ break;
170
+ case 4:
171
+ case 9:
172
+ this.log.info(`Platform ${this.config.name} playing server doorbell chime sound 1...`);
173
+ await serverDoorbell.act(async (agent) => {
174
+ const chimeEndpoint = agent.get(MatterbridgeBindingServer).getEndpoint(ChimeCluster.id);
175
+ await chimeEndpoint?.commandsOf(ChimeClient).playChimeSound({ chimeId: 1 });
176
+ });
177
+ break;
178
+ case 5:
179
+ case 10:
180
+ this.log.info(`Platform ${this.config.name} playing server doorbell chime sound 2...`);
181
+ await serverDoorbell.act(async (agent) => {
182
+ const chimeEndpoint = agent.get(MatterbridgeBindingServer).getEndpoint(ChimeCluster.id);
183
+ await chimeEndpoint?.commandsOf(ChimeClient).playChimeSound({ chimeId: 2 });
184
+ });
185
+ break;
186
+ }
187
+ }
113
188
  }
114
189
  async onShutdown(reason) {
115
190
  await super.onShutdown(reason);
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "matterbridge-example-camera",
3
- "version": "0.0.6",
3
+ "version": "0.0.7-dev-20260722-1ce6884",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "matterbridge-example-camera",
9
- "version": "0.0.6",
9
+ "version": "0.0.7-dev-20260722-1ce6884",
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
12
  "node-ansi-logger": "3.3.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "matterbridge-example-camera",
3
- "version": "0.0.6",
3
+ "version": "0.0.7-dev-20260722-1ce6884",
4
4
  "description": "Matterbridge camera example plugin",
5
5
  "author": "https://github.com/Luligu",
6
6
  "license": "Apache-2.0",
@@ -58,6 +58,7 @@
58
58
  },
59
59
  "files": [
60
60
  "assets",
61
+ "screenshots",
61
62
  "bin",
62
63
  "dist",
63
64
  "npm-shrinkwrap.json",
Binary file