Adding matter device not working

I know I tried several things and if I remember correctly the Nuki app did not show HA either, at least not initially. I had to reset my Nest hubs (for different reasons) in order to get it to work. But I added though HA afterwards, so I’m not sure if HA was there in the Nuki later on, so I didn’t check. The Nuki website it only supports the ones you see. But that is clearly wrong, I got it working. The initial problems could have been for two reasons:

I had factory reset the router for some other problems and restored a backup on it. The hubs may not have reregistered with dns properly afterward, requiring them to reboot.

I also have problems with mdns only working a certain time after a device reboot. I have several esp32 devices suffering from the same thing, ESPHome no longer seeing them after a while. Others work just fine. I see more reports from people suffering the same fate. Maybe my Fritz!Box is not so good with mdns, it could also be my switches with IGMP snooping on (required for iptv) messing things up.

Mdns trouble may be why my connection is not very stable.

Ipv6 settings for HA can be checked on the network tab in settings. It must be set to automatic or static.

If I remember correctly, I opened the Nuki app to add matter (I assumed it was needed to activate matter an/or enter pairing mode). But HA wasn’t there, so I left the page open, manually opened HA, went to devices and continued the process there. After that the Nuki app showed Matter was configured.

(After looking back at some notes), a non-HA mobile App for Matter/Thread will not find HA Matter Server, but it is possible (but may be App dependent) for it to find HA’s Thread Network, get the Thread Creds from HA’s Thread Integration, and commission the Device onto the HA Thread network, and if successful, it may ask you to choose another App to do the Matter Commissioning, and from the list should be HA Companion App, and from there do the HA Matter Add Device as you mentioned.

did the same and it nearly worked … but instead of your successfull integration I ended up with an error in the nuki app … will try again and post some more details once i am back home
thanx

1 Like

Did you ever get this working? Could you post steps?

yap …
attached screenshot pointed me to the right track

I wanted to share my success story in getting some TP-Link Tapo plugs discovered through Matter. No matter what I tried, I couldn’t get the plugs adopted in Home Assistant nor Google Home. I then found the solution on YouTube!

YouTube creator Eric Welander gave me the solution in his “BEFORE getting Matter devices” video that IPV6 needs to be enabled on your network to allow Matter devices to get a required IPV6 address!!! I had disabled IPV6 on my OPNsense firewall across all networks and the WAN. Nobody mentions enabling IPV6 for Matter and I never saw it mentioned in the HA docs! Once enabled and configured, the plugs were instantly found and adopted!

I just wanted to share the solution in case anybody else is having adoption issues.

3 Likes

Thanks a lot! I have been trying for days to connect Aquara U200 to HA via matter (connected to Amazon ECHO). My IPV6 was disabled, enabling it did the trick!

1 Like

I have registered Aqara U200 on a network without IPv6 enabled… it could be a coincidence but maybe it is due to problems with multicast traffic (mDNS) on your network?

May I ask, what do you mean by this?
Do you mean to say that your home’s internet router’s LAN interface is not enabled for IPv6?

Yes, router/firewall and switchs with ipv6 and MLD disabled, no DHCPv6 (statefull)

Despite having these functions disabled, HA, Matter server and Thread devices will automatically use ipv6 (stateless). should “autoconfigure”

all within the same VLAN.

Although I am really testing with virtualized HAOS inside a QNAP NAS and it does not seem that communication is established through stateless IPv6… I have to do some more testing and verify that the Zyxel ATP firewall does not block multicast traffic (mDNS)

1 Like

OK, that’s what I thought you meant …
Its the Thread Border Router (TBR) that is sending out IPv6 SLAAC advertised prefixes over the LAN that HA (and others) uses to autoconfigure its IPv6 addresses and this is what makes Matter over Thread work. Note that if there is no TBR, then Matter over WiFi doesn’t work so well unless something like the home router has IPv6 enabled on its LAN side and sending out SLAAC advertised prefixes.

