Matter/Thread : new device through Android app error

Hello,

I have set up a Home assistant server using docker on a pi 4. I want to add a Aqara u200 device that use matter over thread.

To do so, I flashed a sonoff-e dongle and I deploy a OpenThread border router container that is successfully connected to home assistant though the OpenThread integration (I use a custom port for the rest API). The thread integration is successfully configure and use the same thread network as the one displayed on the OpenThread webui.

I also deploy a Matter container that does not seem to work properly, even though it successfully connects to the matter integration in home assistant. Here are the logs of the matter server :

2024-10-18 10:45:44.107 (MainThread) INFO [matter_server.server.stack] Initializing CHIP/Matter Logging...
2024-10-18 10:45:44.108 (MainThread) INFO [matter_server.server.stack] Initializing CHIP/Matter Controller Stack...
[1729248344.193572][1:1] CHIP:CTL: Setting attestation nonce to random value
[1729248344.194229][1:1] CHIP:CTL: Setting CSR nonce to random value
[1729248344.196077][1:1] CHIP:DL: ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_kvs
[1729248344.196826][1:1] CHIP:DL: writing settings to file (/tmp/chip_kvs-ebbJ7g)
[1729248344.197101][1:1] CHIP:DL: renamed tmp file to file (/tmp/chip_kvs)
[1729248344.197587][1:1] CHIP:DL: ChipLinuxStorage::Init: Using KVS config file: /data/chip_factory.ini
[1729248344.197926][1:1] CHIP:DL: ChipLinuxStorage::Init: Using KVS config file: /data/chip_config.ini
[1729248344.198111][1:1] CHIP:DL: ChipLinuxStorage::Init: Using KVS config file: /data/chip_counters.ini
[1729248344.198546][1:1] CHIP:DL: writing settings to file (/data/chip_counters.ini-ftF8hj)
[1729248344.199151][1:1] CHIP:DL: renamed tmp file to file (/data/chip_counters.ini)
[1729248344.199278][1:1] CHIP:DL: NVS set: chip-counters/reboot-count = 3 (0x3)
[1729248344.200239][1:1] CHIP:DL: Got Ethernet interface: eth0
[1729248344.200840][1:1] CHIP:DL: Found the primary Ethernet interface:eth0
[1729248344.201419][1:1] CHIP:DL: Got WiFi interface: wlan0
[1729248344.201545][1:1] CHIP:DL: Failed to reset WiFi statistic counts
2024-10-18 10:45:44.202 (MainThread) INFO [chip.storage] Initializing persistent storage from file: /data/chip.json
2024-10-18 10:45:44.202 (MainThread) INFO [chip.storage] Loading configuration from /data/chip.json...
2024-10-18 10:45:44.478 (MainThread) INFO [chip.CertificateAuthority] Loading certificate authorities from storage...
2024-10-18 10:45:44.478 (MainThread) INFO [chip.CertificateAuthority] New CertificateAuthority at index 1
2024-10-18 10:45:44.480 (MainThread) INFO [chip.CertificateAuthority] Loading fabric admins from storage...
2024-10-18 10:45:44.481 (MainThread) INFO [chip.FabricAdmin] New FabricAdmin: FabricId: 0x0000000000000001, VendorId = 0xFFF1
2024-10-18 10:45:44.482 (MainThread) INFO [matter_server.server.stack] CHIP Controller Stack initialized.
2024-10-18 10:45:44.483 (MainThread) INFO [matter_server.server.server] Starting the Matter Server...
2024-10-18 10:45:44.492 (MainThread) INFO [matter_server.server.helpers.paa_certificates] Skip fetching certificates (already fetched within the last 24h).
2024-10-18 10:45:44.493 (MainThread) INFO [chip.FabricAdmin] Allocating new controller with CaIndex: 1, FabricId: 0x0000000000000001, NodeId: 0x000000000001B669, CatTags: []
2024-10-18 10:45:44.764 (Dummy-2) CHIP_ERROR [chip.native.DIS] Failed to advertise records: src/inet/UDPEndPointImplSockets.cpp:416: OS Error 0x02000063: Cannot assign requested address
2024-10-18 10:45:44.773 (Dummy-2) CHIP_ERROR [chip.native.DIS] Failed to advertise records: src/inet/UDPEndPointImplSockets.cpp:416: OS Error 0x02000063: Cannot assign requested address
2024-10-18 10:45:44.774 (Dummy-2) CHIP_ERROR [chip.native.DIS] Failed to advertise records: src/inet/UDPEndPointImplSockets.cpp:416: OS Error 0x02000063: Cannot assign requested address
2024-10-18 10:45:44.777 (Dummy-2) CHIP_ERROR [chip.native.DIS] Failed to advertise records: src/inet/UDPEndPointImplSockets.cpp:416: OS Error 0x02000063: Cannot assign requested address
2024-10-18 10:45:44.781 (Dummy-2) CHIP_ERROR [chip.native.DIS] Failed to advertise records: src/inet/UDPEndPointImplSockets.cpp:416: OS Error 0x02000063: Cannot assign requested address
2024-10-18 10:45:44.784 (Dummy-2) CHIP_ERROR [chip.native.DIS] Failed to advertise records: src/inet/UDPEndPointImplSockets.cpp:416: OS Error 0x02000063: Cannot assign requested address
2024-10-18 10:45:44.786 (Dummy-2) CHIP_ERROR [chip.native.DIS] Failed to advertise records: src/inet/UDPEndPointImplSockets.cpp:416: OS Error 0x02000063: Cannot assign requested address
2024-10-18 10:45:44.789 (Dummy-2) CHIP_ERROR [chip.native.DIS] Failed to advertise records: src/inet/UDPEndPointImplSockets.cpp:416: OS Error 0x02000063: Cannot assign requested address
2024-10-18 10:45:44.791 (Dummy-2) CHIP_ERROR [chip.native.DIS] Failed to advertise records: src/inet/UDPEndPointImplSockets.cpp:416: OS Error 0x02000063: Cannot assign requested address
2024-10-18 10:45:44.794 (Dummy-2) CHIP_ERROR [chip.native.DIS] Failed to advertise records: src/inet/UDPEndPointImplSockets.cpp:416: OS Error 0x02000063: Cannot assign requested address
2024-10-18 10:45:44.797 (Dummy-2) CHIP_ERROR [chip.native.DIS] Failed to advertise records: src/inet/UDPEndPointImplSockets.cpp:416: OS Error 0x02000063: Cannot assign requested address
2024-10-18 10:45:44.800 (Dummy-2) CHIP_ERROR [chip.native.DIS] Failed to advertise records: src/inet/UDPEndPointImplSockets.cpp:416: OS Error 0x02000063: Cannot assign requested address
2024-10-18 10:45:44.802 (Dummy-2) CHIP_ERROR [chip.native.DIS] Failed to advertise records: src/inet/UDPEndPointImplSockets.cpp:416: OS Error 0x02000063: Cannot assign requested address
2024-10-18 10:45:44.805 (Dummy-2) CHIP_ERROR [chip.native.DIS] Failed to advertise records: src/inet/UDPEndPointImplSockets.cpp:416: OS Error 0x02000063: Cannot assign requested address
2024-10-18 10:45:44.807 (Dummy-2) CHIP_ERROR [chip.native.DIS] Failed to advertise records: src/inet/UDPEndPointImplSockets.cpp:416: OS Error 0x02000063: Cannot assign requested address
2024-10-18 10:45:44.811 (Dummy-2) CHIP_ERROR [chip.native.DL] Long dispatch time: 316 ms, for event type 2
2024-10-18 10:45:44.831 (MainThread) INFO [matter_server.server.vendor_info] Loading vendor info from storage.
2024-10-18 10:45:44.850 (MainThread) INFO [matter_server.server.vendor_info] Loaded 255 vendors from storage.
2024-10-18 10:45:44.851 (MainThread) INFO [matter_server.server.vendor_info] Fetching the latest vendor info from DCL.
2024-10-18 10:45:45.136 (MainThread) INFO [matter_server.server.vendor_info] Fetched 254 vendors from DCL.
2024-10-18 10:45:45.136 (MainThread) INFO [matter_server.server.vendor_info] Saving vendor info to storage.
2024-10-18 10:45:45.158 (MainThread) INFO [matter_server.server.device_controller] Loaded 0 nodes from stored configuration
2024-10-18 10:45:45.174 (MainThread) INFO [matter_server.server.server] Matter Server successfully initialized.

