Matter trying to connect nanoleaf bulb to wrong thread network

I recently purchased a 3-pack of the matter compatible nanoleaf essentials and I’ve run into an odd issue when trying to pair my bulbs.

When I first started I was running an old version of the OTBR addon (Either 1.0.0 or 1.1.0 can’t remember exactly) which had a working thread network with some default credentials

I realized this was an issue so decided to update the OTBR addon, delete the thread network, remove the thread, OTBR, and matter integrations, and recreate the thread network, which took a little bit of finagling to figure out but now I have a thread network with non-default credentials.
Only problem is every time I try to pair one of the bulbs via matter (I tried through nanoleaf app, HA Companion app, and google home) it just errors out eventually and the nanoleaf app will usually say the pairing window has closed even though it’s been less than 15 minutes.

What’s odd is that if I try to add the bulb to the nanoleaf app it’ll look for thread networks, find one, and try to join it but then fail. However the old homekit essentials bulbs I was able to pair to HA through BLE and then commission to thread and they work perfectly.

What I noticed in the nanoleaf app is that if I reset the data and look at thread networks it’ll only show the one that actually works (named home-assistant) but if I try to pair a matter bulb and it fails to join thread network, it’ll show the old MatterServer thread network though greyed out:

I checked with 3 different mDNS browsers and they all seem to show the correct details for meshcop (not sure if those mystery symbols are supposed to be there or if they’re supposed to be something else):

I tried clearing storage data in google home, nanoleaf app, and HA companion app, all at the same time, still having the same issue in the nanoleaf app, and I’m assuming when trying to pair bulb via matter it tries to join a thread network that doesn’t exist (or at least doesn’t have a border router)

I’ve tried looking through logs but haven’t been able to find any clues, I tried making a separate docker container to run the OTBR addon directly (followed some instructions to pull the correct patches) but still ran into the same issue. I’ve tried deleting the matter integration and matter server addon just to make sure that’s not doing anything stupid.
I’m kind of at my wits end as to what could still be trying to serve the old thread network.

Edit: Forgot to add, running OTBR Addon connected to an NRF52840 USB Dongle in HAOS 10 on a proxmox VM

I have the same issue did you get it solved?

Nope, the only workaround I could find was to use the default thread credentials. I already linked my homekit nanoleaf bulbs to a unique thread network so I just used a second NRF52840 dongle along with these instructions in a separate machine Openthread border router support - #19 by bdunn44

Once that was running, I formed a thread network using just the defaults, but I’m not sure if that was actually working or not. After I tried in the nanoleaf app a few times without success, the bulb kept showing up as a child and not a router for some reason.
I went back into the web page for otbr and joined the default credential network that was there, while doing that I also stumbled upon this: GitHub - google-home/sample-app-for-matter-android: The Google Home Sample App for Matter (GHSA for Matter) uses the Home Mobile SDK to create an Android app that’s similar to Google Home.

I tried joining the bulb to matter with that and it worked, but sadly because my methods have been pretty random I can’t confirm whether it was successful due to using that app or if it was because I joined the network instead of forming in the OTBR page, though I feel like it was the join that did it.

Out of curiosity did you have the same background with an old version of the OTBR addon, or did you start with v1.2.0?
What I don’t know (and don’t even know how to figure out) is where the thread network was getting stored/cached. Was it the matter server in home assistant, or is there a bug in the OTBR addon? Was it google home because I paired a matter device using the default credentials previously?
Could it have been getting saved onto my phone somehow?
I sadly don’t know how to get answers to any of these questions.

I just updated to Silicon Labs Multiprotocol 2.2.0

Then I was able to get the bulbs to add in the nano leaf app. It seems they got added to the home assistant thread network correctly. After that I went to the bulbs setting and under “Matter” and selected “Connect” then choose the Home Assistant App.

I tested them and they seemed to work correctly. I then deleted them out of the app. They still seem to be working correctly.

Sound Great!
Do you mind walking through the steps in more detail?

  1. Took a new Nanoleaf Matter bulb (not HomeKit) out of the box,
  2. Opened up the Nanoleaf App (was this iOS or Android?) and did what next? Nanoleaf App found “home-assistant” thread network? got a QR code or some pairing code to enter? After than bulb showed up on Nanoleaf App?
  3. With the Nanoleaf App? “I went to the bulbs setting and under “Matter” and selected “Connect” then choose the Home Assistant App.” App?? I guess this is the nanoleaf’s name for HA’s Matter Server

