How to configure preferred Thread network

Thanks vesalius, you are not the bringer of good news :slight_smile: (not being able to choose Apple as my preferred network). The reason why I was trying is the documentation of the HomeKIt Device Controller: HomeKit Device - Home Assistant, which states:

Adding a HomeKit device to a Thread network via Home Assistant

There are two methods to add a HomeKit compatible device to a Thread network:

Thread network : In order to use HomeKit over Thread, you need a working border router.

  • Make sure your Home Assistant device is on the same network (LAN) as the border router.
    * Make sure the Thread network you’d like to use is known by Home Assistant and marked as Preferred network in the Thread configuration.

which raised my expectation, that I could integrate my Apple Thread NW into HA.

On your second point, I only have one Matter device and no Thread devices in HA yet (because of the above). I will add the Thread devices one by one to HA using one of the methods in the above (see what works) so that I can manage them (e.g. switch of thermostat when window opens) within HA.

Thanks for your help!

Understand, you weren’t the first (I did the same and others had before me) and won’t be the last, until apple makes the required changes or HA corrects the documentation to reflect the current limitations.

Thanks again vesalius, it is shame that the HA Documentation puts a lot of people on the wrong foot, costing lots of time and energy to many.

It would be nice if the originator would keep track here and maybe explain how he/she came to suggest that integrating a thread network thru Apple Border Router works and how that was accomplished?

Anyhow, once again, many thanks for your help and patience with me!

1 Like

Hi, did you manage to change the channel used by the Google nest?

I have skyconnect silicon labs as the preferred network but can’t add the Nest hub to the above mentioned preferred network.

If I change the Nest to my preferred network I can add silicon labs to that network, so it works one way but not the other.

The only problem is Nest is on channel 17 so I’d rather not add silicon labs to that network as it’s quite busy.

Hey, I do not think we have options, or at least not that I know of, to change the Google Nest channel. I did indeed succeed changing the SkyConnect channel to 18, matching the Google Nest one. I have not had any issue since then.

Ok thanks for confirming, I guess it’ll be possible in the future but not for now


Could You tell me how exactly, step by step, do this? I mean merge HA thread network with Google Nest network.
My HA thread network is based on sonoff zigbee 3.0 dongle flashed with custom firmware from this site:
This thread network works because i was able to add and use EVE power socket with it.
I have Google Nest 2 and would like to use it to improve network coverage.
My preferred thread network is default home assistant created automatically after installing silicon labs multiprotocol addon. I managed to change channel of the thread network and ZHA to 18 usde by Nest network, but have no option/don’t know how to change preferred network and then “merge” with Nest.

I’m quite new to HA so please be understanding :slight_smile:


I don’t have an Android device to test this but according to Thread - Home Assistant all you need to do is add a Matter device via the Android app.

Home Assistant will sync the Thread credentials with Google when starting to commission a Matter device via the Home Assistant Companion app. For other vendors, if the vendor allows you to see the operational dataset in TLV format, you can import it to Home Assistant from the Thread panel.

I tried just using HomeAssistant via an Android emulator on my PC, but it seems that you actaully need to add a device.

On the Apple side however, I was able to get the credentials using this script and the Nanoleaf app.

