matterbridge 1.2.3 → 1.2.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/README.md CHANGED
@@ -1,298 +1,307 @@
1
- # <img src="https://github.com/Luligu/matterbridge/blob/main/frontend/public/matterbridge%2064x64.png" alt="Matterbridge Logo" width="64px" height="64px">&nbsp;&nbsp;&nbsp;Matterbridge
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
- ![Node.js CI](https://github.com/Luligu/matterbridge/actions/workflows/build.yml/badge.svg)
6
-
7
-
8
- [![power by](https://img.shields.io/badge/powered%20by-matter--history-blue)](https://www.npmjs.com/package/matter-history)
9
- [![power by](https://img.shields.io/badge/powered%20by-node--ansi--logger-blue)](https://www.npmjs.com/package/node-ansi-logger)
10
- [![power by](https://img.shields.io/badge/powered%20by-node--persist--manager-blue)](https://www.npmjs.com/package/node-persist-manager)
11
-
12
- ---
13
-
14
-
15
- Matterbridge is a matter.js plugin manager.
16
-
17
- It allows you to have all your Matter devices up and running in a couple of minutes without
18
- having to deal with the pairing process of each single device.
19
-
20
- The developer just focuses on the device development extending the provided classes.
21
-
22
- Just pair Matterbridge once, and it will load all your registered plugins.
23
-
24
- This project aims to allow the porting of homebridge plugins to matterbridge plugins without recoding everything.
25
-
26
- It creates a device to pair in any ecosystem like Apple Home, Google Home, Amazon Alexa, or
27
- any other ecosystem supporting Matter.
28
-
29
- The project is build on top of https://github.com/project-chip/matter.js.
30
-
31
- A special thank to Apollon77 for his incredible work.
32
-
33
- ## Installation
34
-
35
- Follow these steps to install Matterbridge:
36
-
37
- on Windows:
38
- ```
39
- npm install -g matterbridge
40
- ```
41
-
42
- on Linux (you need the necessary permissions):
43
- ```
44
- sudo npm install -g matterbridge
45
- ```
46
-
47
- Test the installation with:
48
- ```
49
- matterbridge -bridge
50
- ```
51
-
52
- Now it is possible to open the frontend at the link provided (default: http://localhost:3000)
53
-
54
- ## Usage
55
-
56
- ### mode bridge
57
-
58
- ```
59
- matterbridge -bridge
60
- ```
61
-
62
- Matterbridge only exposes itself, and you have to pair it scanning the QR code shown in the frontend or in the console.
63
-
64
- ### mode childbridge
65
-
66
- ```
67
- matterbridge -childbridge
68
- ```
69
-
70
- Matterbridge exposes each registered plugins, and you have to pair each one by scanning the QR code shown in the frontend or in the console.
71
-
72
- ### Use matterbridge -help to see the command line syntax
73
-
74
- ```
75
- matterbridge -help
76
- ```
77
-
78
-
79
- ## Frontend
80
-
81
- Matterbridge has a frontend available on http://localhost:3000
82
-
83
- You can change the default port by adding the frontend parameter when you launch it.
84
- Here's how to specify a different port number:
85
- ```
86
- matterbridge -bridge -frontend [port number]
87
- ```
88
- ```
89
- matterbridge -childbridge -frontend [port number]
90
- ```
91
-
92
- Home page:
93
- ![See the screenshot here](https://github.com/Luligu/matterbridge/blob/main/Screenshot%20home.jpg)
94
-
95
- Devices page:
96
- ![See the screenshot here](https://github.com/Luligu/matterbridge/blob/main/Screenshot%20devices.jpg)
97
-
98
- ## Plugins
99
-
100
- ### Accessory platform example
101
-
102
- This an example of an accessory platform plugin.
103
-
104
- It exposes a cover device that continuously moves position and shows how to use the command handlers (you can control the device).
105
-
106
- An Accessory platform plugin only exposes one device.
107
-
108
- [See the plugin homepage here](https://github.com/Luligu/matterbridge-example-accessory-platform)
109
-
110
- ### Dynamic platform example
111
-
112
- This an example of a dynamic platform plugin.
113
-
114
- It exposes a switch with onOff, a light with onOff-levelControl-colorControl, an outlet with onOff and a cover device.
115
-
116
- All these devices continuously change state and position. The plugin also shows how to use all the command handlers (you can control all the devices).
117
-
118
- A Dynamic platform plugin exposes as many devices as you need (the limit for the Home app is 150 accessories for bridge).
119
-
120
- Matterbridge can run as many plugins as you want.
121
-
122
- [See the plugin homepage here](https://github.com/Luligu/matterbridge-example-dynamic-platform)
123
-
124
- ### Example plugins to show the usage of history in matter
125
-
126
- [Door plugin with history](https://github.com/Luligu/matterbridge-eve-door)
127
-
128
- [Motion plugin with history](https://github.com/Luligu/matterbridge-eve-motion)
129
-
130
- [Energy plugin with history](https://github.com/Luligu/matterbridge-eve-energy)
131
-
132
- [Weather plugin with history](https://github.com/Luligu/matterbridge-eve-weather)
133
-
134
- [Room plugin with history](https://github.com/Luligu/matterbridge-eve-room)
135
-
136
- ### Production-level plugins
137
-
138
- [zigbee2mqtt](https://github.com/Luligu/matterbridge-zigbee2mqtt)
139
-
140
- ## How to install and register a production-level plugin (from npm)
141
-
142
- To install i.e. https://github.com/Luligu/matterbridge-zigbee2mqtt
143
-
144
- On windows:
145
- ```
146
- cd $HOME\Matterbridge
147
- npm install -g matterbridge-zigbee2mqtt
148
- matterbridge -add matterbridge-zigbee2mqtt
149
- ```
150
-
151
- On linux:
152
- ```
153
- cd ~/Matterbridge
154
- sudo npm install -g matterbridge-zigbee2mqtt
155
- matterbridge -add matterbridge-zigbee2mqtt
156
- ```
157
-
158
- ## How to install and register a plugin for development (from github)
159
-
160
- To install i.e. https://github.com/Luligu/matterbridge-example-accessory-platform
161
-
162
- On windows:
163
- ```
164
- cd $HOME\Matterbridge
165
- ```
166
-
167
- On linux:
168
- ```
169
- cd ~/Matterbridge
170
- ```
171
-
172
- then clone the plugin
173
-
174
- ```
175
- git clone https://github.com/Luligu/matterbridge-example-accessory-platform
176
- cd matterbridge-example-accessory-platform
177
- npm install
178
- npm run build
179
- ```
180
-
181
- then add the plugin to Matterbridge
182
- ```
183
- matterbridge -add .\
184
- ```
185
-
186
- ## How to add a plugin to Matterbridge
187
-
188
- ```
189
- matterbridge -add [plugin path]
190
- ```
191
-
192
- ## How to remove a plugin from Matterbridge
193
-
194
- ```
195
- matterbridge -remove [plugin path]
196
- ```
197
-
198
- ## How to disable a registered plugin
199
-
200
- ```
201
- matterbridge -disable [plugin path]
202
- ```
203
-
204
- ## How to enable a registered plugin
205
-
206
- ```
207
- matterbridge -enable [plugin path]
208
- ```
209
-
210
- ## How to create your plugin
211
-
212
- The easiest way is to clone:
213
-
214
- - https://github.com/Luligu/matterbridge-example-accessory-platform if you want to create an Accessory Platform Plugin.
215
-
216
-
217
- - https://github.com/Luligu/matterbridge-example-dynamic-platform if you want to create a Dynamic Platform Plugin.
218
-
219
- Then change the name, version, description and author in the package.json.
220
-
221
- Add your plugin logic in platform.ts.
222
-
223
- ## MatterbridgeDynamicPlatform and MatterbridgeAccessoryPlatform api
224
-
225
- ### name: string
226
- The plugin name.
227
-
228
- ### type: string
229
- The plugin platform type.
230
-
231
- ### config: object
232
- The plugin config (loaded before the platform constructor is called and saved after onShutdown() is called).
233
- Here you can store your plugin configuration (see matterbridge-zigbee2mqtt for example)
234
-
235
- ### async onStart(reason?: string)
236
- The method onStart() is where you have to create your MatterbridgeDevice and add all needed clusters and command handlers.
237
-
238
- The MatterbridgeDevice class has the create cluster methods already done and all command handlers needed (see plugin examples).
239
-
240
- The method is called when Matterbridge load the plugin.
241
-
242
- ### async onConfigure()
243
- The method onConfigure() is where you can configure or initialize your device.
244
-
245
- The method is called when the platform is commissioned.
246
-
247
- ### async onShutdown(reason?: string)
248
- The method onShutdown() is where you have to eventually cleanup some resources.
249
-
250
- The method is called when Matterbridge is shutting down.
251
-
252
- ### async registerDevice(device: MatterbridgeDevice)
253
- After you created your device, add it to the platform.
254
-
255
- ### async unregisterDevice(device: MatterbridgeDevice)
256
- You can unregister one or more device.
257
-
258
- ### async unregisterAllDevices()
259
- You can unregister all devices you added.
260
-
261
- It can be useful to call this method from onShutdown() if you don't want to keep all the devices during development.
262
-
263
- ## MatterbridgeDevice api
264
-
265
-
266
- # Contribution Guidelines
267
-
268
- Thank you for your interest in contributing to my project!
269
-
270
- 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.
271
-
272
- ## Getting Started
273
-
274
- - Fork this repository to your own GitHub account and clone it to your local device.
275
- - Make the necessary changes and test them out
276
- - Commit your changes and push to your forked repository
277
-
278
- ## Submitting Changes
279
-
280
- - Create a new pull request from my repository and I'll be glad to check it out
281
- - Be sure to follow the existing code style
282
- - Add unit tests for any new or changed functionality if possible
283
- - In your pull request, do describe what your changes do and how they work
284
-
285
- ## Code of Conduct
286
-
287
- We believe in a welcoming and respectful community for all. Please make sure to follow our [Code of Conduct](LINK_TO_CODE_OF_CONDUCT) in all your interactions with the project.
288
-
289
- ## Support
290
-
291
- If you find this project helpful and you wish to support the ongoing development, you can do so by buying me a coffee.
292
- Click on the badge below to get started:
293
-
294
- <a href="https://www.buymeacoffee.com/luligugithub">
295
- <img src="./yellow-button.png" alt="Buy me a coffee" width="120">
296
- </a>
297
-
1
+ # <img src="https://github.com/Luligu/matterbridge/blob/main/frontend/public/matterbridge%2064x64.png" alt="Matterbridge Logo" width="64px" height="64px">&nbsp;&nbsp;&nbsp;Matterbridge
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
+ ![Node.js CI](https://github.com/Luligu/matterbridge/actions/workflows/build.yml/badge.svg)
6
+
7
+
8
+ [![power by](https://img.shields.io/badge/powered%20by-matter--history-blue)](https://www.npmjs.com/package/matter-history)
9
+ [![power by](https://img.shields.io/badge/powered%20by-node--ansi--logger-blue)](https://www.npmjs.com/package/node-ansi-logger)
10
+ [![power by](https://img.shields.io/badge/powered%20by-node--persist--manager-blue)](https://www.npmjs.com/package/node-persist-manager)
11
+
12
+ ---
13
+
14
+
15
+ Matterbridge is a matter.js plugin manager.
16
+
17
+ It allows you to have all your Matter devices up and running in a couple of minutes without
18
+ having to deal with the pairing process of each single device.
19
+
20
+ The developer just focuses on the device development extending the provided classes.
21
+
22
+ Just pair Matterbridge once, and it will load all your registered plugins.
23
+
24
+ This project aims to allow the porting of homebridge plugins to matterbridge plugins without recoding everything.
25
+
26
+ It creates a device to pair in any ecosystem like Apple Home, Google Home, Amazon Alexa, or
27
+ any other ecosystem supporting Matter like Home Assistant.
28
+
29
+ Matterbridge is light weight and run also on slow Linux machine with 512MB of memory.
30
+ You don't need a dedicated new machine.
31
+
32
+ It runs perfectly on Windows too.
33
+
34
+ The project is build on top of https://github.com/project-chip/matter.js.
35
+
36
+ A special thank to Apollon77 for his incredible work.
37
+
38
+ ## Installation
39
+
40
+ Follow these steps to install Matterbridge:
41
+
42
+ on Windows:
43
+ ```
44
+ npm install -g matterbridge
45
+ ```
46
+
47
+ on Linux (you need the necessary permissions):
48
+ ```
49
+ sudo npm install -g matterbridge
50
+ ```
51
+
52
+ Test the installation with:
53
+ ```
54
+ matterbridge -bridge
55
+ ```
56
+
57
+ Now it is possible to open the frontend at the link provided (default: http://localhost:3000)
58
+
59
+ ## Usage
60
+
61
+ ### mode bridge
62
+
63
+ ```
64
+ matterbridge -bridge
65
+ ```
66
+
67
+ Matterbridge only exposes itself, and you have to pair it scanning the QR code shown in the frontend or in the console.
68
+
69
+ ### mode childbridge
70
+
71
+ ```
72
+ matterbridge -childbridge
73
+ ```
74
+
75
+ Matterbridge exposes each registered plugins, and you have to pair each one by scanning the QR code shown in the frontend or in the console.
76
+
77
+ ### Use matterbridge -help to see the command line syntax
78
+
79
+ ```
80
+ matterbridge -help
81
+ ```
82
+
83
+
84
+ ## Frontend
85
+
86
+ Matterbridge has a frontend available on http://localhost:3000
87
+
88
+ You can change the default port by adding the frontend parameter when you launch it.
89
+ Here's how to specify a different port number:
90
+ ```
91
+ matterbridge -bridge -frontend [port number]
92
+ ```
93
+ ```
94
+ matterbridge -childbridge -frontend [port number]
95
+ ```
96
+
97
+ Home page:
98
+ ![See the screenshot here](https://github.com/Luligu/matterbridge/blob/main/Screenshot%20home.jpg)
99
+
100
+ Devices page:
101
+ ![See the screenshot here](https://github.com/Luligu/matterbridge/blob/main/Screenshot%20devices.jpg)
102
+
103
+ ## Plugins
104
+
105
+ ### Accessory platform example
106
+
107
+ This an example of an accessory platform plugin.
108
+
109
+ It exposes a cover device that continuously moves position and shows how to use the command handlers (you can control the device).
110
+
111
+ An Accessory platform plugin only exposes one device.
112
+
113
+ [See the plugin homepage here](https://github.com/Luligu/matterbridge-example-accessory-platform)
114
+
115
+ ### Dynamic platform example
116
+
117
+ This an example of a dynamic platform plugin.
118
+
119
+ It exposes a switch with onOff, a light with onOff-levelControl-colorControl, an outlet with onOff and a WindoweCovering device.
120
+
121
+ All these devices continuously change state and position. The plugin also shows how to use all the command handlers (you can control all the devices).
122
+
123
+ A Dynamic platform plugin exposes as many devices as you need (the limit for the Home app is 150 accessories for bridge).
124
+
125
+ Matterbridge can run as many plugins as you want.
126
+
127
+ [See the plugin homepage here](https://github.com/Luligu/matterbridge-example-dynamic-platform)
128
+
129
+ ### Example plugins to show the usage of history in matter
130
+
131
+ [Door plugin with history](https://github.com/Luligu/matterbridge-eve-door)
132
+
133
+ [Motion plugin with history](https://github.com/Luligu/matterbridge-eve-motion)
134
+
135
+ [Energy plugin with history](https://github.com/Luligu/matterbridge-eve-energy)
136
+
137
+ [Weather plugin with history](https://github.com/Luligu/matterbridge-eve-weather)
138
+
139
+ [Room plugin with history](https://github.com/Luligu/matterbridge-eve-room)
140
+
141
+ The history works in both bridge and childbridge mode.
142
+ The Eve app only shows the history when the plugins run like an AccessoryPlatform in childbridge mode.
143
+
144
+ ### Production-level plugins
145
+
146
+ [zigbee2mqtt](https://github.com/Luligu/matterbridge-zigbee2mqtt)
147
+
148
+ ## How to install and register a production-level plugin (from npm)
149
+
150
+ To install i.e. https://github.com/Luligu/matterbridge-zigbee2mqtt
151
+
152
+ On windows:
153
+ ```
154
+ cd $HOME\Matterbridge
155
+ npm install -g matterbridge-zigbee2mqtt
156
+ matterbridge -add matterbridge-zigbee2mqtt
157
+ ```
158
+
159
+ On linux:
160
+ ```
161
+ cd ~/Matterbridge
162
+ sudo npm install -g matterbridge-zigbee2mqtt
163
+ matterbridge -add matterbridge-zigbee2mqtt
164
+ ```
165
+
166
+ ## How to install and register a plugin for development (from github)
167
+
168
+ To install i.e. https://github.com/Luligu/matterbridge-example-accessory-platform
169
+
170
+ On windows:
171
+ ```
172
+ cd $HOME\Matterbridge
173
+ ```
174
+
175
+ On linux:
176
+ ```
177
+ cd ~/Matterbridge
178
+ ```
179
+
180
+ then clone the plugin
181
+
182
+ ```
183
+ git clone https://github.com/Luligu/matterbridge-example-accessory-platform
184
+ cd matterbridge-example-accessory-platform
185
+ npm install
186
+ npm run build
187
+ ```
188
+
189
+ then add the plugin to Matterbridge
190
+
191
+ ```
192
+ matterbridge -add .\
193
+ ```
194
+
195
+ ## How to add a plugin to Matterbridge
196
+
197
+ ```
198
+ matterbridge -add [plugin path or plugin name]
199
+ ```
200
+
201
+ ## How to remove a plugin from Matterbridge
202
+
203
+ ```
204
+ matterbridge -remove [plugin path or plugin name]
205
+ ```
206
+
207
+ ## How to disable a registered plugin
208
+
209
+ ```
210
+ matterbridge -disable [plugin path or plugin name]
211
+ ```
212
+
213
+ ## How to enable a registered plugin
214
+
215
+ ```
216
+ matterbridge -enable [plugin path or plugin name]
217
+ ```
218
+
219
+ ## How to create your plugin
220
+
221
+ The easiest way is to clone:
222
+
223
+ - https://github.com/Luligu/matterbridge-example-accessory-platform if you want to create an Accessory Platform Plugin.
224
+
225
+
226
+ - https://github.com/Luligu/matterbridge-example-dynamic-platform if you want to create a Dynamic Platform Plugin.
227
+
228
+ Then change the name, version, description and author in the package.json.
229
+
230
+ Add your plugin logic in platform.ts.
231
+
232
+ ## MatterbridgeDynamicPlatform and MatterbridgeAccessoryPlatform api
233
+
234
+ ### name: string
235
+ The plugin name.
236
+
237
+ ### type: string
238
+ The plugin platform type.
239
+
240
+ ### config: object
241
+ The plugin config (loaded before the platform constructor is called and saved after onShutdown() is called).
242
+ Here you can store your plugin configuration (see matterbridge-zigbee2mqtt for example)
243
+
244
+ ### async onStart(reason?: string)
245
+ The method onStart() is where you have to create your MatterbridgeDevice and add all needed clusters and command handlers.
246
+
247
+ The MatterbridgeDevice class has the create cluster methods already done and all command handlers needed (see plugin examples).
248
+
249
+ The method is called when Matterbridge load the plugin.
250
+
251
+ ### async onConfigure()
252
+ The method onConfigure() is where you can configure or initialize your device.
253
+
254
+ The method is called when the platform is commissioned.
255
+
256
+ ### async onShutdown(reason?: string)
257
+ The method onShutdown() is where you have to eventually cleanup some resources.
258
+
259
+ The method is called when Matterbridge is shutting down.
260
+
261
+ ### async registerDevice(device: MatterbridgeDevice)
262
+ After you created your device, add it to the platform.
263
+
264
+ ### async unregisterDevice(device: MatterbridgeDevice)
265
+ You can unregister one or more device.
266
+
267
+ ### async unregisterAllDevices()
268
+ You can unregister all devices you added.
269
+
270
+ It can be useful to call this method from onShutdown() if you don't want to keep all the devices during development.
271
+
272
+ ## MatterbridgeDevice api
273
+
274
+
275
+ # Contribution Guidelines
276
+
277
+ Thank you for your interest in contributing to my project!
278
+
279
+ 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.
280
+
281
+ ## Getting Started
282
+
283
+ - Fork this repository to your own GitHub account and clone it to your local device.
284
+ - Make the necessary changes and test them out
285
+ - Commit your changes and push to your forked repository
286
+
287
+ ## Submitting Changes
288
+
289
+ - Create a new pull request from my repository and I'll be glad to check it out
290
+ - Be sure to follow the existing code style
291
+ - Add unit tests for any new or changed functionality if possible
292
+ - In your pull request, do describe what your changes do and how they work
293
+
294
+ ## Code of Conduct
295
+
296
+ We believe in a welcoming and respectful community for all. Please make sure to follow our [Code of Conduct](LINK_TO_CODE_OF_CONDUCT) in all your interactions with the project.
297
+
298
+ ## Support
299
+
300
+ If you find this project helpful and you wish to support the ongoing development, you can do so by buying me a coffee.
301
+ Click on the badge below to get started:
302
+
303
+ <a href="https://www.buymeacoffee.com/luligugithub">
304
+ <img src="./yellow-button.png" alt="Buy me a coffee" width="120">
305
+ </a>
306
+
298
307
  Thank you for your support!