matterbridge 3.2.1-dev-20250806-8a31d91 → 3.2.1

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.
Files changed (264) hide show
  1. package/CHANGELOG.md +3 -2
  2. package/dist/cli.d.ts +26 -0
  3. package/dist/cli.d.ts.map +1 -0
  4. package/dist/cli.js +91 -2
  5. package/dist/cli.js.map +1 -0
  6. package/dist/cliEmitter.d.ts +34 -0
  7. package/dist/cliEmitter.d.ts.map +1 -0
  8. package/dist/cliEmitter.js +30 -0
  9. package/dist/cliEmitter.js.map +1 -0
  10. package/dist/clusters/export.d.ts +2 -0
  11. package/dist/clusters/export.d.ts.map +1 -0
  12. package/dist/clusters/export.js +2 -0
  13. package/dist/clusters/export.js.map +1 -0
  14. package/dist/defaultConfigSchema.d.ts +28 -0
  15. package/dist/defaultConfigSchema.d.ts.map +1 -0
  16. package/dist/defaultConfigSchema.js +24 -0
  17. package/dist/defaultConfigSchema.js.map +1 -0
  18. package/dist/deviceManager.d.ts +112 -0
  19. package/dist/deviceManager.d.ts.map +1 -0
  20. package/dist/deviceManager.js +94 -1
  21. package/dist/deviceManager.js.map +1 -0
  22. package/dist/devices/batteryStorage.d.ts +48 -0
  23. package/dist/devices/batteryStorage.d.ts.map +1 -0
  24. package/dist/devices/batteryStorage.js +48 -1
  25. package/dist/devices/batteryStorage.js.map +1 -0
  26. package/dist/devices/dishwasher.d.ts +91 -0
  27. package/dist/devices/dishwasher.d.ts.map +1 -0
  28. package/dist/devices/dishwasher.js +78 -3
  29. package/dist/devices/dishwasher.js.map +1 -0
  30. package/dist/devices/evse.d.ts +75 -0
  31. package/dist/devices/evse.d.ts.map +1 -0
  32. package/dist/devices/evse.js +74 -10
  33. package/dist/devices/evse.js.map +1 -0
  34. package/dist/devices/export.d.ts +11 -0
  35. package/dist/devices/export.d.ts.map +1 -0
  36. package/dist/devices/export.js +2 -0
  37. package/dist/devices/export.js.map +1 -0
  38. package/dist/devices/extractorHood.d.ts +46 -0
  39. package/dist/devices/extractorHood.d.ts.map +1 -0
  40. package/dist/devices/extractorHood.js +42 -0
  41. package/dist/devices/extractorHood.js.map +1 -0
  42. package/dist/devices/heatPump.d.ts +47 -0
  43. package/dist/devices/heatPump.d.ts.map +1 -0
  44. package/dist/devices/heatPump.js +50 -2
  45. package/dist/devices/heatPump.js.map +1 -0
  46. package/dist/devices/laundryDryer.d.ts +87 -0
  47. package/dist/devices/laundryDryer.d.ts.map +1 -0
  48. package/dist/devices/laundryDryer.js +83 -6
  49. package/dist/devices/laundryDryer.js.map +1 -0
  50. package/dist/devices/laundryWasher.d.ts +242 -0
  51. package/dist/devices/laundryWasher.d.ts.map +1 -0
  52. package/dist/devices/laundryWasher.js +91 -7
  53. package/dist/devices/laundryWasher.js.map +1 -0
  54. package/dist/devices/roboticVacuumCleaner.d.ts +112 -0
  55. package/dist/devices/roboticVacuumCleaner.d.ts.map +1 -0
  56. package/dist/devices/roboticVacuumCleaner.js +93 -7
  57. package/dist/devices/roboticVacuumCleaner.js.map +1 -0
  58. package/dist/devices/solarPower.d.ts +40 -0
  59. package/dist/devices/solarPower.d.ts.map +1 -0
  60. package/dist/devices/solarPower.js +38 -0
  61. package/dist/devices/solarPower.js.map +1 -0
  62. package/dist/devices/waterHeater.d.ts +111 -0
  63. package/dist/devices/waterHeater.d.ts.map +1 -0
  64. package/dist/devices/waterHeater.js +82 -2
  65. package/dist/devices/waterHeater.js.map +1 -0
  66. package/dist/dgram/coap.d.ts +205 -0
  67. package/dist/dgram/coap.d.ts.map +1 -0
  68. package/dist/dgram/coap.js +126 -13
  69. package/dist/dgram/coap.js.map +1 -0
  70. package/dist/dgram/dgram.d.ts +140 -0
  71. package/dist/dgram/dgram.d.ts.map +1 -0
  72. package/dist/dgram/dgram.js +113 -2
  73. package/dist/dgram/dgram.js.map +1 -0
  74. package/dist/dgram/mb_coap.d.ts +24 -0
  75. package/dist/dgram/mb_coap.d.ts.map +1 -0
  76. package/dist/dgram/mb_coap.js +41 -3
  77. package/dist/dgram/mb_coap.js.map +1 -0
  78. package/dist/dgram/mb_mdns.d.ts +24 -0
  79. package/dist/dgram/mb_mdns.d.ts.map +1 -0
  80. package/dist/dgram/mb_mdns.js +51 -13
  81. package/dist/dgram/mb_mdns.js.map +1 -0
  82. package/dist/dgram/mdns.d.ts +288 -0
  83. package/dist/dgram/mdns.d.ts.map +1 -0
  84. package/dist/dgram/mdns.js +298 -137
  85. package/dist/dgram/mdns.js.map +1 -0
  86. package/dist/dgram/multicast.d.ts +65 -0
  87. package/dist/dgram/multicast.d.ts.map +1 -0
  88. package/dist/dgram/multicast.js +60 -1
  89. package/dist/dgram/multicast.js.map +1 -0
  90. package/dist/dgram/unicast.d.ts +56 -0
  91. package/dist/dgram/unicast.d.ts.map +1 -0
  92. package/dist/dgram/unicast.js +54 -0
  93. package/dist/dgram/unicast.js.map +1 -0
  94. package/dist/frontend.d.ts +313 -0
  95. package/dist/frontend.d.ts.map +1 -0
  96. package/dist/frontend.js +451 -24
  97. package/dist/frontend.js.map +1 -0
  98. package/dist/globalMatterbridge.d.ts +59 -0
  99. package/dist/globalMatterbridge.d.ts.map +1 -0
  100. package/dist/globalMatterbridge.js +47 -0
  101. package/dist/globalMatterbridge.js.map +1 -0
  102. package/dist/helpers.d.ts +48 -0
  103. package/dist/helpers.d.ts.map +1 -0
  104. package/dist/helpers.js +53 -0
  105. package/dist/helpers.js.map +1 -0
  106. package/dist/index.d.ts +33 -0
  107. package/dist/index.d.ts.map +1 -0
  108. package/dist/index.js +30 -1
  109. package/dist/index.js.map +1 -0
  110. package/dist/logger/export.d.ts +2 -0
  111. package/dist/logger/export.d.ts.map +1 -0
  112. package/dist/logger/export.js +1 -0
  113. package/dist/logger/export.js.map +1 -0
  114. package/dist/matter/behaviors.d.ts +2 -0
  115. package/dist/matter/behaviors.d.ts.map +1 -0
  116. package/dist/matter/behaviors.js +2 -0
  117. package/dist/matter/behaviors.js.map +1 -0
  118. package/dist/matter/clusters.d.ts +2 -0
  119. package/dist/matter/clusters.d.ts.map +1 -0
  120. package/dist/matter/clusters.js +2 -0
  121. package/dist/matter/clusters.js.map +1 -0
  122. package/dist/matter/devices.d.ts +2 -0
  123. package/dist/matter/devices.d.ts.map +1 -0
  124. package/dist/matter/devices.js +2 -0
  125. package/dist/matter/devices.js.map +1 -0
  126. package/dist/matter/endpoints.d.ts +2 -0
  127. package/dist/matter/endpoints.d.ts.map +1 -0
  128. package/dist/matter/endpoints.js +2 -0
  129. package/dist/matter/endpoints.js.map +1 -0
  130. package/dist/matter/export.d.ts +5 -0
  131. package/dist/matter/export.d.ts.map +1 -0
  132. package/dist/matter/export.js +3 -0
  133. package/dist/matter/export.js.map +1 -0
  134. package/dist/matter/types.d.ts +3 -0
  135. package/dist/matter/types.d.ts.map +1 -0
  136. package/dist/matter/types.js +3 -0
  137. package/dist/matter/types.js.map +1 -0
  138. package/dist/matterbridge.d.ts +462 -0
  139. package/dist/matterbridge.d.ts.map +1 -0
  140. package/dist/matterbridge.js +789 -50
  141. package/dist/matterbridge.js.map +1 -0
  142. package/dist/matterbridgeAccessoryPlatform.d.ts +42 -0
  143. package/dist/matterbridgeAccessoryPlatform.d.ts.map +1 -0
  144. package/dist/matterbridgeAccessoryPlatform.js +36 -0
  145. package/dist/matterbridgeAccessoryPlatform.js.map +1 -0
  146. package/dist/matterbridgeBehaviors.d.ts +1351 -0
  147. package/dist/matterbridgeBehaviors.d.ts.map +1 -0
  148. package/dist/matterbridgeBehaviors.js +65 -5
  149. package/dist/matterbridgeBehaviors.js.map +1 -0
  150. package/dist/matterbridgeDeviceTypes.d.ts +709 -0
  151. package/dist/matterbridgeDeviceTypes.d.ts.map +1 -0
  152. package/dist/matterbridgeDeviceTypes.js +579 -15
  153. package/dist/matterbridgeDeviceTypes.js.map +1 -0
  154. package/dist/matterbridgeDynamicPlatform.d.ts +42 -0
  155. package/dist/matterbridgeDynamicPlatform.d.ts.map +1 -0
  156. package/dist/matterbridgeDynamicPlatform.js +36 -0
  157. package/dist/matterbridgeDynamicPlatform.js.map +1 -0
  158. package/dist/matterbridgeEndpoint.d.ts +1354 -0
  159. package/dist/matterbridgeEndpoint.d.ts.map +1 -0
  160. package/dist/matterbridgeEndpoint.js +1220 -54
  161. package/dist/matterbridgeEndpoint.js.map +1 -0
  162. package/dist/matterbridgeEndpointHelpers.d.ts +407 -0
  163. package/dist/matterbridgeEndpointHelpers.d.ts.map +1 -0
  164. package/dist/matterbridgeEndpointHelpers.js +345 -12
  165. package/dist/matterbridgeEndpointHelpers.js.map +1 -0
  166. package/dist/matterbridgePlatform.d.ts +324 -0
  167. package/dist/matterbridgePlatform.d.ts.map +1 -0
  168. package/dist/matterbridgePlatform.js +250 -0
  169. package/dist/matterbridgePlatform.js.map +1 -0
  170. package/dist/matterbridgeTypes.d.ts +198 -0
  171. package/dist/matterbridgeTypes.d.ts.map +1 -0
  172. package/dist/matterbridgeTypes.js +25 -0
  173. package/dist/matterbridgeTypes.js.map +1 -0
  174. package/dist/pluginManager.d.ts +270 -0
  175. package/dist/pluginManager.d.ts.map +1 -0
  176. package/dist/pluginManager.js +249 -3
  177. package/dist/pluginManager.js.map +1 -0
  178. package/dist/shelly.d.ts +174 -0
  179. package/dist/shelly.d.ts.map +1 -0
  180. package/dist/shelly.js +168 -7
  181. package/dist/shelly.js.map +1 -0
  182. package/dist/storage/export.d.ts +2 -0
  183. package/dist/storage/export.d.ts.map +1 -0
  184. package/dist/storage/export.js +1 -0
  185. package/dist/storage/export.js.map +1 -0
  186. package/dist/update.d.ts +75 -0
  187. package/dist/update.d.ts.map +1 -0
  188. package/dist/update.js +69 -0
  189. package/dist/update.js.map +1 -0
  190. package/dist/utils/colorUtils.d.ts +99 -0
  191. package/dist/utils/colorUtils.d.ts.map +1 -0
  192. package/dist/utils/colorUtils.js +97 -2
  193. package/dist/utils/colorUtils.js.map +1 -0
  194. package/dist/utils/commandLine.d.ts +59 -0
  195. package/dist/utils/commandLine.d.ts.map +1 -0
  196. package/dist/utils/commandLine.js +54 -0
  197. package/dist/utils/commandLine.js.map +1 -0
  198. package/dist/utils/copyDirectory.d.ts +33 -0
  199. package/dist/utils/copyDirectory.d.ts.map +1 -0
  200. package/dist/utils/copyDirectory.js +38 -1
  201. package/dist/utils/copyDirectory.js.map +1 -0
  202. package/dist/utils/createDirectory.d.ts +34 -0
  203. package/dist/utils/createDirectory.d.ts.map +1 -0
  204. package/dist/utils/createDirectory.js +33 -0
  205. package/dist/utils/createDirectory.js.map +1 -0
  206. package/dist/utils/createZip.d.ts +39 -0
  207. package/dist/utils/createZip.d.ts.map +1 -0
  208. package/dist/utils/createZip.js +47 -2
  209. package/dist/utils/createZip.js.map +1 -0
  210. package/dist/utils/deepCopy.d.ts +32 -0
  211. package/dist/utils/deepCopy.d.ts.map +1 -0
  212. package/dist/utils/deepCopy.js +39 -0
  213. package/dist/utils/deepCopy.js.map +1 -0
  214. package/dist/utils/deepEqual.d.ts +54 -0
  215. package/dist/utils/deepEqual.d.ts.map +1 -0
  216. package/dist/utils/deepEqual.js +72 -1
  217. package/dist/utils/deepEqual.js.map +1 -0
  218. package/dist/utils/error.d.ts +44 -0
  219. package/dist/utils/error.d.ts.map +1 -0
  220. package/dist/utils/error.js +41 -0
  221. package/dist/utils/error.js.map +1 -0
  222. package/dist/utils/export.d.ts +12 -0
  223. package/dist/utils/export.d.ts.map +1 -0
  224. package/dist/utils/export.js +1 -0
  225. package/dist/utils/export.js.map +1 -0
  226. package/dist/utils/hex.d.ts +89 -0
  227. package/dist/utils/hex.d.ts.map +1 -0
  228. package/dist/utils/hex.js +124 -0
  229. package/dist/utils/hex.js.map +1 -0
  230. package/dist/utils/isvalid.d.ts +103 -0
  231. package/dist/utils/isvalid.d.ts.map +1 -0
  232. package/dist/utils/isvalid.js +101 -0
  233. package/dist/utils/isvalid.js.map +1 -0
  234. package/dist/utils/network.d.ts +84 -0
  235. package/dist/utils/network.d.ts.map +1 -0
  236. package/dist/utils/network.js +91 -5
  237. package/dist/utils/network.js.map +1 -0
  238. package/dist/utils/spawn.d.ts +33 -0
  239. package/dist/utils/spawn.d.ts.map +1 -0
  240. package/dist/utils/spawn.js +40 -0
  241. package/dist/utils/spawn.js.map +1 -0
  242. package/dist/utils/wait.d.ts +54 -0
  243. package/dist/utils/wait.d.ts.map +1 -0
  244. package/dist/utils/wait.js +60 -8
  245. package/dist/utils/wait.js.map +1 -0
  246. package/frontend/build/static/js/main.b4cc32cf.js.map +1 -1
  247. package/npm-shrinkwrap.json +5 -5
  248. package/package.json +2 -2
  249. package/docs/404.html +0 -107
  250. package/docs/HomeAssistant.svg +0 -2
  251. package/docs/README-DEV.md +0 -377
  252. package/docs/README-DOCKER.md +0 -208
  253. package/docs/README-NGINX.md +0 -235
  254. package/docs/README-PODMAN.md +0 -109
  255. package/docs/README-SERVICE.md +0 -212
  256. package/docs/README.md +0 -618
  257. package/docs/Shelly.svg +0 -1
  258. package/docs/Somfy.svg +0 -1
  259. package/docs/Zigbee2MQTT.svg +0 -1
  260. package/docs/_config.yml +0 -86
  261. package/docs/bmc-button.svg +0 -22
  262. package/docs/index.html +0 -774
  263. package/docs/matterbridge.svg +0 -50
  264. package/docs/robots.txt +0 -4
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "matterbridge",
3
- "version": "3.2.1-dev-20250806-8a31d91",
3
+ "version": "3.2.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "matterbridge",
9
- "version": "3.2.1-dev-20250806-8a31d91",
9
+ "version": "3.2.1",
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
12
  "@matter/main": "0.15.3",
