Matterbridge is a matter.js plugin manager.
It allows you to have all your Matter devices up and running in a couple of minutes without having to deal with the pairing process of each single device.
The developer just focuses on the device development extending the provided classes.
Just pair Matterbridge once, and it will load all your registered plugins.
This project aims to allow the porting of homebridge plugins to matterbridge plugins without recoding everything.
It creates a device to pair in any ecosystem like Apple Home, Google Home, Amazon Alexa, or any other ecosystem supporting Matter like Home Assistant.
You don't need a hub or a dedicated new machine.
No complex setup just copy paste the installation scripts.
Matterbridge is light weight and run also on slow Linux machine with 512MB of memory.
It runs perfectly on Windows too.
If you like this project and find it useful, please consider giving it a star on GitHub at https://github.com/Luligu/matterbridge and sponsoring it.
The project is build on top of https://github.com/project-chip/matter.js.
A special thank to Apollon77 for his incredible work.
To run Matterbridge, you need either a Node.js environment or Docker installed on your system.
Follow these steps to install Matterbridge:
npm install -g matterbridge --omit=dev
on Linux you may need the necessary permissions:
sudo npm install -g matterbridge --omit=dev
Test the installation with:
matterbridge
Now it is possible to open the frontend at the link provided in the log (e.g. http://MATTERBIDGE-IPV4-ADDRESS:8283).
You can then change the bridge mode and other parameters from the frontend.
matterbridge -bridge
This force Matterbridge to load in bridge mode.
Matterbridge only exposes itself, and you have to pair it scanning the QR code shown in the frontend or in the console.
matterbridge -childbridge
This force Matterbridge to load in childbridge mode.
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.
matterbridge -help
Matterbridge has a frontend available on http://MATTERBIDGE-IPV4-ADDRESS:8283 and http://[MATTERBIDGE-IPV6-ADDRESS]:8283
You can change the default port by adding the frontend parameter when you run it.
Here's how to specify a different port number:
matterbridge -frontend [port number]
From the frontend you can do all operations in an easy way.
Devices page: See the screenshot here
Logs page: See the screenshot here
Config editor: See the screenshot here
Home assistant add-on configurations
The other Home Assistant Community Add-ons and plugins are not verified to work with Matterbridge. I strongly advise against using them. If you do use them and encounter an issue (which is likely because some do not meet the Matterbridge guidelines), please do not open an issue in the Matterbridge repository.
Matterbridge shelly plugin allows you to expose all Shelly Gen 1, Gen 2, Gen 3 and BLU devices to Matter.
Features:
- Shellies are automatically discovered using mDNS.
- Shelly wifi battery-powered devices are supported.
- Shelly wifi battery-powered devices with sleep_mode are supported.
- Shelly BLU devices are supported through local devices configured as ble gateway.
- Discovered shellies are stored in local storage for quick loading on startup.
- The components exposed are Light (with brightness and RGB color), Switch, Relay, Roller, Cover, PowerMeter, Temperature, Humidity and Input.
- All components expose the electrical measurements with the EveHistory cluster (displayed on HA), waiting for the controllers to upgrade to the Matter 1.3 specs.
- Shellies are controlled locally, eliminating the need for cloud or MQTT (which can both be disabled).
- Shelly Gen 1 devices are controlled using the CoIoT protocol (see the note below).
- Shelly Gen 2 and Gen 3 devices are controlled using WebSocket.
- The Matter device takes the name configured in the Shelly device's web page.
- If the device has a firmware update available, a message is displayed.
- If the device's CoIoT protocol is not correctly configured, a message is displayed.
- If the device cover/roller component is not calibrated, a message is displayed.
- A 10-minute timer checks if the device has reported within that time frame, and fetch un update.
Matterbridge zigbee2mqtt is a matterbridge production-level plugin that expose all zigbee2mqtt devices and groups to Matter.
No hub or dedicated hardware needed.
Matterbridge Somfy Tahoma is a matterbridge production-level plugin that expose the Somfy Tahoma screen devices to Matter.
This an example of an accessory platform plugin.
It exposes a virtual cover device that continuously moves position and shows how to use the command handlers (you can control the device).
An Accessory platform plugin only exposes one device.
This an example of a dynamic platform plugin.
It exposes:
- a switch with onOff cluster
- a light with onOff
- a light with onOff and levelControl (dimmer)
- a light with onOff, levelControl and colorControl (with XY, HS and CT) clusters
- a light with onOff, levelControl and colorControl (with HS only) clusters
- a light with onOff, levelControl and colorControl (with XY only) clusters
- a light with onOff, levelControl and colorControl (with CT only) clusters
- an outlet (plug) with onOff cluster
- a cover with windowCovering cluster
- a lock with doorLock cluster
- a thermo with thermostat cluster and 3 sub endpoints with flowMeasurement cluster, temperatureMeasurement cluster and relativeHumidityMeasurement cluster (to show how to create a composed device with sub endpoints)
- a fan with FanControl cluster
- a rainSensor device
- a waterFreezeDetector device
- a waterLeakDetector device
- a smokeCoAlarm device
All these virtual devices continuously change state and position. The plugin also shows how to use all the command handlers (you can control all the devices).
A Dynamic platform plugin exposes as many devices as you need (the limit for the Home app is 150 accessories for bridge).
The history works in both bridge and childbridge mode.
The Eve app only shows the history when the plugins run like an AccessoryPlatform in childbridge mode (this means the plugin is paired directly).
Just open the frontend on the link provided in the log, select a plugin and click install.
To install i.e. https://github.com/Luligu/matterbridge-zigbee2mqtt
On windows:
cd $HOME\Matterbridge
npm install -g matterbridge-zigbee2mqtt
matterbridge -add matterbridge-zigbee2mqtt
On linux:
cd ~/Matterbridge
sudo npm install -g matterbridge-zigbee2mqtt
matterbridge -add matterbridge-zigbee2mqtt
matterbridge -add [plugin path or plugin name]
matterbridge -remove [plugin path or plugin name]
matterbridge -disable [plugin path or plugin name]
matterbridge -enable [plugin path or plugin name]
How to remove the commissioning information for Matterbridge so you can pair it again (bridge mode). Shutdown Matterbridge before!
matterbridge -reset
How to remove the commissioning information for a registered plugin so you can pair it again (childbridge mode). Shutdown Matterbridge before!
matterbridge -reset [plugin path or plugin name]
matterbridge -factoryreset
This will reset the internal storages. All commissioning informations will be lost. All plugins will be unregistered.
Place your own certificates in the .matterbridge/cert
directory:
cert.pem
key.pem
ca.pem
(optional)
Add the -ssl parameter to the command line. If desired, you can also change the frontend port with -frontend 443.
matterbridge -ssl -frontend 443
If the certificate are correctly configured, you will be able to connect with https to the frontend.
In the frontend, go to settings and enable debug mode as shown below:
Wait a few minutes to allow the logs to to accumulate.
Then, from the dots menu in the frontend, download the matterbridge.log
and matter.log
files.
This message may appear after Matterbridge restarts, indicating that the controller is still using a session from the previous connection that has since been closed. After some time, the controller will reconnect. In this context, the message is not indicative of a problem.
The HomePods, being a WiFi devices, sometimes pruduce message trasmission errors. The Apple TV with network cable is more reliable (but also more expensive).
All issues have been solved from the version 17.5 of the HomePod/AppleTV. Now they are stable.
If you have more then one Apple TV or Home Pod, you can herve better results setting to disabled "Automatic Selection" in "Home Setting", "Home Hubs & Bridges". When "Automatic selection" is disabled, select your Apple Tv if you have one or any of your Home Pod. In this way you should not have anymore more then one session for fabric.
So far is the only controller supporting some Matter 1.2 and 1.3 device type:
- airQualitySensor code 0x002c (Matter 1.2)
- waterFreezeDetector code 0x0041 (Matter 1.3 with only BooleanState cluster)
- waterLeakDetector code 0x0043 (Matter 1.3 with only BooleanState cluster)
- rainSensor code 0x0044 (Matter 1.3 with only BooleanState cluster)
- deviceEnergyManagement code 0x050d (Matter 1.3 with only DeviceEnergyManagementMode cluster)
Electrical measurements:
- electrical measurements from EveHistoryCluster (used in Matterbridge plugins)
- electricalSensor code 0x0510 with clusters: ElectricalPowerMeasurement and ElectricalEnergyMeasurement (still in dev but fully working!)
Other supported cluster:
- ModeSelect
- If HA doesn't show all devices, reload the Matter Server Integration or reboot HA
- Home Assistant doesn't seem to always react when a device is removed from the bridge: they remain in HA unavailable forever...
- Use Apple Home when you have to choose the controller type even if you pair Matterbridge directly with HA.
If you face a problem pairing to Google Home from Ios app the solution is there #61.
If you face a problem changing the brightness check this for the explanation: Luligu/matterbridge-zigbee2mqtt#80
No other issues reported so far.
Tested by Tamer Salah
Alexa needs the standard port 5540 to pair (from matter.js readme).
There is no support for these Matter device types:
- pressure sensor
- flow sensor
- light sensor
In the zigbee2mqtt and shelly plugins select the option to expose the switch devices like light or outlet cause they don't show up like switch (Matterbridge uses a modified switch device type without client cluster).
Tested by Tamer Salah
No issues reported so far.
Supports also:
- air Quality Sensor (Matter 1.2)
- smoke Co Alarm
Tested by Tamer Salah
eWeLink needs the standard port 5540 for commissioning.
Check the matter.js readme.
We believe in a welcoming and respectful community for all. Please make sure to follow our Code of Conduct in all your interactions with the project.
If you find this project helpful and you wish to support the ongoing development, you can do so by buying me a coffee. On my side I sponsor the packages that I use in this project. It would be nice to have sponsors too. Click on the badge below to get started:
Thank you for your support!