1 Like

I’m using TBR on HAOS with Sonoff ZBDongle-E with QNAP VM passtrough…

But the IPv6 communication between wifi/mobile and HA seems not to work to link a new device… I can ping with IPv6, on the network but not against HA… even with fixed IPv6 or setting a DHCPv6 server (statefull) with a prefix, HA seems not to acquire it… the curious thing is that the same virtual switch gives access with IPv4 without problem …

1 Like

I’m posting in this thread instead of starting a new one.
I have successfully added my Aqara U200 in Google Home.
In Home Assistant I have as prefered network the one my nest devices created and I have synced crendentials multiple times and with multiple devices.
IP6 works fine in my network, it is activated in my NAS and I can see that Home Assistant get an IP6 IP.

I tried adding the Aqara U200 in home Assistant via Google Home app with Android and iOS devices with no luck.

I have started from scratch (resetting U200) with exactly the same results.

The only thing that I haven’t tried is to use Conbee II as thread router and add it to the same network with OTBR.

Any help appreciated.

What NAS do you use? IPv6 stateless?

Ugeeen NAS running True NAS scale. Not sure about the stateless thing :slight_smile:

[Home Assistant Matter Server to commission a device directly]

Today I tried a Bluetooth adapter, but I think it is not compatible…
UGREEN Bluetooth Adapter 5.4 [CM748]

2024-10-28 08:24:07.387 (MainThread) ERROR [matter_server.server] Error doing task: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/matter_server/server/client_handler.py", line 214, in _run_handler
    raise err
  File "/usr/local/lib/python3.11/site-packages/matter_server/server/client_handler.py", line 197, in _run_handler
    result = await result
             ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/matter_server/server/device_controller.py", line 456, in set_thread_operational_dataset
    await self._chip_device_controller.set_thread_operational_dataset(dataset)
  File "/usr/local/lib/python3.11/site-packages/matter_server/server/sdk.py", line 183, in set_thread_operational_dataset
    threadOperationalDataset=bytes.fromhex(dataset),
                             ^^^^^^^^^^^^^^^^^^^^^^
ValueError: non-hexadecimal number found in fromhex() arg at position 2
2024-10-28 08:26:35.865 (MainThread) INFO [matter_server.server.device_controller] Starting Matter commissioning with code using Node ID 1.
2024-10-28 08:26:35.985 (Dummy-2) CHIP_ERROR [chip.native.DL] Disabling CHIPoBLE service due to error: src/platform/Linux/BLEManagerImpl.cpp:596: Ble Error 0x00000401: BLE adapter unavailable
2024-10-28 08:26:35.985 (Dummy-2) CHIP_ERROR [chip.native.CTL] Commissioning discovery over BLE failed: src/platform/Linux/BLEManagerImpl.cpp:743: Ble Error 0x00000401: BLE adapter unavailable
2024-10-28 08:26:35.987 (Dummy-2) CHIP_ERROR [chip.native.-] src/platform/Linux/BLEManagerImpl.cpp:743: Ble Error 0x00000401: BLE adapter unavailable at src/controller/SetUpCodePairer.cpp:324
2024-10-28 08:26:35.987 (Dummy-2) CHIP_ERROR [chip.native.DL] Long dispatch time: 108 ms, for event type 3
2024-10-28 08:27:05.884 (Dummy-2) CHIP_ERROR [chip.native.CTL] Discovery timed out
2024-10-28 08:27:05.884 (Dummy-2) CHIP_ERROR [chip.native.ZCL] Secure Pairing Failed
2024-10-28 08:27:05.885 (Dummy-2) WARNING [chip.ChipDeviceCtrl] Failed to establish secure session to device: src/controller/python/ChipDeviceController-ScriptDevicePairingDelegate.cpp:89: CHIP Error 0x00000003: Incorrect state
2024-10-28 08:27:05.885 (MainThread) ERROR [matter_server.server.client_handler] [140417963409104] Error while handling: commission_with_code: Commission with code failed for node 1.
2024-10-28 08:28:22.775 (MainThread) ERROR [matter_server.server] Error doing task: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/matter_server/server/client_handler.py", line 214, in _run_handler
    raise err
  File "/usr/local/lib/python3.11/site-packages/matter_server/server/client_handler.py", line 197, in _run_handler
    result = await result
             ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/matter_server/server/device_controller.py", line 456, in set_thread_operational_dataset
    await self._chip_device_controller.set_thread_operational_dataset(dataset)
  File "/usr/local/lib/python3.11/site-packages/matter_server/server/sdk.py", line 183, in set_thread_operational_dataset
    threadOperationalDataset=bytes.fromhex(dataset),
                             ^^^^^^^^^^^^^^^^^^^^^^
