Can't Connect Aqara Hub to HA Matter

I am trying to connect my Aqara M2 hub to Home Assistant via Matter. I attempt to connect using the HA mobile app, but it always says something went wrong. I have my phone and the M2 hub connected to the same network with access to HA. I have enabled ipv6 in HA. Any help would be greatly appreciated.

The log for the Matter add-on shows this:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service banner: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
-----------------------------------------------------------

 Add-on: Matter Server
 Matter WebSocket Server for Home Assistant Matter support.
-----------------------------------------------------------
 Add-on version: 5.4.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 12.0  (amd64 / qemux86-64)
 Home Assistant Core: 2024.2.5
 Home Assistant Supervisor: 2024.02.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service banner successfully started
s6-rc: info: service matter-server: starting
s6-rc: info: service matter-server successfully started
s6-rc: info: service legacy-services: starting
[15:45:14] INFO: Starting Matter Server...
s6-rc: info: service legacy-services successfully started
[15:45:14] INFO: Using 'enp6s18' as primary network interface.
[15:45:14] INFO: Successfully send discovery information to Home Assistant.
2024-03-01 15:45:15 (MainThread) INFO [matter_server.server.stack] Initializing CHIP/Matter Logging...
[1709336715.101769][126:126] CHIP:CTL: Setting attestation nonce to random value
[1709336715.101941][126:126] CHIP:CTL: Setting CSR nonce to random value
2024-03-01 15:45:15 (MainThread) INFO [matter_server.server.stack] Initializing CHIP/Matter Controller Stack...
2024-03-01 15:45:15 (MainThread) CHIP_ERROR [chip.native.DL] Failed to get WiFi interface
2024-03-01 15:45:15 (MainThread) CHIP_ERROR [chip.native.DL] Failed to reset WiFi statistic counts
2024-03-01 15:45:15 (MainThread) WARNING [PersistentStorage] Initializing persistent storage from file: /data/chip.json
2024-03-01 15:45:15 (MainThread) WARNING [PersistentStorage] Loading configuration from /data/chip.json...
2024-03-01 15:45:15 (MainThread) WARNING [CertificateAuthorityManager] Loading certificate authorities from storage...
2024-03-01 15:45:15 (MainThread) WARNING [CertificateAuthority] New CertificateAuthority at index 1
2024-03-01 15:45:15 (MainThread) WARNING [CertificateAuthority] Loading fabric admins from storage...
2024-03-01 15:45:15 (MainThread) WARNING [FabricAdmin] New FabricAdmin: FabricId: 0x0000000000000002, VendorId = 0x134B
2024-03-01 15:45:15 (MainThread) INFO [matter_server.server.stack] CHIP Controller Stack initialized.
2024-03-01 15:45:15 (MainThread) INFO [matter_server.server.server] Starting the Matter Server...
2024-03-01 15:45:15 (MainThread) INFO [matter_server.server.helpers.paa_certificates] Fetching the latest PAA root certificates from DCL.
2024-03-01 15:45:15 (ThreadPoolExecutor-0_0) WARNING [py.warnings] /usr/local/lib/python3.11/concurrent/futures/thread.py:58: CryptographyDeprecationWarning: The parsed certificate contains a NULL parameter value in its signature algorithm parameters. This is invalid and will be rejected in a future version of cryptography. If this certificate was created via Java, please upgrade to JDK21+ or the latest JDK11/17 once a fix is issued. If this certificate was created in some other fashion please report the issue to the cryptography issue tracker. See https://github.com/pyca/cryptography/issues/8996 and https://github.com/pyca/cryptography/issues/9253 for more details.
  result = self.fn(*self.args, **self.kwargs)