Anyway, just wanted to know a few more details, as I may get one of these just to try.
Best Regards

(a bit from memory)

  1. I put the bulb in the socket. Turned it on and off 5 times to reset it (it starts blinking).
  2. Open the nano leaf app. (Android)
  3. Select More … on the lower right. then “My Devices”
  4. Click the add button, select Essentials, A19, Pair, scan QR Code
  5. This took a second the android asked something about viewing the network and I said OK.

Note 1: It did say the bulb joined a thread network.
Note 2: At this point the bulbs seemed to be connected via bluetooth to the phone.

  1. I did a firmware update on the bulbs. (This looked like it kept trying to update the firmware even though the app had already updated them once.)
  2. Turn the bulbs off and turn them back on because of a matter time frame.
  3. Go Back to “My Devices” then slide the bulb to the left so I could click the setting button (three dots) then More settings.
  4. Click the Connect button under “Matter”. Then select Home Assistant. This took a few moments. But they then appeared in Home Assistant.
  5. Remove the devices form the nanoleaf app.

I don’t know if this matters but before that, I tried with my google home hub 2. Hoping the nano leaf app would pick up on that thread network. And it did something but did not work. I did copy the network key and joined OT Border Router to the google home hub thread network. I think, I am not sure. But the steps above I did with the home hub powered off (unpluged)

2 Likes

Also having issues connecting, but my Nanoleaf app doesn’t provide any way to connect to Matter. Perhaps because I’m on iOS.

My bulbs were working correctly for about a month, paired to a Nest Hub Max with an old Android phone. Stopped working when I got my Skyconnect dongle and configured it with multi protocol support.

On iOS I can’t get the Essentials bulbs to connect with either Google Home (recently updated to support matter pairing on iOS), or Home Assistant. The old Android phone is also not able to connect them to either Google Home or Home Assistant.

1 Like

From what I understand from talking to the nanoleaf support. They support iOS better than Android.

And from other questions it seemed using iOS / HomeKit was easier.

Small update, nanoleaf has now release a new firmware for their mainline lights (Shapes, canvas, etc…) that adds matter bulb support for their thread border router.

I updated my shapes and did some testing and it’s still somewhat limited. If you have an existing thread network it should find that but much like with the bulbs it only ever found my old thread network, which given this is a border router isn’t all that bad I guess.
However, if it can’t find one then it’ll just make a brand new one using randomly generated specs, with still no way to manually set any of the thread details.

As for why it doesn’t find my homeassistant thread network despite the meshcop showing up just fine in a bonjour browser, I have no idea. My suspicion is that when I originally first added a matter bulb before I updated the OTBR addon in HA my phone and/or google home saved the thread network details to then forever use, which isn’t necessarily a bad idea except when you offer no way to clear it out nor any way to change it.

Currently the only way to test my theory is to get another phone, which I tried on my tablet but that didn’t find anything and caused the nanoleaf app to just create a randomly generated thread network on my shapes, or to reset my phone which I really don’t want to do just to clear out thread credentials lol

My other thought is something is being malformed in the id field as that’s what google uses to identify a particular border router, and the HA one has a bunch of data which is not human readable.

It seems android saves the thread network info in Google Play services ( SDK da Thread Network para Android  |  Google Home Developers ). It seems to app specific and I cannot seem to find where to delete the info. Clear data and cache does not do it.

I have a spare phone I will try with that and see what happens.

I thought I would share my experience (a bit long-winded).
As a note: I only have HA SiLabs Multiprotocol Add-On w. SkyConnect as my Thread Network (I have no other Thread networks).