ValueError: non-hexadecimal number found in fromhex() arg at position 2
2024-10-28 08:29:00.643 (MainThread) ERROR [matter_server.server] Error doing task: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/matter_server/server/client_handler.py", line 214, in _run_handler
    raise err
  File "/usr/local/lib/python3.11/site-packages/matter_server/server/client_handler.py", line 197, in _run_handler
    result = await result
             ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/matter_server/server/device_controller.py", line 456, in set_thread_operational_dataset
    await self._chip_device_controller.set_thread_operational_dataset(dataset)
  File "/usr/local/lib/python3.11/site-packages/matter_server/server/sdk.py", line 183, in set_thread_operational_dataset
    threadOperationalDataset=bytes.fromhex(dataset),
                             ^^^^^^^^^^^^^^^^^^^^^^
ValueError: non-hexadecimal number found in fromhex() arg at position 0
2024-10-28 08:29:25.915 (MainThread) INFO [matter_server.server.device_controller] Starting Matter commissioning with code using Node ID 2.
2024-10-28 08:29:25.921 (Dummy-2) CHIP_ERROR [chip.native.CTL] Commissioning discovery over BLE failed: src/platform/Linux/BLEManagerImpl.cpp:743: Ble Error 0x00000401: BLE adapter unavailable
2024-10-28 08:29:25.921 (Dummy-2) CHIP_ERROR [chip.native.-] src/platform/Linux/BLEManagerImpl.cpp:743: Ble Error 0x00000401: BLE adapter unavailable at src/controller/SetUpCodePairer.cpp:324
2024-10-28 08:29:55.928 (Dummy-2) CHIP_ERROR [chip.native.CTL] Discovery timed out
2024-10-28 08:29:55.929 (Dummy-2) CHIP_ERROR [chip.native.ZCL] Secure Pairing Failed
2024-10-28 08:29:55.929 (Dummy-2) WARNING [chip.ChipDeviceCtrl] Failed to establish secure session to device: src/controller/python/ChipDeviceController-ScriptDevicePairingDelegate.cpp:89: CHIP Error 0x00000003: Incorrect state
2024-10-28 08:29:55.930 (MainThread) ERROR [matter_server.server.client_handler] [140417963409040] Error while handling: commission_with_code: Commission with code failed for node 2.

On the other hand, when starting the process it asks for the “Dataset ID” of the Thread network, when is it really referring to the Extended Pan ID?

image

Using “Dataset id” show error:

Error setting Thread dataset: non-hexadecimal number found in fromhex() arg at position 2

NOTE: The first time you set the property to 1, it is reset to 0

Settings ->Add-ons → Matter Server → Configuration I then set the Bluetooth Adapter ID to 1

The Dataset id that Matter server is looking for is the Thread Integrations “Active dataset TLVs” string.

@wmaker User friendly GUI :upside_down_face::sweat_smile:

Ha Ha :slight_smile:
yeah before they came out with that webpage, I had to use Python code to call a Matter Server API to do the same thing.

Also be aware, I don’t think the settings persist, meaning if you restart the Matter Server AddOn, and want to pair a new device afterwards, you’ll probably have to redo the settings again in the GUI