Unable to add devices to Home Assistant with Matter via Thread

As @diedrichg pointed out this thread is getting long, so I wanted to create a long summarize some of the solutions listed above.

Bad Matter over Thread Device

@mobile.andrew.jones
Some devices might not have the same level of effort or quality as others. Nanoleaf Essentials have/had known issues with some of their early devices. Try other devices if you can.

Personally I found the Eve device built for Matter over Thread to integrate excellently

Work on a single vLAN

I would suggest avoiding working across vLANs as much as possible. There are a lot of ways to have multiple vLANs talking to each other, but very few manufactures properly implement mDNS support/forwarding. I moved all my IOT devices, including my HA host onto the same vLAN, and whenever I need to add a new device I switch over to do so. It’s annoying but prevents so many inconsistent issues.

Having multiple access points shouldn’t be an issues as long as they are all on the same network/vLAN. I’ve heard tail that some repeaters don’t properly support IPv6/mDNS, which ended up causing some people a headache. So it might be worth turning any off while troubleshooting issues

Ensure IPv6 is enabled on your network

@HARookie @diedrichg

IPv6 is required for thread to operate correctly. Below are a few guides.

Please note, you may need to make differet selections based on if your ISP is providing an IPv6 address for you or not. You can check your current IPv6 address here: https://test-ipv6.com/

General:

UniFi:

Unifi no public IPv6:

Reset Thread Credentials on Your Mobile Device

Big thanks to @HARookie since this is what got my mobile phone working again.

Android:

  1. Clear all cached data from Google Services
    Keep your device & apps working with Google Play Services - Google Play Help

  2. Sync thread credentials
    Now in the HA companion app sync the credentials with your device
    Settings->Companion App->Troubleshooter and call “update thread credentials

Apple:
Sorry I have no idea, :cry: Check below to see if anyone posts directions below

Nuclear option: Directly add Matter Devices

@Pierre84000

Quick note: I’ve done this for several devices. I have not found any negative effects from it so don’t hesitate to at least try it if you’re at wits end. I call it “Nuclear” more as a joke, but it is an approach that is against the ease of use idea of Matter.

The TL:DR is add the devices via console commands using a Bluetooth connection from the HA host itself. Programing experience is recommended

Troubleshooting Tools

mDNS

@mobile.andrew.jones
Matter over Thread uses mDNS to broadcast it’s availability, so any tools to help view mDNS on your network may help.

On Android “Service Browser” worked well for me. On windows “All My LAN” is free on the Windows store.

Matter Network

The Matter Server add-on recently added a UI to view the matter network. Check it out Settings > Add-ons > Matter Server > Open Web UI

It’s not super helpful yet, but gives a bit more insight into already added, or disconnected devices

Additional Resources:

Some extra reading material if you want to dig into how Matter over Thread works

  1. https://www.derekseaman.com/2023/10/part-1-smart-home-matter-and-thread-deep-dive.html
  2. Matter, Unifi and mDNS – @tomasmcguinness
  3. The State of Matter - Home Assistant
4 Likes

Clearing the Google Services cache and then re-syncing the thread creds in the HA Android app got my phone working again. Big thanks for that :heart:

2 Likes

About IPv6 just because I note people get confused about this. You do not need a working IPv6 network via your ISP, you only need to be able to use IPv6 inside your LOCAL network.

2 Likes

The Thread (IPv6) network sits behind the Thread Border Router(s) and works completely independently. Even if there is no connection to the Internet, the Thread network is active, and the participants talk to each other.

As absolutely rightly said above, IPv6 only needs to be permitted locally.

After setting up my OpenThread border router in Home Assistant, I still had to import the Thread credentials from my iPhone. I was then able to integrate Thread HomeKit devices into my HA without issues.

1 Like

