Thread Preferred Network

I am trying to make my GL-S20 OTBR my one and only Thread Border Router for HA. I have the Thread integration installed and it sees the GL-S20. On my IOS companion App I try to make that my Preferred Network via “Send credentials to Home Assistant” in the integration. It fails saying Error: No preferred network found. Is there a way for me to make this the Preferred Network without already having a Preferred Network?

I don’t have a GL-S20, but according to this guide, its an OTBR that you should point the HA OTBR integration to. Assuming the GL-S20 has the necessary OTBR APIs used by the HA OTBR integration, then HA should be able to get the Thread credentials directly via these APIs as the credentials are needed to make it preferred.

You can’t make a Thread network preferred unless it has the circled (i) beside it, meaning HA knows the password/credentials (“dataset”) to add new devices (yes, this is completely non-intuitive). For most OTBR routers, you can retrieve the credentials by going to the Thread service CONFIGURE page, clicking the three-dot button in the upper left, and selecting “Add an Open Thread Border Router”. If the GL-S20 is running the latest firmware, you should be able to enter the URL as the OTBR http://address:8081.

So I was able to get the (i) by manually importing my TMV Dataset from the GL-S20. This was weird since there is no way to extract it from the device. It was obtainable via page source using the device webui.

As a check, did you configure the HA OTBR integration with the URL of the GL-S20?

I never needed to…Thread recognized it automatically. I just had to get the credentials in which I did via TMV import per above.

Yeah, the Thread Integration discovers TBRs using Discovery protocols, but these protocols don’t provide Thread credentials. If the GL-S20 supports the same OTBR APIs used by HA’s OTBR Integration, then HA would have gotten the Thread credentials via these APIs.

Yeah it’s a little confusing because there are two different Integrations in Devices & Services:

  1. The Thread integration shows you what networks are detected on your network and which ones have their credentials stored in HA. You can select a network as preferred, which according to the documentation doesn’t actually do anything.
  2. The OTBR integration uses REST APIs to loosely manage devices running OpenThread Border Router software. I say “loosely” because there are only a few things you can do (change credentials, change channel) and for some reason you can’t do them here, you do them in the other integration, using secret menu items that are invisible for border routers not managed by the OTBR integration.

So if you don’t want HA to have loose management control of your OTBR-based border router, and if you’ve already imported the credentials, there is very little incentive to setup the OTBR Integration.