How to join a preferred Thread network in Home Assistant

A screenshot of Home Assistant's Thread Integration showing two Open Thread Border Routers on the same network

If you use Home Assistant, and have an existing device that includes a Thread Border Router, then it should automatically add the Thread integration so that it can communicate with Matter devices. Some of Google’s Nest Hub and Nest Wifi devices include Thread, as do some of Apple’s newer Homepod devices and some of Amazon’s Echo devices. Because they broadcast their existence on your home Wifi network using mDNS, Home Assistant can detect their presence.

What Home Assistant can’t automatically do, however, is join these existing Thread networks. As this article from The Verge states, there isn’t a mechanism for sharing Thread network credentials between devices. That means that you can end up with a home that has several devices, all with the own Thread networks that don’t talk to each other, and your Home Assistant device not able to talk to any of them.

Hiding on your phone

The good news is that Home Assistant can access Thread network credentials from your phone, and this should allow you to join one of your existing Thread networks. In the above screenshot, I have my third party Thread dongle attached to the existing Nest thread network used by my Google Nest Wifi system.

The reason why I’m writing this blog post is that it’s not obvious how to enable Home Assistant to join a Thread network that it doesn’t have credentials for. Think of the Thread network credentials as being a bit like your Wifi password (or ‘pre-shared key’ to give it its official name). However, whilst you’ll usually either use whatever password is printed on your router, or a short password you set yourself, your Thread devices will come up with their own long alphanumeric key. And then, they’ll keep it a secret.

Thankfully, your phone should have this key – in Google Play Services on an Android device, and iCloud Keychain on an iOS device. And, thankfully, the Home Assistant Companion app for these platforms can access these credentials and provide them to Home Assistant, allowing you to connect to your existing Thread networks.

Matching the manufacturer to the network

But there’s a catch:

  • If you have a Google Wifi or Nest Hub device, then you’ll need an Android device to access the credentials.
  • If you have an Apple HomePod, then you’ll need an iOS device to access the credentials.

This is why I found it difficult to join the Thread network that my Google Wifi devices had created. I’m an iPhone user, and so it wasn’t able to access the credentials. They’re not available to the Google Home app on iOS, for example.

Thankfully, my wife has been a stubborn Android user for as long as I have been a stubborn iOS user. So, I just needed to ‘borrow’ her Android tablet, install the Google Home and Home Assistant Companion apps, and log in to both. Then, on the Home Assistant app, navigate to the Thread settings where an ‘Import Credentials‘ button appears. Once I tapped this, Home Assistant was able to join the Thread network created by my Google Wifi devices. Had I owned a HomePod, the process would have been similar.

One Thread network to mesh them all

Thread is a mesh network protocol, and having all devices on the same network is beneficial. Each additional device helps maintain the reach of the network. So it’s a shame that new devices just seem to set up their own networks, and don’t bother to try to join a Thread network that may already exist. Some of this is down to the Connectivity Standards Alliance, who haven’t specified a way of exchanging Thread network credentials. But it’s also worth noting that Matter and Thread are still very new standards. By comparison, Zigbee was designed in the 1990s and standardised over 20 years ago.

A few weeks ago, the Home Assistant developers hosted a livestream about ‘The State of Matter’, and there’s a useful summary here (which is good as the live stream was the best part of three hours). There’s still work to be done with supporting Thread networks in Home Assistant.