I can also confirm which is something I have seen a lot of misleading information about - that for those of us with Google Hubs serving our Thread network - it does indeed continue to work when the internet goes down. I suffered an 8 hour internet outage a few weeks ago, and before I realised it was an actual internet problem - I spent an hour and a half rebooting EVERYTHING. So even with the router rebooted, and al the hubs rebooted - the thread network and matter continued to work without issues.

@mobile.andrew.jones

But if your box doens’t have internet, can you still add/commission new devices ?

No, this will not work.

The iPhone 15 pro has Thread onboard and there might be options in the near future which allow than such things using Thread in the phone as an ad hoc border router.

This is I am not sure of. The Home Assistant implementation appears to download all available certificates when the matter server starts up, so Home Assistant should be able to work entirely offline once it has the certificates. I don’t know if other matter servers work this way though - they may check online for the certificate of a device during commissioning.

I just tested this and No it doesn’t work.

Because the matter integration on the android phone is using the google-API.

After some months I tried to pair some more Matter over Thread devices and I’m facing the same problems.
But I can trace this problems back to exactly one cause:

I all cases I’m trying to add a new device with an Android mobile phone:
Add Integration → add Matter device → scan QR code
HA connects to the device and reads necessary data. After that the network is checked.
This test always fails on my Samsung Galaxy S21-Plus but works fine on my very old Samsung Galaxy S8 even I cannot see any differences in the network settings of both mobiles.
At least this shows that the whole configuration of the HA server and software and also my network is not the problem.

S21 shows the message ‘Connection to Thread-Network “ha-thread-368d” is not possible’.
But this is not the right network, my network is “ha-thread-08aa”

My attempts to synchronize the thread-network-settings “companion-App->Troubleshooting->Sync Thread credentials” all fail.
It ends up with the message: “Sync thread credentials: Updated network from HA on this device”

When I do the same on the S8, it ends up with the message “Sync thread credentials: HA and this device use the same network”

So finally the problem is that the thread network in my standrad device is wrong an I cannot correct it.
Clearing cace and data, de-installing an re-installing the HA companion app does not work.

Does anyone have a tip on how I can adjust the thread network settings on my mobile?

It could be because of the following …My understanding is that the HA Companion App for Android uses the Android framework, and the framework stores and retains the first Thread Dataset/Credentials it gets, and doesn’t allow for it to be overwritten. The only way to overcome this is to clear out Google Play data which will also clear other data that you may not want to delete.

Here is one Forum user’s guidelines

Thank you all for your support.

My last message was correct.
The problem ist the wrong Thread-Network-setting in the compaignon app which cannot be fixed - at least for me on different devices - with the “companion-App->Troubleshooting->Sync Thread credentials” task.
The message after the sync: “Sync thread credentials: Updated network from HA on this device” is misleading because it means for me: The sync did not work. The HA developers should implement an error handling here.
Only if you receive the message “Sync thread credentials: HA and this device use the same network” you can be sure the the mobile and the HA server are using the same network.

After many many tests, the one and only way for me to fix that is to remove the “Google Play Services” data in my phone as here the settings are saved and even if you de-install th HA App
and re-install it it will have the same settings.

The final Solution:

(Recommendation means: this is what I did but I don’t know if it is needed)

  1. Recommendation: De-install HA campainion app
  2. Recommendation: stop wifi and mobile data
  3. Absolutely necessary: In you mobile open settings->apps->set filter to “all apps”->search and open “google services” (in german “google play dienste”)->click “data” (Speicherplatz) and then clear the cache and delete all of the data.
    Clearing only the cache did not work for me.
  4. Recommendation: Restart the phone and, if you stopped it: re-activate wifi and mobile connection
  5. Install HA app and connect
  6. Absolutely necessary: Execute “companion-App->Troubleshooting->Sync Thread credentials”
    Here you should/must find the response : “Sync thread credentials: HA and this device use the same network”

Important: Deleting all data of the “google services” app can have side effects. Please inform yourself before you go this way.

