Cannot add Matter device to Homeassistant

Don’t know when it started, but I cannot add new Matter devices into HA (with Matter addon installed).
I have a new Tapo TS25 Smart Switch to add into HA. I reset the device by pushing the reset button for 10sec. Then I tried to use iPhone HA app to add a Matter devices in HA Setting->Add Integration->Add Matter device->No, it is new-> More options
I can see the the new icon show as “Nearby Devices”. When I click “Add to Home Assistant”, it shows “Setting Up” then stuck there till failure.
I can add the device directly into IOS Home App with similar process.

I used to be do the same w/o any issue for another Tapo TS25 device and it is still working fine today. I guess it is due to HA/Matter add-on upgrades after I added the first TS25? I would appreciate if some expert can help me out.

Is there a reason you’re using “More options” instead of scanning the QR code? When I choose that option it shows me devices that were seen months ago but are no longer on my network, so I suspect the list you see might be out of date. Maybe try entering its setup code manually if you can’t use your camera?

Having same problem.
Nuki smart lock pro. Was connected over matter via Apple TV. Start losing connection. So I reset everything and try to reconnect it again.
(Matter server 8) it just won’t connect.
Spend 2 days factory resetting and try to pair again.
Not working.

In the end I add my Nuki pro into HomeKit with my iPhone 16 pro. (That worked)
Now I went to HA and add a new device in matter.
Instead of selecting a new device, select device that’s on another controller. Now open up HomeKit. Select your device. Go to settings. Select pairing code. Enter this in HA. And for some strange reason my Nuki paired to HA via matter and is runnen for a week with no problem.

I also tried your approach but it doesn’t help either.
After factory reset (hold reset button for >10sec), I could add TS25 into iPhone Home App, then go to Accessary Settings → Turning On Pairing Mode. I got a different pairing code from on device. Then I go to iPhone HA app, Devices and Settings → Add Integration → Add Matter device → Yes, it is already in use. Here I tried both Apple Home and Other controllers with the new pairing code, both failed.
Here is log from Matter Add-on:

2025-05-25 16:27:12.469 (Dummy-2) CHIP_DETAIL [chip.native.EM] Found matching exchange: 35434r with Node: <0000000000000009, 1>, Delegate: (nil)
2025-05-25 16:27:12.469 (Dummy-2) CHIP_DETAIL [chip.native.EM] Rxd Ack; Removing MessageCounter:261857257 from Retrans Table on exchange 35434r with Node: <0000000000000009, 1>
2025-05-25 16:27:38.046 (MainThread) INFO [matter_server.server.device_controller] Starting Matter commissioning with code using Node ID 20.
2025-05-25 16:27:38.050 (Dummy-2) CHIP_PROGRESS [chip.native.CTL] Setting attestation nonce to random value
2025-05-25 16:27:38.051 (Dummy-2) CHIP_PROGRESS [chip.native.CTL] Setting CSR nonce to random value
2025-05-25 16:27:38.052 (Dummy-2) CHIP_DETAIL [chip.native.CTL] Stopping commissioning discovery over DNS-SD
2025-05-25 16:27:38.053 (Dummy-2) CHIP_PROGRESS [chip.native.CTL] Starting commissioning discovery over DNS-SD
2025-05-25 16:28:08.063 (Dummy-2) CHIP_ERROR [chip.native.CTL] Discovery timed out
2025-05-25 16:28:08.064 (Dummy-2) CHIP_DETAIL [chip.native.CTL] Stopping commissioning discovery over DNS-SD
2025-05-25 16:28:08.064 (Dummy-2) CHIP_ERROR [chip.native.ZCL] Secure Pairing Failed
2025-05-25 16:28:08.064 (Dummy-2) WARNING [chip.ChipDeviceCtrl] Failed to establish secure session to device: src/controller/python/ChipDeviceController-ScriptDevicePairingDelegate.cpp:96: CHIP Error 0x00000003: Incorrect state
2025-05-25 16:28:08.065 (MainThread) ERROR [matter_server.server.client_handler] [140344345853536] Error while handling: commission_with_code: Commission with code failed for node 20.
2025-05-25 16:28:12.439 (Dummy-2) CHIP_PROGRESS [chip.native.EM] >>> [E:35435r S:31119 M:211800959] (S) Msg RX from 1:0000000000000009 [B1F3] to 000000000001B669 --- Type 0001:05 (IM:ReportData) (B:41)
2025-05-25 16:28:12.439 (Dummy-2) CHIP_DETAIL [chip.native.EM] Handling via exchange: 35435r with Node: <0000000000000009, 1>, Delegate: 0x7fa486bab968
2025-05-25 16:28:12.440 (Dummy-2) CHIP_DETAIL [chip.native.DMG] ReportDataMessage =
2025-05-25 16:28:12.441 (Dummy-2) CHIP_DETAIL [chip.native.DMG] {
2025-05-25 16:28:12.442 (Dummy-2) CHIP_DETAIL [chip.native.DMG] 	SubscriptionId = 0x3be94477,
2025-05-25 16:28:12.442 (Dummy-2) CHIP_DETAIL [chip.native.DMG] 	InteractionModelRevision = 1
2025-05-25 16:28:12.442 (Dummy-2) CHIP_DETAIL [chip.native.DMG] }
2025-05-25 16:28:12.442 (Dummy-2) CHIP_PROGRESS [chip.native.DMG] Refresh LivenessCheckTime for 73265 milliseconds with SubscriptionId = 0x3be94477 Peer = 01:0000000000000009
2025-05-25 16:28:12.447 (Dummy-2) CHIP_PROGRESS [chip.native.EM] <<< [E:35435r S:31119 M:261857258 (Ack:211800959)] (S) Msg TX from 000000000001B669 to 1:0000000000000009 [B1F3] [UDP:[fe80::f209:dff:fefe:b947%enp0s3]:5540] --- Type 0001:01 (IM:StatusResponse) (B:42)
2025-05-25 16:28:12.448 (Dummy-2) CHIP_PROGRESS [chip.native.EM] ??1 [E:35435r with Node: <0000000000000009, 1> S:31119 M:261857258] (S) Msg Retransmission to 1:0000000000000009 in 378ms [State:Active II:500 AI:300 AT:4000]
2025-05-25 16:28:12.465 (Dummy-2) CHIP_PROGRESS [chip.native.EM] >>> [E:35435r S:31119 M:211800960 (Ack:261857258)] (S) Msg RX from 1:0000000000000009 [B1F3] to 000000000001B669 --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34)
2025-05-25 16:28:12.466 (Dummy-2) CHIP_DETAIL [chip.native.EM] Found matching exchange: 35435r with Node: <0000000000000009, 1>, Delegate: (nil)
2025-05-25 16:28:12.467 (Dummy-2) CHIP_DETAIL [chip.native.EM] Rxd Ack; Removing MessageCounter:261857258 from Retrans Table on exchange 35435r with Node: <0000000000000009, 1>