Comparing to Joe Vanderstelt’s instructions above,

  • I first tried the iOS NanoLeaf App and then tried the Android NanoLeaf App. After step #4, in both iOS/Android, it appears the App will first pair the bulb using Bluetooth. Depending on how you navigate, you’ll see the bulb with the Bluetooth icon indicating that Bluetooth is how it is paired.
    It then ask if you want to upgrade the firmware which I did (to 3.5.10).
  • After a while (depending on how you navigate the App), both the iOS and Android NanoLeaf App will show a home-assistant Thread network. When you select the home-assistant network to see what kind of information was found, the iOS App only found the PANid and Extended Address, whereas the Android found this information, PLUS all the other data you need to join a Thread network such as Network Key.
  • Once a Thread Network is found, the NanoLeaf App will ask if you want to “Upgrade” the bulb to run on the Thread Network and it gives you a button to tap to do so, and tapping the button the App will attempt to join the bulb to Thread. In the iOS case, this failed, but in the Android case it succeeded (as expected since the iOS is missing Thread data). The bulb will now show that it is connected to Thread (instead of a Bluetooth icon, it will now show a Thread icon).
  • (step #7-9) After a while, in the settings for the bulb, the App will provide an information box saying you can “Connect to Matter”, and goes on to say that the bulb first needs to be power cycled off then on. Apparently, power cycling is a means for the bulb to open up a Matter commissioning window. This window seems to open in around 15 seconds and goes away after a few minutes. After power cycling the bulb, this information box in the App changes (if you’re lucky) and provides you with a selection of how to do the Matter pairing, one of which is a link to what looks like the HA Companion App so tap on it. This is used to kick start the HA Matter server into doing commissioning.
  • At this point, in my case, things failed. Analyzing the HA logs, what I found was the process actually completed the commissioning phase, but then the Matter Server next attempted to interview the device which is an operational phase, and the interview immediately failed. The Matter Server didn’t keep the node in its device database so now doesn’t think the bulb exists. However the bulb thinks the Matter commissioning is successful and it doesn’t care whether it was interviewed or not so it thinks it is good to go. So next time you power cycle the bulb, the NanoLeaf App will indicate that the bulb is already connected to a Matter ecosystem and doesn’t give you an option to pair the device again. I factory reset the device and retried this in various combinations including only using the HA Android Companion App (and not the NanoLeaf App at all) but still no success.

So I gave up trying to add the NanoLeaf Essentials Bulb using any App. As a fall back, I tried instead to use the Matter Server to do the commissioning without an App. This uses the Matter Server’s Bluetooth capabilities and it uses the Matter Server’s client websocket APIs: to set the Thread Credentials, and then to activate Commission with Code (much like the App does), and this time I was successful at adding the Bulb. Here is a HA Forum Thread on this technique. I’ve written a few Python scripts to do this as well.

1 Like

@wmaker please give a little more details on how to change Thread Credentials via Matter Server’s client websocket APIs. In my case, Nanoleaf Lightstrip has remembered an old, non-existent Thread network and I can’t change it.

The Matter Server AddOn can use its own Bluetooth to commissioning a Thread device onto a Thread network and to do this you have to tell the Matter Server what the Thread credentials are (you tell the Matter server what the credentials are using the websocket API). If your NanoLeaf Lightstrip has old Thread credentials, the Matter Server can not fix this. I believe you will have to factory reset the NanoLeaf.

Thank you for the reply. I’ve already tried Factory Reset several times, but the old Thread credentials remain. It seems that the problem is in nanoleaf, I’ll try to play around with it some more.

As Joe Vanderstelt mentioned above, if you are using an Android based App to commission the NanoLeaf, it uses Google Play to store the Thread credentials and for some reason Google Play holds on to these credentials even if they are not longer being used, so yeah factory resetting the NanoLeaf won’t overcome this.

I also thought that this might be the reason, but I couldn’t find a way to remove Thread credentials from Google Play without completely clearing Google Play Services. Maybe there is some less radical way?
I’ll try to use the iOS app, hopefully it will work.

Good news! I managed to figure out a way to get google to actually take a specific thread network as it’s stored network.
Bad news is you have to clear google play services to do it, but at least now it’s not a crap shoot as to whether it’s going to pick the HA preferred network or not.

Using v1.4.2 (latest as of this post) of google’s thread sample app there’s now a section which lets you read the current credentials and set it to a specific network under settings > developer utilities > thread network.
What’s interesting is there’s documentation about clearing credentials in the API, and in the sample app there’s a clear preferred credentials button but it just comes up with this message:

Those instructions do seem to work, however they need to be done on whatever device set those credentials to begin with (in my case it was my phone) and clearing GPlayServices data broke the connection to my galaxy watch and cleared my linked cards in google wallet so keep that in mind, but I was able to clear the preferred thread network, then use the ‘Set credentials in GPS’ button and selected my home assistant network, now when I try to pair things in the nanoleaf app they all connect to the correct network. Thankfully this should only need to be done once.

I haven’t been able to test adding to google home or HA directly using matter pairing as it hasn’t loaded on my phone yet (gotta love the fact that it’s some nebulous plugin downloaded by GooglePlayServices), but I’ll report back if there’s any issues there.