Only wier dthing now is that my Apple network name WAS MyHomeXX, but now after adding the SkyConnect to it, Eve is showing the network name as home-assistant (which is what was the name of the network that the SkyConnect stick used to have.; while in the HomeAssistant configuration… it has no name… I even removed the home-assistant network afterwards since it didn’t seem to be being used.

Not a huge issue, but anyone know how I can change the name for the network? The OTBR UI seems to be removed in the multiprotocol add-on.

In addition to this… it seems like if I reboot one of my Apple devices, they are no longer in the Thread network… and never come back! :open_mouth:

Well, I managed to get the SkyConnect back onto its own network, but my Apple Thread network is completely busted! The network will come back if I restart an AppleTV or HomePod… temporarily. After about 3 or 4 minutes, the network disappears again…

R.I.P. Thread network….

1 Like

@Veldkornet : Agree with your last sentence. If I understand correctly, you want to integrate EVE devices into HA. Not sure if you know: EVE has announced that EVE Thermostats can be migrated to Matter starting November 15. I have migrated my EVE Window and EVE Energy to Matter, they work fine with HA. So I‘ll be patient for a few more weeks :slight_smile:

Yes, I eventually reset my SkyConnect and just completely disconnected it.
After about a day and a bit, my Apple devices slowly came back to life.
I have two Eve Energies which I connected via Matter and that works fine.

I just thought I’d try combine my Apple / Google and HomeAssistant thread networks for better coverage.
Seems it’s a bit sensitive though :joy:

I’ll just stick with Apple being my main thread network and get everything into HA via Matter as support comes along.

Now all we need is the Matter Integration to leave it‘s Beta status.

FYI, I couldn’t leave it alone… :smiley:

I noticed that the script I was using was missing the network name and PKSC. So I’ve added those to the script, and now things are looking better. Will leave things a couple of days to settle and see if it stays fine now… I also set the network name to a name of my choosing instead of the MyHomeXX, it seems to be okay with it so far… I checked in the Eve and Nanoleaf apps, and all the devices seem to have adopted the new name.

Here the updated Python script if anyone wants it (FYI, I got all the needed information from the Nanoleaf app, if you add a Nanoleaf device it exposes all that information).

import python_otbr_api
from python_otbr_api import PENDING_DATASET_DELAY_TIMER, tlv_parser
from python_otbr_api.pskc import compute_pskc
from python_otbr_api.tlv_parser import MeshcopTLVType, MeshcopTLVItem

# Apple
CHANNEL = <Channel Number>
PANID = "<YourPanID>"
EXTPANID = "<YourExtPanID>"
NETWORK_KEY = "<Your Network Key>"
NETWORK_NAME = "<Your Network Name>"
PSKC = "<YourPSKC>"
TIMESTAMP = b'\x00\x00\x00\x00\x00\x03\x00\x00'

channel = MeshcopTLVItem(tag=0, data=CHANNEL.to_bytes(length=3, byteorder='big'))
pan_id= MeshcopTLVItem(tag=1, data=bytes.fromhex(PANID))
ext_pan_id = MeshcopTLVItem(tag=2, data=bytes.fromhex(EXTPANID))
network_name = MeshcopTLVItem(tag=3, data=str.encode(NETWORK_NAME))
pre_shared_key = MeshcopTLVItem(tag=4, data=bytes.fromhex(PSKC))
network_key = MeshcopTLVItem(tag=5, data=bytes.fromhex(NETWORK_KEY))
timestamp = MeshcopTLVItem(tag=14, data=TIMESTAMP)

tlv_new = {0: channel, 1: pan_id, 2: ext_pan_id, 3: network_name, 4: pre_shared_key, 5: network_key, 14: timestamp}
tlv  = tlv_parser.encode_tlv(tlv_new)

Hey I can’t help but notice that this is (similar) to the way I made my sonoff zigbee dongle running multiprotocol to merge the thread network with it. I now have my apple border routers and my nanoleaf shapes and EVERY thread homekit device merged with skyconnect, have for a while now. All I did myself was open the nanoleaf app (it helps I have a shapes panel as border router as well) and go to thread network, copy the network key and then I opened the otbr ui went to join and selected one of the corresponding thread devices and used the network key.

Although my thread network is joined together successfully and my god its been working SO WELL for a couple months now with not one single issue, its shocking as my past attempts ended me up with an apple tv that WAS on the same network as HA but for some reason my two homepod minis would diverge and form their own “myhomeblahblah” homekit thread network separate from the appletv/ha and it was constant drop outs wiht a small set of devices.

The HA team did a great job getting this better integrated. But I have a question, due to runing home asisstant OS for the ease, getting direct access to run these commands is far more time consuming and I don’t exactly like opening up ssh access with the advanced terminal add on simply because of the risk. I have other options if I want to fire up another border router iot gateway but thats mostly for dev stuff and I dont want to muck my stable network up. I just want to change the name of the border router HA uses instead of silicon labs multiprotocol. Could this script be executed from just a docker container with otbr or how did you do this exactly if you dont mind me asking? I know I can get into it with the advanced terminal add on but I really prefer not to open up a security hole as I’m not willing to risk that and its not that I don’t know how to secure it, I definitely DO I justt dont have the time really (and definitely not for another oopsy to be made lol) so many other things I have to do, but I also thought well…I could just try renaming the openthread border router integration (so just devices>openthread border router> services> rename, but would that even work for it or could that make it reset or drop off? After my homekit border routers diverging the last time and all the chaos that ensued and unhappy spouse and home members I try to keep my stable stuff in homekit STABLE because my husband was so mad at me when that happened haha and he really didnt like it when the kitchen lights went unavailable and to be fair i didnt either. Sorry for the long response, I have no friends that can even come close to being interested or could speak the same language and so…do you think doing that would be safe? :slight_smile: I definitely am overthinking it I think, I believe it should work, but why jump ahead and have to deal with that fallout if possible lol anyway, thanks any help is appreciated.

Thanks Veldkornet, but that is way out of my league. If it can‘t be done using the UI then I can not do it, I just do not have that experience. Anyhow, I hope it continues to work for you! :+1:

omg… just bought a few nest hubs , just to figure out thread is bullsh*t the way it is right now :confused:

1 Like

Hi and thank you for the many informations. I also have tried many times to create one thread network and now I think I am really near to a solution. But I have a problem to execute the script. When I start the script in the terminal in HA it always brings this message:

Traceback (most recent call last):
File "/root/", line 1, in <module> import python_otbr_api
ModuleNotFoundError: No module named 'python_otbr_api'

Is there something missing in my system? I have the SkyConnect stick, Thread and OTBR installed.
Can anyone help me with this problem?

1 Like

From wherever you are running the script, you need to have the module installed.

Ie, I run it from the visual studio code add-on, so I just install it there in the console first:

pip install python-otbr-api

1 Like

Thank you! It works now. The thread network from my HomePodMini is now the preferred one! :slight_smile:
I have successfully added a Nanoleaf lightbulb and it is in the HA and the thread network.
I also try to connect a Eve Thermo, but I do not get it. Neither about Thread nor HomeKit integration. In the Eve and HomeApp it works.
Do you have any idea why it will not connect?

Hi, note that EVE has announced that EVE Thermostats can be upgraded to Matter starting Nov 15, which means you can use them in the EVE App, Apple HomeKit and Home Assistant in parallel.
Of course you need to have the Matter Integration installed.
I have upgraded my EVE Door/Window and EVE Energy to Matter and they work fine

Hi there, @Veldkornet thank you very much for your script, the TLV creation worked flawlessly.

But now, I have only the option to switch between my Apple network and my SkyConnect as a preffered Netwok, I cannot merge them. Any thougts/tips on this?