I use a Android smartphone with grapheneos and sandboxed google play with all permissions. When I try to add the aqara device, it is automatically detected by the Google software asking me which app to use, I select home assistant, press on the “I’m ready” button, and I’m redirected to a screen saying I do not have any Wi-Fi connection (which is false, I’m on the same network as the pi).

Even when I use the home assistant app, I end up stuck on the same “no wifi” screen.

mDNS is enabled on my router and my phone is connected using ipv6 and 2.4g band.

Thank you for any suggestion.

edit : same behavior on a regular Android 13 phone with native google services support

Hello,

I also have an AQARA U200 lock and I managed to add it to Home Assistant, it was not easy, but now it is well connected with Thread and has been working very well for a few days.

I had a similar problem to yours, but I managed to make it work:

Here is what I did:

  • In Home Assistant, go to:

→ Settings → System → Network → Configure network interfaces
→ → Check the IPV6 box and set to Automatic, then save.

PS: Enabling IPV6 on the local network is useless for Thread, it is only useful for Matter (Wifi) but not for Matter over Thread devices directly in HA.

  • I bought a ZB-GW04 Dongle (v1.2) that I flashed with the Thread Only Firmware using this site:
    (For ZB-GW04, Openthread RCP - Thread Only - Baudrate 230400)

→ I connected it in my VM (Proxmox) and it is well detected by Home Assistant

  • I installed the Open Thread Router Border add-on and I selected the ZB-GW04 dongle