2024-03-01 15:45:20 (MainThread) INFO [matter_server.server.helpers.paa_certificates] Fetched 129 PAA root certificates from DCL.
2024-03-01 15:45:20 (MainThread) INFO [matter_server.server.helpers.paa_certificates] Fetching the latest PAA root certificates from Git.
2024-03-01 15:45:21 (MainThread) INFO [matter_server.server.helpers.paa_certificates] Fetched 90 PAA root certificates from Git.
2024-03-01 15:45:21 (MainThread) WARNING [FabricAdmin] Allocating new controller with CaIndex: 1, FabricId: 0x0000000000000002, NodeId: 0x000000000001B669, CatTags: []
2024-03-01 15:45:22 (Dummy-2) CHIP_ERROR [chip.native.DL] Long dispatch time: 119 ms, for event type 2
2024-03-01 15:45:22 (MainThread) INFO [matter_server.server.device_controller] Loaded 0 nodes from stored configuration
2024-03-01 15:45:22 (MainThread) INFO [matter_server.server.vendor_info] Loading vendor info from storage.
2024-03-01 15:45:22 (MainThread) INFO [matter_server.server.vendor_info] Loaded 172 vendors from storage.
2024-03-01 15:45:22 (MainThread) INFO [matter_server.server.vendor_info] Fetching the latest vendor info from DCL.
2024-03-01 15:45:22 (MainThread) INFO [matter_server.server.vendor_info] Fetched 170 vendors from DCL.
2024-03-01 15:45:22 (MainThread) INFO [matter_server.server.vendor_info] Saving vendor info to storage.
2024-03-04 09:00:12 (MainThread) INFO [matter_server.server.device_controller] Starting Matter commissioning using Node ID 11 and IP fe80::56ef:44ff:fe60:8174%enp6s18 (attempt 1/3).
2024-03-04 09:00:13 (Dummy-2) CHIP_ERROR [chip.native.DL] Long dispatch time: 236 ms, for event type 2
2024-03-04 09:00:16 (Dummy-2) CHIP_ERROR [chip.native.EM] Failed to Send CHIP MessageCounter:122680580 on exchange 5632i sendCount: 4 max retries: 4
2024-03-04 09:00:19 (Dummy-2) CHIP_ERROR [chip.native.SC] PASESession timed out while waiting for a response from the peer. Expected message type was 33
2024-03-04 09:00:19 (Dummy-2) CHIP_ERROR [chip.native.ZCL] Secure Pairing Failed
2024-03-04 09:00:24 (MainThread) INFO [matter_server.server.device_controller] Starting Matter commissioning using Node ID 11 and IP fe80::56ef:44ff:fe60:8174%enp6s18 (attempt 2/3).
2024-03-04 09:00:28 (Dummy-2) CHIP_ERROR [chip.native.EM] Failed to Send CHIP MessageCounter:122680581 on exchange 5633i sendCount: 4 max retries: 4
2024-03-04 09:00:30 (Dummy-2) CHIP_ERROR [chip.native.SC] PASESession timed out while waiting for a response from the peer. Expected message type was 33
2024-03-04 09:00:30 (Dummy-2) CHIP_ERROR [chip.native.ZCL] Secure Pairing Failed
2024-03-04 09:00:35 (MainThread) INFO [matter_server.server.device_controller] Starting Matter commissioning using Node ID 11 and IP fe80::56ef:44ff:fe60:8174%enp6s18 (attempt 3/3).
2024-03-04 09:00:39 (Dummy-2) CHIP_ERROR [chip.native.EM] Failed to Send CHIP MessageCounter:122680582 on exchange 5634i sendCount: 4 max retries: 4
2024-03-04 09:00:41 (Dummy-2) CHIP_ERROR [chip.native.SC] PASESession timed out while waiting for a response from the peer. Expected message type was 33
2024-03-04 09:00:41 (Dummy-2) CHIP_ERROR [chip.native.ZCL] Secure Pairing Failed
2024-03-04 09:00:41 (MainThread) ERROR [matter_server.server.client_handler] [140453958432464] SDK Error during handling message: commission_on_network: Commissioning failed for node 11.

Problem solved.

Matter doe4sn’t appear to work when using VLANs. I had my hub connect to my IoT VLAN and it wouldn’t connect to HA. I reset the hub and connected it to my default network and it connected on the first try.

1 Like

HA is lacking a lot in IPv6 support, but it could be made to work.
IPv6 is not just IPv4 with more addresses, so you would need to understand how it works.
Your issue was probably that your fe80 network that the Matter addon uses exist on all your interfaces, but they are different networks. This is one of the new things with IPv6.