At the end that worked for me. I can now pair Matter over Thread devices without problems with all of my mobiles.

2 Likes

Hello,

Yes indeed I had similar issues !
Thanks for the tip ! un-installing HA app was also necessary for me…

I followed all these steps and still cannot get Thread-based Matter devices to reconnect. They used to work, but all went offline recently. I am running latest (Oct) HA and can successfully commission WiFi Matter devices.

The Thread device in question (Eve door) commissions fine on Apple Home App / HomeKit. But both direct pairing (i.e. FDR the device, then pair directly to HA companion app) and secondary fabric (start with Apple Home fabric, then turn on pairing mode and put the code into HA companion app) fails - on both Android and iOS companion apps.

Given the Eve thread device pairs fine with Matter using Apple Home, this appears to be an issue with Home Assistant, not my TBR nor my network.

Similarly, I’m having issues reconnecting my Matter/Thread devices to HA. I had them (2 nanoleaf light strips and an Aqura window sensor) working in HA for quite a while, but a recent Nanoleaf firmware update, those haven’t been sticking to Thread which I assume affects the sensor, so they’ve been unavailable in HA.

Since everything continues to work fine in HomeKit, I figured I would just remove and re-pair the devices to HA. I did get everything removed, but the HA pairing mode is timing out. This happened when I set them up earlier in the year, but I don’t remember what I did differently. Only issue I can think of, in Apple Home in the device settings under Connected Services, I cannot remove the device from the 4939 Service, it just says “could not complete operation.” I’d rather not factory reset everything, but I’m guessing that’s the next step.

EDIT: The Thread light strips were indeed causing some pairing wonkiness. I uninstalled the HA Matter Server and factory reset the lights and then they were able to re-pair into HA no problem. The sensor also had no issue re-pairing to HA, and thankfully I didn’t have to do anything to that.

Hi,
Just wanted to share my experience in this topic since I’ve spent a good amout of time to get my Nanoleaf Essentials A19 bulbs working in HA with Thread/Matter.
(i’m bit of a beginner so bear with me)

Equipment:

  • Rpi 4
  • Sonoff dongle with Thread only firmware (have another for Zigbee)
  • no other Thread router

basically i installed the following things in HA:

  1. Open Thread Border Router addon
  2. Matter Server addon
  3. checked that IPV6 settings in HA was enabled. Note: I do not have ipv6 in my LAN.

so, no Silicon labs multiprotocol.

Then the trouble started. Most advice I read was to add a Matter device via Add new device in Companion, but when trying that and when I started scan Nanoleaf QR code it did not work on Android or iphone. Tried Google Home as well, but it said that the Nanoleafs QR code was “unvalid”.

After reseting the bulbs (5 on/offs within 5secs) HA discovered them in HomeKIT so I added them there. But that was as Blutooth device. When trying to press the button to make them Thread i got an “TLV” errror which I could not resolve. (Saw some solutions but they where above my knowledge-grade) If this work for you are done at this point.

So then I found a text about adding them in the Nanoleaf App first, and then make sure they are on Thread network (my HA Thread network in this case). And that worked fine!
Then one should remove them from the app and add them in HA HomeKit where they should be auto-discovered. Which did not work great until I understood that there is some kind of time limit of that process. So in my case the process was.

  1. add them to nanoleaf app and most likely they need update so do that in the app.
  2. remove them from the app
  3. reset the lamp (due to the timelimit I mentioned above) and re-add to nanoleaf app making sure they are connecteced to Thread network
  4. quickly remove them from Nanoleaf app
  5. at this point (since point 3 above) they should been discovered by HA HomeKit so just add them, and use the 8digit code that is on the lamp/sticker.
  6. now they should be available as a Thread device under HomeKit integration.

ps. I don’t remember if I manually installed HomeKit integration at some point but perhaps you need to do that as well when you install OBTR / Matter Server

hope this helps someone in similar situation!

1 Like