→ Then, you have to add the integration that is automatically proposed, without filling in anything (Thread and Open Thread Border Router)

  • I installed the Matter Server (Beta) add-on

→ Then, you have to add the integration that is automatically proposed, without filling in anything (Matter Beta)

  • Then, in the home assistant application on Android (Not on PC), I went to:

→ Settings → Companion Application → Troubleshooting → Synchronize Thread identifiers

So, a default border router should be defined in the Thread integration

  • Still on the Android application

→ Settings → Devices and Service → Device → Add a Device → Add a Matter Device → No, it’s new

  • Follow what is indicated on the smartphone

→ Scanned the Matter QR Code
→ On the AQARA U200 lock, press the SET button once so that it enters Pairing mode

After a few seconds, the addition is successful :ok_hand:


My lock has been connected for 5 days now and everything works well, I just hope that the addition of Matter 2.0 will not be long so that there are more functions.

Currently, it is possible to:

  • Lock / unlock, in addition, the status also changes if the lock is locked / unlocked physically or by the keypad, phew :slight_smile:

  • See the battery level of the lock and the voltage, not the keypad

I hope to see the arrival of the functionality that will allow you to know by whom and how the lock was Locked / unlocked.

Thread uses IPv6 as well.

Yes I know, but Thread does not use IPV6 on the local network, Thread is Bluetooth in a way, IPV6 is used for addressing within Thread only, it does not depend on the IPV6 of the Local network.

The TBR is an IPv6 router and needs IPv6 on both the Thread side and the LAN side.

This is absolutely not what I understood after multiple readings.

Thread uses IPV6 for its subnet, but does not communicate on the local network (Matter communicates on the Local network).

In the case of Thread (Matter Over Thread), HA simply needs IPV6 to be enabled in the settings to be able to communicate with Thread, but it is not necessary to have IPV6 enabled on its local network.

My local network is still in IPV4 and Thread works, this confirms that I have understood everything I have read about Thread.

A post that confirms this :

Maybe I’m not understanding what you mean by “enabled on its local network” … if you mean that your internet router does not need to have IPv6 enabled on its LAN side for Thread, that is correct.

But in order for HA Matter Server and HA Thread Integration to work, IPv6 has to be “operational” on the LAN and that means the HA has to have IPv6 enabled so that it can send and receive IPv6 to/from the LAN side of the TBR which in turn will forward to/from Thread devices. If your internet router is not enabled for IPv6, then it is the TBR that advertises an IPv6 ULA prefix over the LAN that HA will discover and from that ULA, the HA components such as Matter Server will formulate its full IPv6 address. But again IPv6 is used on the LAN side of the TBR to talk with Thread devices on the Thread side.

1 Like

yes I think you misunderstood or I expressed myself badly but for me: local network = Physical network of the home including the ethernet and wifi equipment (Switch, router, access point) and in my first message I insist of course the fact that IPV6 must be activated in HA. In short, it is not very serious, the main thing is that the author of the subject finds a solution and in my message I wanted to make him understand that it is not necessary to persist in wanting to make the local network of the home work in IPV6.