Thread & Matter on Unraid with the SMLIGHT MR4U
Because nothing is ever just an add-onWith Zigbee running without issues for years I thought getting Matter-over-Thread up and running would be nothing more than just plug in a device, add it to Home Assistant and boom, you're ready to go. On paper yes, in practice not even close, especially when you don't run the supervised version of Home Assistant.
First the "easy" part, finding a device that can function as an Thread border router. I had 3 of them in my setup already, 2 Homepods gen 2 and an Apple TV 4k so i started with that and soon came to the conclusion that it was a bad decision since the Apple TV randomly stopped advertising it's routes and there was no way to debug it and multiple reboots didn't fix it.
It worked fine for a few weeks but after an internet outage i had and a reboot of all network equipment it just stopped and i had zero tools to fix it.
Besides that, i needed an good excuse for some new hardware and now i had one (although i had a CC2652 stick laying around in my drawer that could have been used also)
So in the search for a decent Thread border router i stumbled upon the SMLIGHT devices. Single radio devices but they also have Multi Radio devices so i could have Zigbee and Thread on the same device!
Main difference between the SMLIGHT MR devices and the Sonoff Zigbee Dongle is that SMLIGHT puts 2 radios on a single device, each with it's own software stack which results in both radios doing one thing properly instead of trying to run both on one chip like multiple manufacturers tried with experimental firmware but none of them succeeded.
Most SMLIGHT MR devices have 2 different radios on board. A Texas Instruments for Zigbee, and a Silicon Labs for Thread. You could switch them but it wouldn't make sense since TI chips have the most mature and battle-tested Zigbee firmware (years of Zigbee2MQTT/ZHA community support), while Silicon Labs has been the primary driver behind Thread/Matter development, making their Thread stack more mature and better supported.
SMLIGHT MR1, MR1U, MR2, MR3, MR4, MR4U, MR5...
Then comes the hardest part, finding the right SMLIGHT MR version that fits my needs. The SMLIGHT website is a nightmare to be honest and i spend more time on finding the difference between al MR devices than setting it up and get everything to work.
Not sure why they would bring out so many versions while the differences are so small. In my opinion they should have picked one and focused on making that the best it can be, rather than fragmenting their lineup with marginal chip upgrades that they themselves call "marketing gimmicks".
Long story short, i picked the "latest" addition, the MR4U but i already noticed there is an MR5U available also which weirdly enough doesn't seem to have "better" hardware than the MR4U. Like i said, the website and the naming of all variations is a mess and it's a nightmare for most people to find out which version fits their needs best.
I ordered it on AliExpress for roughly 55 euro including shipping since it was not available anywhere else at the time of writing and it arrived within a week without any issues.
The SMLIGHT website doesn't list the MR4U but only the "regular" MR4, the U could stand for upgrade or updated version... and it is but it's nowhere specified WHAT the actual upgrade is. For as far as i could find the U means it has USB passthrough but other than that both versions are identical.
The hardware
Well not much to tell about that to be honest, i can spread out all the "marketing bs" again like the average youtuber and say it's the most attractive and amazing device i have ever seen... but its not and to be honest, it doesn't have to be pretty or good looking.
It's still an "ugly" device that i wouldn't put in plain sight if i don't have to and it also doesn't have spectacular hardware you couldn't find anywhere else on the market. What is does have is POE and the fact that it offers 2 radios in a small package which makes it easier to put it far away from WiFi access points etc so we can minimize the interference with our Zigbee and Thread networks.
So long story short, for al the "this is amazing mike Tell Sell talk" you should head over to Youtube 😉. The hardware is decent and both radios are of the more recent generations and have a solid firmware underneath it which makes the MR4U a pretty decent coordinator for your smart home setup on paper.
The software
Same story as for the hardware, it's functional, it works and that's it! And that's a good thing because when everything is up and running there is no reason to come back to the web interface anymore unless you need to do an upgrade of the firmware, to reboot the device etc.
What is important to do before we can start with setting up Thread is to flash the correct firmware to the corresponding radio.
As you can see i flashed the Silicon Labs radio with Matter over Thread firmware and used the CC2674 as a Zigbee coordinator. You could switch them around but as said before, TI chips have the most mature and battle-tested Zigbee firmware. And since i have around 70+ Zigbee devices in my house and only 4 Matter devices i don't see any reason to switch them over.
After powering everything up and setting up the right firmware for each radio you can leave the SMLIGHT web interface for what it is and come back later to go through all other options available.
One thing to do afterwards is to at least set a username and password on the web interface but also limit access to the socket to keep things secure.
Now the fun part, get that SMLIGHT MR4U to work with Matter over Thread in combination with Home Assistant and the other Docker containers you need.
1. Give the SMLIGHT MR4U a fixed IP address.
Before anything else, give your MR4U a DHCP reservation on your router. Mine is at 192.168.1.251. You don't want this thing changing IP while your OTBR container is trying to talk to it.
2. The OTBR container (bnutzer/otbr-tcp)
Here's one of the things that can be easily missed, the standard "openthread/otbr" Docker image does not support TCP radio connections out of the box. It expects a local USB device and since i use mine over POE that isn't going to work.
I found bnutzer/otbr-tcp which is built specifically for network-attached Thread radios like the SMLIGHT devices. It handles the socat TCP-to-PTY bridging internally and is pretty easy to set up and doesn't have any additional bloat.
| Name | OTBR |
| Repository | bnutzer/otbr-tcp |
| Network type: | Host |
| Priviliged | On |
| DEVICE | /dev/net/tun |
| RCP_HOST | 192.168.1.251 |
| OTBR_BACKBONE_IF | br0 |
| /mnt/cache/appdata/otbr/ | /var/lib/thread |
This one bit me in the ***. The default backbone interface is eth0, but Unraid uses br0. If you leave it as eth0, the container will start fine but won't show up in Home Assistant's Thread integration. Set it to br0 and if you already have something running on port 8081 make sure to choose something different for it also with the OTBR_REST_LISTEN_PORT variable.
Hit apply and verify everything is up and running and started properly,
s6-rc: info: service socat: starting
s6-rc: info: service socat successfully started
s6-rc: info: service otbr-agent: starting
s6-rc: info: service otbr-agent successfully started
otbr-agent is ready.3. Enable IPv6 in your Unraid network settings
One of the settings that need to be made is enabling IPv6 on your Unraid machine, by default it only has IPv4 enabled but we need IPv6 to get Matter over Thread working. One simple change does the trick, head over to the network tab and select IPv4 + IPv6 at the Network protocol.
4. IPv6 sysctl fixes
Before we proceed spinning up the Matter container there is one important thing, this is the part that'll have you staring at logs wondering why the hell Matter can't find anything on the network.
Docker enables IP forwarding on the host, which makes Linux silently ignore IPv6 Router Advertisements. Thread and Matter need IPv6 to work so we need to fix that. Run the following commands in the console (Not in a Docker container but in the Unraid console!!!),
sysctl -w net.ipv6.conf.br0.accept_ra=2
sysctl -w net.ipv6.conf.br0.accept_ra_rt_info_max_plen=128These will make it work for now BUT they won't survive a reboot of Unraid so after we verified that everything is working correctly we need to make them persistent by adding them to Unraid's "go" file,
echo 'sysctl -w net.ipv6.conf.br0.accept_ra=2' >> /boot/config/go
echo 'sysctl -w net.ipv6.conf.br0.accept_ra_rt_info_max_plen=128' >> /boot/config/go
The =2 means "accept Router Advertisements even when acting as a router (ip_forwarding enabled)." The default =1 only accepts RAs when forwarding is off which it never is with Docker running.
5. Matter
You also need the Matter Server running as a separate container since you can't use the HA add-on when running Home Assistant via Docker. Luckily Nabu Casa (company behind Home Assistant) provides it here it's quite easy to set up and get it up and running under Unraid.
| Name | Matter |
| Network type | Host |
| /mnt/cache/appdata/matter/data | /data |
That's it. No special variables needed for the basic setup. The Matter Server will listen on port 5580 by default (WebSocket).
You might see some Network is unreachable errors in the logs related to IPv6 mDNS advertising if the sysctl fixes from Step 4 are applied and the server says "Matter Server successfully initialized", you're good.
6. Home Assistant
Now wire it all up in HA. Go to Settings → Devices & Services → Add Integration.
OpenThread Border Router
- Search for Open Thread Border Router
- Enter the URL: http://YOUR_UNRAID_IP:8081 or the corresponding port if you changed it in step 2
- Submit it and you should be done on the Open Thread Border Router integration
Thread
- Should auto-discover, or add it manually
- Click Configure on the Thread integration
- Your OTBR should appear as a border router in the preferred network
- If you have Apple HomePods / Apple TV / Amazon Echo or any other capable devices, they'll show up too as additional border routers that's fine, more border routers = more redundancy
- Make sure the OTBR has the key+phone icon (iOS credentials). If not, click the three dots and "Add to preferred network", then three dots again "Use router for Android + iOS credentials"
Matter
- Search for Matter
- Enter the WebSocket URL: ws://YOUR_UNRAID_IP:5580/ws
Add your devices
- Now add a matter device with your phone, open up the Home Assistant companion app and head over to Settings → Matter
- "Add new device" and scan the QR code on the device
- Done!
That's it
You should now have a working Thread border router and Matter server, all running on Docker on Unraid, with the SMLIGHT MR4U providing the Thread radio over the network.
The OTBR logs should show it sending and receiving MLE Advertisements from other Thread devices on your mesh. If you have Apple Home devices acting as border routers, you'll see them chatting with your OTBR and they'll all be on the same Thread network.