Openthread border router support

Merged - Yes it has been merged into the “main” branch of Openthread.
Needed - The best I can tell, is that these REST API changes are needed as a way to import and export Thread network datasets across multiple Thread networks. Not all Thread BRs support these APIs, but an HA OTBR is expected get its dataset over this API, so yes.

Since you are using Unify, it may be different, but from what I can tell here (this was updated just recently), it is using the GeckoSDK and the same version (4.2.2) as the Add-On.

1 Like

I just rebuilt off the latest git and still getting 404 errors on the API.

    4 0.000599830  172.20.4.49 → 172.20.4.65  HTTP 236 GET //node/dataset/active HTTP/1.1
    5 0.000716872  172.20.4.65 → 172.20.4.49  TCP 66 8081 → 37712 [ACK] Seq=1 Ack=171 Win=65024 Len=0 TSval=4223390037 TSecr=3445202110
    6 0.001092673  172.20.4.65 → 172.20.4.49  HTTP/JSON 455 HTTP/1.1 404 Not Found , JavaScript Object Notation (application/json)

After further review of @agners PR, it looks like the API was changed to “/node/active-dataset-tlvs” for the code that was merged. The HomeAssistant integration likely needs to be updated to reflect this.

There are several iterations around of the patchset, the ones which works with current Home Assistant Core can be found in the add-on:

I am working on upstreaming the change, so it will eventually land in vanilla OTBR. However, from first reviews I already know that it will be incompatible with the current implementation.

2 Likes

@agners: Let me tell you that I appreciate a lot that not only you contributed to the openthread/ot-br-posix main repository, but you are following it up.

I know it’s a chore, so here’s a thank you emoji for you: :love_you_gesture:

1 Like

I echo that thanks!! Also thanks for the pointer to the patchset, @agners. That was the key for me.

For those who are running a standalone OTBR and are too impatient to wait for Agners’ PR to be merged upstream (like me), you can simply apply the patchset manually to get this working:

git clone --depth=1 https://github.com/openthread/ot-br-posix.git
cd ot-br-posix
curl -s https://raw.githubusercontent.com/home-assistant/addons/master/openthread_border_router/0001-Avoid-writing-to-system-console.patch | git apply
curl -s https://raw.githubusercontent.com/home-assistant/addons/master/openthread_border_router/0001-rest-implement-REST-API-to-get-dataset.patch | git apply
curl -s https://raw.githubusercontent.com/home-assistant/addons/master/openthread_border_router/0002-rest-support-state-change.patch | git apply
git diff --name-status
# Then proceed with normal installation steps for your platform. For example:
./script/bootstrap
INFRA_IF_NAME=wlan0 ./script/setup

After this the dataset API should be working (try http:<otbr ip/host>:8081/node/dataset/active to test), and you should be able to add it to Home Assistant (enter http:<otbr ip/host>:8081 as the URL to the OTBR API).

A word of caution: I imagine this is very likely to break during a future upgrade given the differences between the patched API and what will eventually be merged as @Joe_Saiko called out.

Excited to play around with this!

1 Like

Thanks @agners for all that you do!

Thank you for that write up @bdunn44. It was pretty much cut, paste, and go. I am going to mark it as the solution so folks will have an easier time finding it.

Anyone here able to get a matter over thread device working yet? Mine seems to be stuck on joining the network. Thanks.

EDIT: Ended up getting it all working. Seems to be an issue when enabling IPV6 Prefix delegation on the OTBR. Compiling with the defaults works and my thread based matter devices are now working as expected.

1 Like

I’ve read this whole thread trying to find what the URL the integration asks for should be, and the closest I got was

http://<otbr ip/host>:8081/node/dataset/active and that doesn’t work.

When I attempt to “Add an open thread border router” in Integrations/configurations, I’m asked to “Provide URL for the Open Thread Border Router’s REST API”

And I can’t find any example of what is supposed to be in there.

I think the URL is just http://<otbr ip/host>:8081. If your OTBR is the SiLabs Multiprotocol Add-On, I think you can use http://core-silabs-multiprotocol:8081

1 Like

I’m using the Skyconnect, which I think is SiLabs. Neither of those URLs work for me.

Maybe I’m confused. Is the SkyConnect itself supposed to be able to become an OTBR, or only to talk to one?

If the latter, what piece of non-Google hardware is usable? I’ve already read that I can’t use my HomePod Mini.

Depends on the firmware flashed.
There is ZigBee only firmware, there is multiprotocol firmware (ZigBee and Thread) and there is Thread only firmware.
You need Thread to be an OTBR (Thread or multiprotocol)

The SkyConnect itself can not become an OTBR, so perhaps to back up a moment, what kind of OTBR are you trying to connect to?

Well, there’s my problem.

As mentioned up at the top, the only OTBR I have is a HomePod mini, which is locked down.

Repeating what I asked above: what piece of non-Google hardware is usable as an OTBR?

An OTBR router exist of 2 pieces, software and a radio

https://openthread.io/guides/border-router/docker/run

The skyconnect can be the radio if flashed with rcp or multiprotocol firmware.
The software is the OTBR add-on or the multi-protocol add-on.

Those 2 pieces together are an OTBR

Now I have two different answers, one saying the SkyConnect can’t be an OTBR, and your suggesting it can.

To re-add OTBR (after manual deletion) in the integration’s list I had to disable the OTBR firewall in the Silicon Labs Multiprotocol configuration, because I see these errors there otherwise:

[03:25:55] INFO: otbr-agent ended with exit code 1 (signal 0)...
[03:25:55] INFO: OTBR firewall teardown completed.
[03:25:58] INFO: Setup OTBR firewall...
ipset v7.10: Kernel error received: Invalid argument

Hi, I’ve been trying all kinds of setups, including Apple Homekit. The case is that I try to connect Eve Energy wall plugs to Home Assistant Open Thread Border Router. In HA it looks ok to me. Using SkyConnect, integrations for thread + open thread border router and matter are available and a border router is running on HA:
image
However when I try to connect a wall plug with the HA companion app, the following message is returned: Thread Border router vereist. Om dit accessoire te koppelen moet je thuisnetwerk een Thread Border Router bevatten. (Translation: Thread Border router required. To connect this accessory, your home network must contain a Thread Border Router)
What might be causing this message to show up?

1 Like

If you are using the iOS HA Companion App, this is not supported. Otherwise here is a thread on this subject.

1 Like