I was massively frustrated today because I bought the ZBT-2 expecting that setting up Thread will just work with HA. Which it didn’t. At all. The whole documentation is written for HAOS and only HAOS. (Bear with me, I’m trying to make this a helpful rant.)
Last time I checked simply running HA in a container is a supported method, too. HA in a container requires many more steps to set up Thread that need to be picked from random forum threads. Not to mention that OpenThread Border Router is more of a device developer’s thing than documented for Thread admins.
I think I figured it out though.
First I checked the HA source code. I needed to figure out how this weird check works that erroneously claims that the ZHA integration owns the secondary ZBT-2. I still don’t understand that, but it got me onto the tracks of OTBR - OpenThread Border Router. Which becomes important later on.
Second I spent a long evening in front of the HA Pi, trying to get “Home Assistant Connect ZBT-2” to show the two ZBT-2’s correctly. It didn’t and it still doesn’t in the end. Even when I started HA only with the ZBT-2 for Thread it showed only the Zigbee-ZBT-2 as connected. (Yes, I checked the serial number.) However, at that point the ZHA integration consequently failed to start and couldn’t block the ZBT-2. This gave me another error message when trying to configure the ZBT-2 for Thread: This time HA told me that outside of HAOS, it cannot set up OTBR automatically. Hooray! Now I finally have something to work with. (Where are the docs on this?)
Setting up OTBR looked simple at first. Get the Docker image from Google, start up, figure out the baud rate of the ZBT-2 (wtf?), and the container was running. (I’ll spare you the fun I had trying to get it to run in Podman instead of Docker.) Well, gotcha! This one does not work. Searching for error messages led me to this HA forums thread where it turns out that Google’s OTBR image does not work with HA. Apparently there is a dedicated OTBR build for HA with tweaks and the REST API enabled. And someone made a Docker image from it. (How that’s going to be regularly updated? I have no clue.)
That thread also revealed that OTBR isn’t enough, I also need a Matter server. Another container, another Python project I don’t understand (yet). But this one doesn’t need special privileges so it was easy to set up in rootless Podman.
From here on things were easier to find: HA must have the OTBR integration installed which eventually talks to OTBR’s REST API port. Then the Thread and Matter integrations need to be installed and do their things.
After I manually added the border router to one of the two (?!) Thread networks that showed up in HA by now things look fine-ish. Now I’ll need an actual Thread device to see whether pairing does anything sensible.
So… bottom line?
- The ZBT-2 documentation looks nice and easy. Reality is massively more messy.
- Thread + Matter appear to be much more complex than the Zigbee and Z-Wave I was used to. Will need to read things.
- Thread networks apparently cannot be renamed and the autogenerated names are… unrevealing.
Thanks for reading. I hope somebody will eventually find this entertaining.