I'm documenting my experience of using node-red-matter-bridge to control my home IoT, in case it helps or motivates others to give it a try
My knowledge of matter is very limited, so this is my interpretation, but please correct me if I'm wrong, and I'll update this post.
First Steps
- Matter, works by communicating via your local area network, either by wifi or ethernet, and its essential that you have the same LAN between the device your Node-RED is running on and your Matter controller (Google Home, Nest Mini etc).
- Matter also needs a 'hub' to translate messages to the local network. There are many standalone Hubs, but they are already built into most smart speakers such as Google Home, Nest, Nest Minis, etc. Googling will give you the full current list. For the purposes of this post, I'm using a Google Home speaker (1st generation).
Add the @sammachin/node-red-matter-bridge
nodes to your palette, and drop a 'On-Off Light' node onto your workspace (although any of the nodes would do), give it a name
and add a new configuration, add a config name, and set the correct network interface (the one your controller is also in) in my example below I'm using lo0 (localhost). Leave the other settings unchanged.
Deploy your changes, and after a few seconds, you should get a green 'ready' light
At this stage, open up the node, and open the configuration again, but this time you should now see that a QR code has been generated & added at the bottom of the config page.
Using your phone, open up a QR reader app (any will do), and scan the QR code, which will produce a weird string of letters/numbers that looks nothing like a URL, but open it, and it should present you with this screen
Choose Google Home
and Agree
I'm Ready, and you may get this warning (because it's not a real certified device, but pseudo devices in node-RED.
Set up anyway, and if all's gone well, finally...
Now, after a few seconds, the pseudo device (Test Light) should be active in your dashboard, and can also be seen as an entry in the Google Home app on your phone.
Test if it's working by adding a debug node, and asking google to "switch the Test Light on", and you should see an output in the debug pane.
A typical output from the 'On-Off Light' is an object {state: true}
or of course {state: false}
which can then be mapped to control any device, such as a shelly, tasmota, MQTT etc.
Controlling devices from a dashboard switch
Taking this a stage further, it may be that you would wish to also control the device from a dashboard, as well as voice commands. This can be done by selecting 'Passthrough input msg to Output' in the node config, and feed in the same objects into the 'On-Off Light' node input.
This would result in the Google Home App being updated with that status, and the msg emerging from it's output which is mapped to the device.