It seems more like an issue in Matter Server on HA.

I am using lastet HA and Matter Add-on.

Tried QR code, doesn’t work either. I think they have the same. QR code is translated into same pairing code on device.

One thing may worth to notice. In Matter Add-on WebUI page, if I click on “+ Commission Node”. I can find 3 options:
Commission New Wifi Device (Greyed)
Commission New Thread Device (Greyed)
Commission Existing Device

Does it mean Matter Server can only refresh existing devices, not allowing new devices?

That part of the Matter AddOn UI is, in general, about the AddOn commissioninng a device directly without needing a mobile device to do the commissioning. The cases that are greyed out, are those where the AddOn requires access to a Bluetooth device to in order for the AddOn to do the direct commissioning and the AddOn doesn’t see a Bluetooth device (so it removes those options)

Since I am using HA running in QNAP VM. Should I plug a USB bluetooth dongle to QNAP and passthrough it to VM?

You can do that, and check to see what the bluetooth device number is because you need to configure the Matter Server with that number. You’ll also need to have the Thread dataset or WiFi credentials (depending on which device is being added) to provide to the Matter Server at commissioning time.

I don’t have Thread border router in my network but I don’t think Tapo devices are thread based. I think they are Wifi based.

That’s fine… what I meant by “WiFi credentials”, is that you have to provide the SSID and password of the WiFi network you want the Matter WiFi device to join.

I tried again to add Tapo TS25 into Matter in HA directly with Android HA app this time. I factory reset TS25, the LED flashes as expected. I then add it in Android HA App: Settings → Devices & services → Add Integration → Add Matter device → No, it is new → Setup without QR code then type matter pair code on device. Android app exposes more details of progress: first “Trying to find device” → “Generating Wifi Credentials” → “Check network connectivity to XXX (SSID)” then stuck there. During the process, the LED on TS25 turns white (connected to Wifi), but finally Android HA app failed.

On Matter server side, the log is the same as above pasted. I think the Android phone transferred Wifi credential to TS25 sucessfully, and TS25 connects to Wifi w/o issue, but somehow, Matter Server couldn’t complete or confirm the remaining steps.
This has been bothering me a week, still shooting in the dark. Matter is supposed ot make smart home easier, but it goes in opposite way.

I don’t know how Android does this with WiFi, but I do know that iOS HA App will give the device the WiFi credentials based on the WiFi network the iOS device is using at that moment, so if iOS device is on say a 5GHz WiFi, the Matter device will fail to be commissioned.

I did split Wifi into 2.4GHz and 5GHz with different SSIDs and my Android phone is in 2.4GHz Wifi (so was my iPhone)

Based on the homework I did, I also turned on IPv6 on my router and QNAP (My HA is running in VM on QNAP)

Yes if you don’t have a Thread Border Router (i.e. WiFi only Matter), then you do indeed need to have your router on the home LAN side with IPv6 enabled. You should check to see if HA has IPv6 addresses not only FE80: but other non-FE80 addresses too.
As for QNAP, I don’t think that it is necessary to have IPv6 enabled on it, but should not hurt.

Out of magic, everything worked fine this morning - Matter devices were able to add to HA. The other issue of Kasa/Tapo authentication issue after HA reboots went away.
I made a few changes before the magic, the one I guess is real fix is removing device_tracker setting for my router in configuration.yaml. I don’t know why but dare not to try again to verify.

My IPv6 address in HA/Settings/System/Network:
fe80::xxxx:xxxx:xxxx:xxxx
and there is no IPv6 gateway address. I chose “Automatic” rather than “Static”

What’s wrong with FE80 address?

Actually, I’m not sure that there is anything wrong with a FE80 (Link Local) only address.
I’ve heard from others that for WiFi based Matter that one needs to enable IPv6 on their router so as to get a ULA IPv6 address. Usually when one enables IPv6 on their router, it picks a ULA Prefix and advertises it for the other devices (like HA) so that they can derive their own IPv6 address from the ULA prefix.
However having thought about it some more, I think Matter Server and Matter WiFi devices will work just fine with link local (FE80) only IPv6 addresses.

I agree and Matter works just fine on HA. Matter is designed to allow local control if I understand correctly, so local IPv6 address is OK for Matter.