@@ -359,9 +359,9 @@
359
359
  "license": "MIT"
360
360
  },
361
361
  "node_modules/bare-events": {
362
- "version": "2.6.0",
363
- "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.6.0.tgz",
364
- "integrity": "sha512-EKZ5BTXYExaNqi3I3f9RtEsaI/xBSGjE0XZCZilPzFAV/goswFHuPd9jEZlPIZ/iNZJwDSao9qRiScySz7MbQg==",
362
+ "version": "2.6.1",
363
+ "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.6.1.tgz",
364
+ "integrity": "sha512-AuTJkq9XmE6Vk0FJVNq5QxETrSA/vKHarWVBG5l/JbdCL1prJemiyJqUS0jrlXO0MftuPq4m3YVYhoNc5+aE/g==",
365
365
  "license": "Apache-2.0",
366
366
  "optional": true
367
367
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "matterbridge",
3
- "version": "3.2.1-dev-20250806-8a31d91",
3
+ "version": "3.2.1",
4
4
  "description": "Matterbridge plugin manager for Matter",
5
5
  "author": "https://github.com/Luligu",
6
6
  "license": "Apache-2.0",
@@ -22,7 +22,6 @@
22
22
  "bridge",
23
23
  "plugin",
24
24
  "frontend",
25
- "matterbridge",
26
25
  "matter.js",
27
26
  "matter-node.js",
28
27
  "matter",
@@ -41,6 +40,7 @@
41
40
  ],
