Unable to do matter/thread pairing with Aqara lock

I’ve used Home Assistant for a long time, but this has been my first disastrous foray into Matter/Thread. The bottom line is that I’m unable to do any Matter/Thread pairing with my Aqara lock, and I can’t pin down if it’s network segmentation issues, credential sharing issues, or the lock being only amenable to its own hub.

It started with the Aqara U400 lock. It looked promising, but upon getting it, I realized that the only apparent way to get it setup was to use the Aqara hub. On getting the M200 hub, I decided I didn’t like the way that integration worked (and having another hub for my pile of hubs), and went back to the drawing board, determined to make the lock with with HA natively.

I started with my ZBT-2, flashed with Thread firmware upon plugging it in to my Home Assistant Yellow (whose built-in radio is doing Zigbee (more on that later). I then added Matter and Thread, and configured them. It took me awhile to figure out what all the “Send to ” buttons were about, and it seemed like in my situation, sending credentials to my iphone was what was wanted. Once Thread was all setup, I went about trying to add my device. At first, I saw no log messages, but after many hours of trial and error, with amazing messages like “Home couldn’t connect to this accessory”. “Thread border router required”, and mostly just timeouts as I installed/uninstalled Thread and matter several dozen times.

1-Channel conflict with Zigbee. This seemed likely, as both are using channel 15. But my efforts to change this through the HA interface failed silently without any log messages, and I could not find another way to do this via command line. So I had to give up on this.

2-Some sort of credential issue. The interface is incredibly obscure on this issue, but in the end, I was able to dig into what credentials for Thread the companion app had stored, and confirmed they were the same ones as in the Thread configuration. There could be a lot more I’m missing here, but I’ll just say I tried every permutation of sharing credentials, recreating everything,etc.

3-Phone and HA on different Subnets. I run a Ubiquiti-based network and my HA instance is on one subnet of a /24 network, while my phone (via Wifi) is on another. I ran into directions for maybe addressing this at https://niksa.dev/posts/ha-vlan/, and so added HA to the network with my phone on it. This didn’t appear to do anything, but seeing some errors like the following put me onto the last thread I followed…

4-Something crazy with ipv6. I have only the slightest grasp of ipv6, and I’ve never actively used it for anything until realizing it’s what Thread is using under the hood, but I started seeing errors like this:
Default: mDNSPlatformSendUDP got error 99 (Cannot assign requested address) sending packet to ff02::fb on interface fe80::819e:2c0:4e5:2605/end0.10/18
Default: mDNSPlatformSendUDP got error 99 (Cannot assign requested address) sending packet to ff02::fb on interface fe80::e4c0:4ff:fedf:6645/veth8031826/20

I checked my network to ensure ipv6 was enabled, mdns forwarding was enabled, etc. I tried a few more things, but between the 10-minute timeouts on adding devices and cyptic log entries, I’m completely stuck. I may well have backed myself into a corner with the multi-homed configuration where mdns is just behaving poorly. But without some documentation on what sort of network configurations HA will support with Matter/Thread, I can’t even guess.

I think my next step on the network front is going to be getting my phone in the same subnet as HA and see what happens then. But based on my attempts to manually enroll the lock in HA directly with the code, I’m skeptical this will change anything.

And I’m not ruling out the fact that maybe the Aqara gear simply needs its own hub to operate with Matter/Thread at all. In my initial setup attempts, the lock would do nothing without its hub present, though I thought I’d avoid that by factory resetting and immediately trying to pair with HA.

My situation is probably a bit odd due to my network configuration, but I can’t even find anyone who has Aqara Matter/Thread gear pairing directly to HA without the hub – in any configuration. Does anyone have suggestions for how to proceed?

Yeah, that sounds frustrating. Unfortunately there seems to be a lot of issues with Ubiquiti and matter. I’ve had my fair share of issues with netgear. I would start with the first link, but the second one may help too.

https://community.home-assistant.io/search?q=Ubiquiti%20matter

You can pair the U400 without an Aqara hub, I just did it this weekend.
Suggest you reset the lock, then in HA :
add device
matter
No its new.

Keep in mind the code on the lock is a one time use so if you have any problem connecting it is best to reset the U400, this will allow it to be used for setup again.

It will even find a firmware update once paired, I would suggest skipping installing the update as it is two versions behind.

Once connected to HA then use “Share Device” to generate new matter code, just scan it with the camara and add it to apple home on the iPhone (on 2.4 WiFi) you want to connect. I do not have any apple hubs, I just added the lock to home on each phone, it sent me a warning that the lock is not in the same home but works.

Now, In the Aqara APP (not hub) set pin# and finger prints. Then update the firmware using the Aqara app.

The first time I added a matter device was by adding it to Samsung smarthings station, and it was a PITA. But now that I have the ZBT-2 as my thread border router, and more experience with matter is was a breeze.

Bye the way the battery took about 20 hours to charge, and UWB is very impressive, fingerprint scanner is very fast and so far 100% success rate, not like my U300’s which I thought were “not bad”

You do have to have IPV6, but you are aware of that. Hang in there you will enjoy the result.

PS I use a UDM Pro.

There are some stuff need to be done on your phone also. Look at thread integration documentation on HA website Thread - Home Assistant

Same VLAN, same network, ivp6 ON and IGMP OFF.
No need of aqara hub.

I have to say, this is deeply encouraging @NRA, since up until now, I haven’t really seen any coherent accounts of anyone primary’ing the lock on HA, and also arranging iPhone access and retaining configuration control.

I’ve been reviewing a lot of the posts around network configuration, and in particular https://www.derekseaman.com/2023/10/part-3-smart-home-matter-and-thread-deep-dive.html. This has a pretty bleak view of Ubiquiti equipment and my overly-complex-to-the-point-of-lunacy VLAN configuration. But I’m going to focus my next attempts on either commissioning directly from HA, or getting my phone on the same network as HA.

Thanks to everyone who jumped in on this thread. I can now report that it was a network issue. Whether IPv6, mDNS, or VLAN tagging, I can’t yet say. Once I got my phone on a WiFi network on the same VLAN as HA, things just worked. But order really mattered, and the Aqara app (at least the first run thorough) was deeply misleading about this. So per one of the above posts, I did the following:
Got my phone on the same net as HA
Factory reset the lock
Scanned the code into HA’s matter device wizard
Shared the code from HA to Apple Home
Setup the lock using the Aqara QR code (NOT the matter one), and calibrated, configured, and updated it.

So the take-away for me was that the Aqara app won’t talk to the HA Matter/Thread instance. And that’s actually totally fine for me at this point.