42
41
  "type": "module",
43
42
  "main": "dist/index.js",
43
+ "types": "dist/index.d.ts",
44
44
  "bin": {
45
45
  "matterbridge": "bin/matterbridge.js",
46
46
  "mb_mdns": "bin/mb_mdns.js",
package/docs/404.html DELETED
@@ -1,107 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Page Not Found - Matterbridge</title>
7
- <link rel="icon" type="image/svg+xml" href="matterbridge.svg">
8
- <style>
9
- body {
10
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
11
- margin: 0;
12
- padding: 0;
13
- min-height: 100vh;
14
- display: flex;
15
- align-items: center;
16
- justify-content: center;
17
- background: linear-gradient(135deg, #2563eb, #1e40af);
18
- color: white;
19
- text-align: center;
20
- }
21
-
22
- .container {
23
- max-width: 600px;
24
- padding: 2rem;
25
- }
26
-
27
- .logo {
28
- width: 80px;
29
- height: 80px;
30
- margin: 0 auto 2rem;
31
- display: block;
32
- filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
33
- }
34
-
35
- h1 {
36
- font-size: 4rem;
37
- font-weight: 700;
38
- margin: 0 0 1rem;
39
- text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
40
- }
41
-
42
- h2 {
43
- font-size: 1.5rem;
44
- font-weight: 400;
45
- margin: 0 0 2rem;
46
- opacity: 0.9;
47
- }
48
-
49
- p {
50
- font-size: 1.125rem;
51
- margin: 0 0 2rem;
52
- opacity: 0.8;
53
- }
54
-
55
- .btn {
56
- display: inline-block;
57
- background: white;
58
- color: #2563eb;
59
- padding: 0.75rem 2rem;
60
- text-decoration: none;
61
- border-radius: 0.5rem;
62
- font-weight: 600;
63
- transition: all 0.2s ease;
64
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
65
- }
66
-
67
- .btn:hover {
68
- transform: translateY(-2px);
69
- box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
70
- }
71
-
72
- .links {
73
- margin-top: 2rem;
74
- display: flex;
75
- gap: 1rem;
76
- justify-content: center;
77
- flex-wrap: wrap;
78
- }
79
-
80
- .links a {
81
- color: white;
82
- text-decoration: none;
83
- opacity: 0.8;
84
- transition: opacity 0.2s ease;
85
- }
86
-
87
- .links a:hover {
88
- opacity: 1;
89
- }
90
- </style>
91
- </head>
92
- <body>
93
- <div class="container">
94
- <img src="matterbridge.svg" alt="Matterbridge Logo" class="logo">
95
- <h1>404</h1>
96
- <h2>Page Not Found</h2>
97
- <p>Sorry, the page you're looking for doesn't exist. It might have been moved, deleted, or you may have mistyped the URL.</p>
98
- <a href="/" class="btn">🏠 Go Home</a>
99
-
100
- <div class="links">
101
- <a href="README.md">📖 Documentation</a>
102
- <a href="https://github.com/Luligu/matterbridge">🔗 GitHub</a>
103
- <a href="https://www.npmjs.com/package/matterbridge">📦 NPM</a>
104
- </div>
105
- </div>
106
- </body>
107
- </html>
@@ -1,2 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
2
- <svg width="800px" height="800px" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><title>file_type_homeassistant</title><path d="M5.114,27.944V18.427H2.66a.668.668,0,0,1-.47-1.134L15.41,3.748h0a.819.819,0,0,1,1.166-.008l.007.007,6.9,7.037v-1.3h0a.553.553,0,0,1,.55-.556h2.292a.553.553,0,0,1,.549.556v4.78L29.812,17.3h0a.671.671,0,0,1-.01.942.657.657,0,0,1-.462.19H26.876v9.517a.553.553,0,0,1-.549.556H5.664A.553.553,0,0,1,5.114,27.944Z" style="fill:#3dbcf3;fill-rule:evenodd"/><path d="M21.718,15.07a2.841,2.841,0,0,0-2.826,2.857,2.876,2.876,0,0,0,.224,1.116l-2.061,2.083V14.791a2.826,2.826,0,1,0-2.12,0v6.335l-2.061-2.083a2.876,2.876,0,0,0,.224-1.116,2.826,2.826,0,1,0-2.826,2.858,2.791,2.791,0,0,0,1.1-.227l3.559,3.6V28.5h2.12V24.157l3.56-3.6a2.782,2.782,0,0,0,1.1.227,2.858,2.858,0,0,0,0-5.715Zm-11.446,4a1.143,1.143,0,1,1,1.13-1.143A1.136,1.136,0,0,1,10.272,19.07ZM16,13.284a1.143,1.143,0,1,1,1.131-1.143A1.136,1.136,0,0,1,16,13.284Zm5.723,5.786a1.143,1.143,0,1,1,1.131-1.143A1.136,1.136,0,0,1,21.718,19.07Z" style="fill:#fff"/></svg>
@@ -1,377 +0,0 @@
1
- # <img src="frontend/public/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px">&nbsp;&nbsp;&nbsp;Matterbridge development
2
-
3
- [![npm version](https://img.shields.io/npm/v/matterbridge.svg)](https://www.npmjs.com/package/matterbridge)
4
- [![npm downloads](https://img.shields.io/npm/dt/matterbridge.svg)](https://www.npmjs.com/package/matterbridge)
5
- [![Docker Version](https://img.shields.io/docker/v/luligu/matterbridge?label=docker%20version&sort=semver)](https://hub.docker.com/r/luligu/matterbridge)
6
- [![Docker Pulls](https://img.shields.io/docker/pulls/luligu/matterbridge.svg)](https://hub.docker.com/r/luligu/matterbridge)
7
- ![Node.js CI](https://github.com/Luligu/matterbridge/actions/workflows/build.yml/badge.svg)
8
- ![CodeQL](https://github.com/Luligu/matterbridge/actions/workflows/codeql.yml/badge.svg)
9
- [![codecov](https://codecov.io/gh/Luligu/matterbridge/branch/main/graph/badge.svg)](https://codecov.io/gh/Luligu/matterbridge)
10
-
11
- [![power by](https://img.shields.io/badge/powered%20by-matter--history-blue)](https://www.npmjs.com/package/matter-history)
12
- [![power by](https://img.shields.io/badge/powered%20by-node--ansi--logger-blue)](https://www.npmjs.com/package/node-ansi-logger)
13
- [![power by](https://img.shields.io/badge/powered%20by-node--persist--manager-blue)](https://www.npmjs.com/package/node-persist-manager)
14
-
15
- ---
16
-
17
- # Development
18
-
19
- ## How to create your plugin
20
-
21
- The easiest way is to clone the [Matterbridge Plugin Template](https://github.com/Luligu/matterbridge-plugin-template) that has **Dev Container support for instant development environment** and all tools and extensions (like Node.js, npm, TypeScript, ESLint, Prettier, Jest and Vitest) already loaded and configured.
22
-
23
- After you clone it locally, change the name (keep always matterbridge- at the beginning of the name), version, description, author, homepage, repository, bugs and funding in the package.json.
24
-
25
- It is also possible to add two custom properties to the package.json: **help** and **changelog** with a url that will be used in the frontend instead of the default (/blob/main/README.md and /blob/main/CHANGELOG.md).
26
-
27
- Add your plugin logic in module.ts.
28
-
29
- The Matterbridge Plugin Template has an already configured Jest / Vitest test unit (with 100% coverage) that you can expand while you add your own plugin logic.
30
-
31
- It also has a workflow configured to run on push and pull request that build, lint and test the plugin on node 20, 22 and 24 with ubuntu, macOS and windows.
32
-
33
- ## Matterbridge Dev Container
34
-
35
- Using a Dev Container provides a fully isolated, reproducible, and pre-configured development environment. This ensures that all contributors have the same tools, extensions, and dependencies, eliminating "works on my machine" issues. It also makes onboarding new developers fast and hassle-free, as everything needed is set up automatically.
36
-
37
- For improved efficiency, the setup uses named Docker volumes for `node_modules`. This means dependencies are installed only once and persist across container rebuilds, making installs and rebuilds much faster than with bind mounts or ephemeral volumes.
38
-
39
- To start the Dev Container, simply open the project folder in [Visual Studio Code](https://code.visualstudio.com/) and, if prompted, click "Reopen in Container". Alternatively, use the Command Palette (`Ctrl+Shift+P` or `Cmd+Shift+P`), search for "Dev Containers: Reopen in Container", and select it. VS Code will automatically build and start the containerized environment for you.
40
-
41
- > **Note:** The first time you use the Dev Container, it may take a while to download all the required Docker images and set up the environment. Subsequent starts will be as as fast as from the local folder.
42
-
43
- Since Dev Container doesn't run in network mode 'host', it is not possible to pair Mattebridge running inside the Dev Container.
44
-
45
- ## Matterbridge Plugin Dev Container
46
-
47
- Using a Dev Container provides a fully isolated, reproducible, and pre-configured development environment. This ensures that all contributors have the same tools, extensions, and dependencies, eliminating "works on my machine" issues. It also makes onboarding new developers fast and hassle-free, as everything needed is set up automatically.
48
-
49
- For improved efficiency, the setup uses named Docker volumes for `matterbridge` and `node_modules`. This means that the dev of matterbridge and the plugin dependencies are installed only once and persist across container rebuilds, making installs and rebuilds much faster than with bind mounts or ephemeral volumes.
50
-
51
- To start the Dev Container, simply open the project folder in [Visual Studio Code](https://code.visualstudio.com/) and, if prompted, click "Reopen in Container". Alternatively, use the Command Palette (`Ctrl+Shift+P` or `Cmd+Shift+P`), search for "Dev Containers: Reopen in Container", and select it. VS Code will automatically build and start the containerized environment for you.
52
-
53
- > **Note:** The first time you use the Dev Container, it may take a while to download all the required Docker images and set up the environment. Subsequent starts will be as fast as from the local folder.
54
-
55
- Since Dev Container doesn't run in network mode 'host', it is not possible to pair Mattebridge running inside the Dev Container.
56
-
57
- ## Guidelines on imports/exports
58
-
59
- Matterbridge exports from:
60
-
61
- ### "matterbridge"
62
-
63
- - Matterbridge and all Matterbridge related classes.
64
-
65
- ### "matterbridge/devices"
66
-
67
- - All single device classes like the Rvc, LaundryWasher, etc...
68
-
69
- ### "matterbridge/clusters"
70
-
71
- - All clusters not present in matter.js or modified.
72
-
73
- ### "matterbridge/utils"
74
-
75
- - All general utils and colorUtils functions.
76
-
77
- ### "matterbridge/logger"
78
-
79
- - AnsiLogger class.
80
-
81
- ### "matterbridge/storage"
82
-
83
- - NodeStorageManager and NodeStorage classes.
84
-
85
- ### "matterbridge/matter"
86
-
87
- - All relevant matter.js exports.
88
-
89
- ### "matterbridge/matter/behaviors"
90
-
91
- - All matter.js behaviors.
92
-
93
- ### "matterbridge/matter/clusters"
94
-
95
- - All matter.js clusters.
96
-
97
- ### "matterbridge/matter/devices"
98
-
99
- - All matter.js devices.
100
-
101
- ### "matterbridge/matter/endpoints"
102
-
103
- - All matter.js endpoints.
104
-
105
- ### "matterbridge/matter/types"
106
-
107
- - All matter.js types.
108
-
109
- ### \***\*\*\*\*\*** WARNING \***\*\*\*\*\***
110
-
111
- A plugin must never install or import from `@matter` or `@project-chip` directly (neither as a dependency, devDependency, nor peerDependency), as this leads to a second instance of `matter.js`, causing instability and unpredictable errors such as "The only instance is Endpoint".
112
-
113
- Additionally, when Matterbridge updates the `matter.js` version, it should be consistent across all plugins.
114
-
115
- ### \***\*\*\*\*\*** WARNING \***\*\*\*\*\***
116
-
117
- A plugin must never install Matterbridge (neither as a dependency, devDependency, nor peerDependency).
118
-
119
- Matterbridge must be linked to the plugin in development only. At runtime the plugin is loaded directly from the running Mattebridge instance.
120
-
121
- ```json
122
- "scripts": {
123
- '''
124
- "dev:link": "npm link matterbridge",
125
- '''
126
- }
127
- ```
128
-
129
- If you don't use Dev Container from the Matterbridge Plugin Template, on the host you use for the development of your plugin, you need to clone matterbridge, built it locally and link it globally (npm link from the matterbridge package root).
130
-
131
- ```bash
132
- git clone https://github.com/Luligu/matterbridge.git
133
- cd matterbridge
134
- npm install
135
- npm run build
136
- npm link
137
- ```
138
-
139
- If you want to develop a plugin using the dev branch of matterbridge (I suggest you do it).
140
-
141
- ```bash
142
- git clone -b dev https://github.com/Luligu/matterbridge.git
143
- cd matterbridge
144
- npm install
145
- npm run build
146
- npm link
147
- ```
148
-
149
- Always keep your local instance of matterbridge up to date.
150
-
151
- ### WARNING \***\*\*\*\*\***
152
-
153
- Some error messages are logged on start when a plugin has wrong imports or configurations and the plugin will be disabled to prevent instability and crashes.
154
-
155
- ## How to install and register a plugin for development (from github)
156
-
157
- To install i.e. https://github.com/Luligu/matterbridge-example-accessory-platform
158
-
159
- On windows:
160
-
161
- ```powershell
162
- cd $HOME\Matterbridge
163
- ```
164
-
165
- On linux or macOS:
166
-
167
- ```bash
168
- cd ~/Matterbridge
169
- ```
170
-
171
- then clone the plugin
172
-
173
- ```bash
174
- git clone https://github.com/Luligu/matterbridge-example-accessory-platform
175
- cd matterbridge-example-accessory-platform
176
- npm install
177
- npm link matterbridge
178
- npm run build
179
- ```
180
-
181
- then add the plugin to Matterbridge
182
-
183
- ```bash
184
- matterbridge -add .
185
- ```
186
-
187
- ## MatterbridgeDynamicPlatform and MatterbridgeAccessoryPlatform api
188
-
189
- ### public name: string
190
-
191
- The plugin name.
192
-
193
- ### public type: string
194
-
195
- The plugin platform type.
196
-
197
- ### public config: object
198
-
199
- The plugin config (loaded before the platform constructor is called and saved after onShutdown() is called).
200
- Here you can store your plugin configuration (see matterbridge-zigbee2mqtt for example)
201
-
202
- ### constructor(matterbridge: Matterbridge, log: AnsiLogger, config: PlatformConfig)
203
-
204
- The contructor is called when is plugin is loaded.
205
-
206
- ### async onStart(reason?: string)
207
-
208
- The method onStart() is where you have to create your MatterbridgeEndpoint and add all needed clusters.
209
-
210
- After add the command handlers and subscribe to the attributes when needed.
211
-
212
- The MatterbridgeEndpoint class has the create cluster methods already done and all command handlers needed (see plugin examples).
213
-
214
- The method is called when Matterbridge load the plugin.
215
-
216
- ### async onConfigure()
217
-
218
- The method onConfigure() is where you can configure your matter device.
219
-
220
- The method is called when the server node the platform belongs to is online.
221
-
222
- Since the persistent attributes are loaded from the storage when the server node goes online, you may need to set them in onConfigure().
223
-
224
- ### async onShutdown(reason?: string)
225
-
226
- The method onShutdown() is where you have to stop your platform and cleanup all the used resources.
227
-
228
- The method is called when Matterbridge is shutting down or when the plugin is disabled.
229
-
230
- Since the frontend can enable and disable the plugin many times, you need to clean all resources (i.e. handlers, intervals, timers...) here.
231
-
232
- ### async onChangeLoggerLevel(logLevel: LogLevel)
233
-
234
- It is called when the user changes the logger level in the frontend.
235
-
236
- ### async onAction(action: string, value?: string, id?: string, formData?: PlatformConfig)
237
-
238
- It is called when a plugin config includes an action button or an action button with text field.
239
-
240
- ### async onConfigChanged(config: PlatformConfig)
241
-
242
- It is called when the plugin config has been updated.
243
-
244
- ### getDevices(): MatterbridgeEndpoint[]
245
-
246
- Retrieves the devices registered with the platform.
247
-
248
- ### hasDeviceName(deviceName: string): boolean
249
-
250
- Checks if a device with this name is already registered in the platform.
251
-
252
- ### async registerDevice(device: MatterbridgeEndpoint)
253
-
254
- After you have created your device, add it to the platform.
255
-
256
- ### async unregisterDevice(device: MatterbridgeEndpoint)
257
-
258
- You can unregister a device.
259
-
260
- ### async unregisterAllDevices()
261
-
262
- You can unregister all the devices you added.
263
-
264
- It can be useful to call this method from onShutdown() if you don't want to keep all the devices during development.
265
-
266
- ## MatterbridgeEndpoint api
267
-
268
- You create a Matter device with a new instance of MatterbridgeEndpoint(definition: DeviceTypeDefinition | AtLeastOne<DeviceTypeDefinition>, options: MatterbridgeEndpointOptions = {}, debug: boolean = false).
269
-
270
- - @param {DeviceTypeDefinition | AtLeastOne<DeviceTypeDefinition>} definition - The DeviceTypeDefinition(s) of the endpoint.
271
- - @param {MatterbridgeEndpointOptions} [options] - The options for the device.
272
- - @param {boolean} [debug] - Debug flag.
273
-
274
- ```typescript
275
- const device = new MatterbridgeEndpoint([contactSensor, powerSource], { id: 'EntryDoor' })
276
- .createDefaultIdentifyClusterServer()
277
- .createDefaultBasicInformationClusterServer('My entry door', '0123456789')
278
- .createDefaultBooleanStateClusterServer(true)
279
- .createDefaultPowerSourceReplaceableBatteryClusterServer(75)
280
- .addRequiredClusterServers(); // Always better to call it at the end of the chain to add all the not already created but required clusters.
281
- ```
282
-
283
- In the above example we create a contact sensor device type with also a power source device type feature replaceble battery.
284
-
285
- All device types are defined in src\matterbridgeDeviceTypes.ts and taken from the 'Matter-1.4-Device-Library-Specification.pdf'.
286
-
287
- All default cluster helpers are available as methods of MatterbridgeEndpoint.
288
-
289
- ## MatterbridgeEndpointOptions
290
-
291
- ```typescript
292
- const robot = new RoboticVacuumCleaner('Robot Vacuum', 'RVC1238777820', 'server');
293
- ```
294
-
295
- In the above example we create a Rvc device type with its own server node.
296
-
297
- The mode=`server` property of MatterbridgeEndpointOptions, allows to create an independent (not bridged) Matter device with its server node. In this case the bridge mode is not relevant.
298
-
299
- The mode=`matter` property of MatterbridgeEndpointOptions, allows to create a (not bridged) Matter device that is added to the Matterbridge server node alongside the aggregator.
300
-
301
- ## Plugin config file
302
-
303
- Each plugin has a minimal default config file injected by Matterbridge when it is loaded:
304
-
305
- ```typescript
306
- {
307
- name: plugin.name, // i.e. matterbridge-test
308
- type: plugin.type, // i.e. AccessoryPlatform or DynamicPlatform (on the first run is AnyPlatform cause it is still unknown)
309
- debug: false,
310
- unregisterOnShutdown: false
311
- }
312
- ```
313
-
314
- It is possible to add a different default config file to be loaded the first time the user installs the plugin.
315
-
316
- Matterbridge (only on the first load of the plugin and if a config file is not already present in the .matterbridge directory) looks for the default config file in the root of the plugin package. The file must be named '[PLUGIN-NAME].config.json' (i.e. 'matterbridge-test.config.json').
317
-
318
- In all subsequent loads the config file is loaded from the '.matterbridge' directory.
319
-
320
- ## Plugin schema file
321
-
322
- Each plugin has a minimal default schema file injected by Matterbridge when it is loaded:
323
-
324
- ```typescript
325
- {
326
- title: plugin.description,
327
- description: plugin.name + ' v. ' + plugin.version + ' by ' + plugin.author,
328
- type: 'object',
329
- properties: {
330
- name: {
331
- description: 'Plugin name',
332
- type: 'string',
333
- readOnly: true,
334
- },
335
- type: {
336
- description: 'Plugin type',
337
- type: 'string',
338
- readOnly: true,
339
- },
340
- debug: {
341
- description: 'Enable the debug for the plugin (development only)',
342
- type: 'boolean',
343
- default: false,
344
- },
345
- unregisterOnShutdown: {
346
- description: 'Unregister all devices on shutdown (development only)',
347
- type: 'boolean',
348
- default: false,
349
- },
350
- },
351
- }
352
- ```
353
-
354
- It is possible to add a different default schema file.
355
-
356
- The schema file is loaded from the root of the plugin package. The file must be named '[PLUGIN-NAME].schema.json' (i.e. 'matterbridge-test.schema.json').
357
-
358
- The properties of the schema file shall correspond to the properties of the config file.
359
-
360
- # Contribution Guidelines
361
-
362
- Thank you for your interest in contributing to my project!
363
-
364
- I warmly welcome contributions to this project! Whether it's reporting bugs, proposing new features, updating documentation, or writing code, your help is greatly appreciated.
365
-
366
- ## Getting Started
367
-
368
- - Fork this repository to your own GitHub account and clone it to your local device.
369
- - Make the necessary changes and test them out
370
- - Commit your changes and push to your forked repository
371
-
372
- ## Submitting Changes
373
-
374
- - Create a new pull request against the dev from my repository and I'll be glad to check it out
375
- - Be sure to follow the existing code style
376
- - Add unit tests for any new or changed functionality if possible
377
- - In your pull request, do describe what your changes do and how they work