core icon indicating copy to clipboard operation
core copied to clipboard

Cannot add Matter devices

Open gjelbrim opened this issue 8 months ago • 16 comments

The problem

I am not able to connect any Matter Device. When starting the Matter Server, the errors and warnings about MDNS below appear in the log (though I don't think it has anything to do with it). When I initiate the pairing process, the errors further down in the log appear, which seem to have something to do with BLE and timeouts.

What version of Home Assistant Core has the issue?

core-2023.11.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Matter

Link to integration documentation on our website

https://www.home-assistant.io/integrations/matter/

Diagnostics information

{ "home_assistant": { "installation_type": "Home Assistant OS", "version": "2023.11.3", "dev": false, "hassio": true, "virtualenv": false, "python_version": "3.11.6", "docker": true, "arch": "aarch64", "timezone": "Europe/Berlin", "os_name": "Linux", "os_version": "6.1.21-v8", "supervisor": "2023.11.6", "host_os": "Home Assistant OS 11.1", "docker_version": "24.0.6", "chassis": "embedded", "run_as_root": true }, "custom_components": { "alexa_media": { "version": "4.8.0", "requirements": [ "alexapy==1.27.10", "packaging>=20.3", "wrapt>=1.14.0" ] }, "circadian_lighting": { "version": "2.1.4", "requirements": [] }, "hacs": { "version": "1.33.0", "requirements": [ "aiogithubapi>=22.10.1" ] } }, "integration_manifest": { "domain": "matter", "name": "Matter (BETA)", "codeowners": [ "@home-assistant/matter" ], "config_flow": true, "dependencies": [ "websocket_api" ], "documentation": "https://www.home-assistant.io/integrations/matter", "iot_class": "local_push", "requirements": [ "python-matter-server==4.0.2" ], "is_built_in": true }, "data": { "server": { "info": { "fabric_id": 2, "compressed_fabric_id": 9525509635650634147, "schema_version": 4, "min_supported_schema_version": 2, "sdk_version": "2023.10.2", "wifi_credentials_set": false, "thread_credentials_set": false }, "nodes": [], "events": [] } } }

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2023-12-02 16:49:03 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on wlan0 for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-02 16:49:04 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on veth449f29e for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-02 16:49:04 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on vethf8f2135 for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-02 16:49:04 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on veth272ee1f for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-02 16:49:04 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on vethe8fdcc4 for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-02 16:49:04 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on veth7b66f80 for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-02 16:49:04 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on vethb6609e8 for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-02 16:49:04 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on veth9535d6f for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-02 16:49:04 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on veth7944fda for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-02 16:49:04 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on veth28f112c for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-02 16:49:04 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on veth7f78f30 for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-02 16:49:04 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on wpan0 for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-02 16:49:05 core-matter-server CertificateAuthorityManager[126] WARNING Loading certificate authorities from storage...
2023-12-02 16:49:05 core-matter-server CertificateAuthority[126] WARNING New CertificateAuthority at index 1
2023-12-02 16:49:05 core-matter-server CertificateAuthority[126] WARNING Loading fabric admins from storage...

...
...
...

2023-12-02 16:55:19 core-matter-server matter_server.server.helpers.paa_certificates[126] INFO Fetching the latest PAA root certificates from DCL.
2023-12-02 16:55:20 core-matter-server matter_server.server.helpers.paa_certificates[126] INFO Fetched 0 PAA root certificates from DCL.
2023-12-02 16:55:20 core-matter-server matter_server.server.helpers.paa_certificates[126] INFO Fetching the latest PAA root certificates from Git.
2023-12-02 16:55:20 core-matter-server matter_server.server.helpers.paa_certificates[126] INFO Fetched 0 PAA root certificates from Git.
2023-12-02 16:55:20 core-matter-server chip.DL[126] ERROR Long dispatch time: 298 ms, for event type 2
2023-12-02 16:55:30 core-matter-server chip.CTL[126] ERROR Commissioning discovery over BLE failed: src/platform/Linux/bluez/ChipDeviceScanner.cpp:173: CHIP Error 0x00000032: Timeout
2023-12-02 16:55:30 core-matter-server chip.-[126] ERROR src/platform/Linux/bluez/ChipDeviceScanner.cpp:173: CHIP Error 0x00000032: Timeout at src/controller/SetUpCodePairer.cpp:324
2023-12-02 16:55:30 core-matter-server chip.BLE[126] ERROR BLE scan error: src/platform/Linux/bluez/ChipDeviceScanner.cpp:173: CHIP Error 0x00000032: Timeout
2023-12-02 16:55:31 core-matter-server chip.EM[126] ERROR Failed to Send CHIP MessageCounter:111146596 on exchange 37781i sendCount: 4 max retries: 4
2023-12-02 16:55:50 core-matter-server chip.CTL[126] ERROR Discovery timed out
2023-12-02 16:56:02 core-matter-server chip.SC[126] ERROR PASESession timed out while waiting for a response from the peer. Expected message type was 35
2023-12-02 16:56:02 core-matter-server chip.ZCL[126] ERROR Secure Pairing Failed
2023-12-02 16:56:02 core-matter-server matter_server.server.client_handler[126] ERROR [547916403344] Error handling message: CommandMessage(message_id='505b3325ca24476fbf19f157d7daa2f8', command='commission_with_code', args={'code': '11397736342'})
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/matter_server/server/client_handler.py", line 188, in _run_handler
    result = await result
             ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/matter_server/server/device_controller.py", line 173, in commission_with_code
    raise NodeCommissionFailed(
matter_server.common.errors.NodeCommissionFailed: Commission with code failed for node 8

Additional information

No response

gjelbrim avatar Dec 05 '23 06:12 gjelbrim

Hey there @home-assistant/matter, mind taking a look at this issue as it has been labeled with an integration (matter) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of matter can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign matter Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


matter documentation matter source (message by IssueLinks)

home-assistant[bot] avatar Dec 05 '23 06:12 home-assistant[bot]

I'm seeing the same thing. This is my log:

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: 4.10.2
 You are running the latest version of this add-on.
 System: Home Assistant OS 11.2  (aarch64 / yellow)
 Home Assistant Core: 2023.11.3
 Home Assistant Supervisor: 2023.11.6
-----------------------------------------------------------
 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
[10:17:17] INFO: Starting Matter Server...
s6-rc: info: service legacy-services successfully started
[10:17:18] INFO: Successfully send discovery information to Home Assistant.
[1701800242.762695][126:126] CHIP:CTL: Setting attestation nonce to random value
[1701800242.762956][126:126] CHIP:CTL: Setting CSR nonce to random value
[1701800242.765349][126:126] CHIP:DL: ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_kvs
[1701800242.766189][126:126] CHIP:DL: writing settings to file (/tmp/chip_kvs-EHEJeK)
[1701800242.766415][126:126] CHIP:DL: renamed tmp file to file (/tmp/chip_kvs)
[1701800242.767151][126:126] CHIP:DL: ChipLinuxStorage::Init: Using KVS config file: /data/chip_factory.ini
[1701800242.767800][126:126] CHIP:DL: ChipLinuxStorage::Init: Using KVS config file: /data/chip_config.ini
[1701800242.767979][126:126] CHIP:DL: ChipLinuxStorage::Init: Using KVS config file: /data/chip_counters.ini
[1701800242.769005][126:126] CHIP:DL: writing settings to file (/data/chip_counters.ini-iS5iNI)
[1701800242.769829][126:126] CHIP:DL: renamed tmp file to file (/data/chip_counters.ini)
[1701800242.769887][126:126] CHIP:DL: NVS set: chip-counters/reboot-count = 73 (0x49)
[1701800242.771496][126:126] CHIP:DL: Got Ethernet interface: end0
[1701800242.772661][126:126] CHIP:DL: Found the primary Ethernet interface:end0
[1701800242.773796][126:126] CHIP:DL: Got WiFi interface: wlan0
[1701800242.773899][126:126] CHIP:DL: Failed to reset WiFi statistic counts
2023-12-05 10:17:22 core-matter-server PersistentStorage[126] WARNING Initializing persistent storage from file: /data/chip.json
2023-12-05 10:17:22 core-matter-server PersistentStorage[126] WARNING Loading configuration from /data/chip.json...
2023-12-05 10:17:22 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on wlan0 for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-05 10:17:22 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on vetha5206fb for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-05 10:17:22 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on veth4ef940d for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-05 10:17:22 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on vethcece4b0 for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-05 10:17:22 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on veth338e5fd for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-05 10:17:22 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on veth169328b for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-05 10:17:22 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on veth8c7b082 for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-05 10:17:22 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on vethe1cbdc5 for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-05 10:17:22 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on veth34eace5 for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-05 10:17:22 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on veth2726782 for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-05 10:17:22 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on veth3404186 for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-05 10:17:22 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on vethd564546 for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-05 10:17:22 core-matter-server chip.DL[126] ERROR MDNS failed to join multicast group on veth1635596 for address type IPv4: src/inet/UDPEndPointImplSockets.cpp:777: Inet Error 0x00000110: Address not found
2023-12-05 10:17:23 core-matter-server CertificateAuthorityManager[126] WARNING Loading certificate authorities from storage...
2023-12-05 10:17:23 core-matter-server CertificateAuthority[126] WARNING New CertificateAuthority at index 1
2023-12-05 10:17:23 core-matter-server CertificateAuthority[126] WARNING Loading fabric admins from storage...
2023-12-05 10:17:23 core-matter-server FabricAdmin[126] WARNING New FabricAdmin: FabricId: 0x0000000000000001, VendorId = 0xFFF1
2023-12-05 10:17:23 core-matter-server FabricAdmin[126] WARNING New FabricAdmin: FabricId: 0x0000000000000002, VendorId = 0x134B
/usr/local/lib/python3.11/site-packages/matter_server/server/helpers/paa_certificates.py:46: 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 JDK16+ or the latest JDK11 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 for more details.
  pem_certificate = x509.load_pem_x509_certificate(certificate.encode())
2023-12-05 10:17:29 core-matter-server FabricAdmin[126] WARNING Allocating new controller with CaIndex: 1, FabricId: 0x0000000000000002, NodeId: 0x000000000001B669, CatTags: []
2023-12-05 10:19:28 core-matter-server matter_server.server.client_handler[126] WARNING [548359576528] Disconnected: Received non-Text message.
2023-12-05 10:19:33 core-matter-server matter_server.server.client_handler[126] WARNING [548359581072] Disconnected: Received non-Text message.```

CaliLuke avatar Dec 05 '23 18:12 CaliLuke

@CaliLuke your log looks fine, you can ignore the errors about joining the multicast group, the sdk is trying to bind to inaccessible interfaces. It doe snot look nice but its harmless.

marcelveldt avatar Dec 07 '23 08:12 marcelveldt

@gjelbrim what kind of device are you trying to add ? Did you read all our documentation and tips about Matter ? For example you need a FLAT network. No (v)LANS and especially no mdns responders. Professional Wifi/networking solutions like Unifi try to "optimize" multicast traffic but will kill Matter if the settings are incorrect.

Also, there is a big difference between Wifi and Thread based Matter devices. WiFi based devices are easy but Thread based Matter devices do need one or more Thread Border routers in your home. For example the Apple HomePod Mini or Google Nest Hub V2.

marcelveldt avatar Dec 07 '23 08:12 marcelveldt

@marcelveldt I am trying to add a Nanoleaf Matter E27 Smart Bulb which is a Thread device. I have an AVM Fritz!Box 7530 AX as the only router in my network. There is no VLAN, but there are mDNS responders running on Macs on the network.

I have an Apple TV 4K as an additional Thread Boarder Router in my network. And I can connect the Bulb to Apple HomeKit and Amazon Alexa through this router.

gjelbrim avatar Dec 07 '23 09:12 gjelbrim

I'm also having similar problems. I can add devices to iOS Home and Google Home, but there are many issues when trying to add to HomeAssistant.

One thought - maybe its the HomeAssistant iOS App and its commissioning, rather than HomeAssistant itself.

Has the HomeSeer commissioning software on the iOS kept pace with the Matter server itself? It looks like the iOS app was last updated a month or so ago. Has it been updated with the 1.2.0.1 SDK? If not, could that be tried? While I don't doubt there are mDNS issues, there must be something more happening given that iOS and Google Home can still add devices (on iOS - I don't know about Android).

jvmahon avatar Dec 07 '23 14:12 jvmahon

@gjelbrim what kind of device are you trying to add ? Did you read all our documentation and tips about Matter ? For example you need a FLAT network. No (v)LANS and especially no mdns responders. Professional Wifi/networking solutions like Unifi try to "optimize" multicast traffic but will kill Matter if the settings are incorrect.

Also, there is a big difference between Wifi and Thread based Matter devices. WiFi based devices are easy but Thread based Matter devices do need one or more Thread Border routers in your home. For example the Apple HomePod Mini or Google Nest Hub V2.

I have a simple Asus XT9 mesh system with two units, one working as router and the other as extender. I'm trying to add an Aqara hub and locks that connects just fine to a Google Home screen but I can't get it to work at all in Home Assistant. I'm happy to provide more info on my system if it helps diagnosing the issue, at this point I'm at a loss.

I'm using a Home Assistant Yellow if that helps, the skyconnect is in single protocol mode because the dual didn't work with Z2Q at the time and I'm connected using ethernet to the router. Is it possible that Matter sees that the wifi interface is not connected and prefers that to the ethernet?

CaliLuke avatar Dec 07 '23 16:12 CaliLuke

@CaliLuke The advice is generally to make sure you have no mDNS responders. I thought I was following that advice, but then did some more looking and realized that Apple Bojour is a mDNS responder that is common in Windows PCs with iTunes

So, if you're a Windows / iTunes user, check your installed Windows programs from the control panel and remove Bonjour.

Once I did that, I had greatly improved luck adding sensors and devices.

jvmahon avatar Dec 07 '23 17:12 jvmahon

@CaliLuke The advice is generally to make sure you have no mDNS responders. I thought I was following that advice, but then did some more looking and realized that Apple Bojour is a mDNS responder that is common in Windows PCs with iTunes

So, if you're a Windows / iTunes user, check your installed Windows programs from the control panel and remove Bonjour.

Once I did that, I had greatly improved luck adding sensors and devices.

I have a house full of Macs, an Apple TV and a Google Home screen. If other devices capable or hearing multicast are an issue then the Matter integration is pointless as it's not built for realistic scenarios.

CaliLuke avatar Dec 07 '23 18:12 CaliLuke

I have a house full of Macs, an Apple TV and a Google Home screen. If other devices capable or hearing multicast are an issue then the Matter integration is pointless as it's not built for realistic scenarios.

I have a similar situation - several Apple TVs, Google Homes, Airplay devices, etc. However, by removing "Bonjour" from just two Windows PCs, I seem to have less mDNS "Debug" info being generated and there seems to be an improvement (not perfect, but definitely improved) in device pairing response (particularly in the multi-fabric pairing of devices). I did not lose any functionality of my Apple TVs, Airplay Devices, etc. - they all seem to still show up as Airplay devices, etc. But It was definitely frustrating and having to figure out what is a mDNS responder is not something that really works well for "mass consumer" type devices. Hope to see this sort out as the technology matures!

jvmahon avatar Dec 07 '23 19:12 jvmahon

Hi, I also have issues adding matter devices to home assistant. In my case it's Meross MSS315 wifi smart plug. I can find the smart plugs registered in mDNS via a mDNS discovery app. I can also see homeassistant.local:8123. But I cannot see the home assistant matter server exposed in mDNS (running on port 5580?), is that expected?

alverdal avatar Dec 11 '23 11:12 alverdal

Hello, same warning here core-matter-server matter_server.server.client_handler[126] WARNING [547610357456] Disconnected: Received non-Text message.. I had previously been able to add the device, then added it on my Google Home also, and it stopped working on HA. So I deleted it to try to add it back only on HA, and now I have this error.

floranpagliai avatar Dec 11 '23 14:12 floranpagliai

I decided to do a "redo" on all my Matter devices, so I reset them all, deleted my home from iOS and Google Home, deleted the HomeAssistant Integration and started over. But before this I had updated my Apple TV 4K to tvOS 17.2 RC2 beta. I was able to add a mix of about 45 Matter devices to Apple iOS with about a 95% success rate - i.e., almost all pairing on the first try, but all devices eventually succeeded.

However, though great success pairing on Apple, now nothing will pair to either Google Home or HomeAssistant (for clarity, I'm not trying to re-use the QR codes, and I'm activating pairing from within the iOS "Pair" menu to generate a new code each time).

So I'm thinking maybe this is an Apple TV OS 17.2 issue (trying a beta does have some risk!). If others have a similar "pair to apple first" then a problem, it may not be HomeAssistant. Hard to tell, but I'm waiting for the next Apple iOS / tvOS "full" release before trying anything else.

Update: iOS 17.2 "Release" also did not work, so I then updated to iOS 17.3 beta and tvOS 17.3 beta, and I was then able to pair to Google Home and HomeAssistant again. So there seem to be some Apple problems at play too.

jvmahon avatar Dec 11 '23 15:12 jvmahon

I've got four Eve MotionBlinds with the matter firmware and was able to add two of them to Home Assistant. Some days later I wanted to add the other two but this was unsuccessful. "Unable to Add Accessory". I get the feeling that not enough time is offered to the commission proces. The unable to Add Accessory error occurs after 22 seconds. As I can recall adding the first two blinds took more than 30 seconds. I could add the blinds to Google Home which took 32 seconds.

The blinds are communicating via Thread with as border router an Apple HomePod Mini. My Home Assistant server, the Apple HomePod mini and my iPhone are on the same network. What I do find strange is the fact that it tries to commission over BLE while the device is connected over thread. However I don't know if that is the problem.

Below the relevant part of the log...

2023-12-19 21:49:19 core-matter-server matter_server.server.helpers.paa_certificates[127] INFO Fetching the latest PAA root certificates from DCL. 2023-12-19 21:49:19 core-matter-server matter_server.server.helpers.paa_certificates[127] INFO Fetched 0 PAA root certificates from DCL. 2023-12-19 21:49:19 core-matter-server matter_server.server.helpers.paa_certificates[127] INFO Fetching the latest PAA root certificates from Git. 2023-12-19 21:49:19 core-matter-server matter_server.server.helpers.paa_certificates[127] INFO Fetched 0 PAA root certificates from Git. 2023-12-19 21:49:19 core-matter-server chip.CTL[127] ERROR Commissioning discovery over BLE failed: src/platform/Linux/BLEManagerImpl.cpp:687: CHIP Error 0x00000003: Incorrect state 2023-12-19 21:49:19 core-matter-server chip.-[127] ERROR src/platform/Linux/BLEManagerImpl.cpp:687: CHIP Error 0x00000003: Incorrect state at src/controller/SetUpCodePairer.cpp:324 2023-12-19 21:49:19 core-matter-server chip.BLE[127] ERROR No adapter available for new connection establishment 2023-12-19 21:49:24 core-matter-server matter_server.server.client_handler[127] ERROR [140170421201360] Error handling message: CommandMessage(message_id='227bcb508a2342f297716c4e6302a4ff', command='commission_with_code', args={'code': '32391621400'}) Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/matter_server/server/client_handler.py", line 188, in _run_handler result = await result ^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/matter_server/server/device_controller.py", line 167, in commission_with_code raise NodeCommissionFailed( matter_server.common.errors.NodeCommissionFailed: Commission with code failed for node 6 2023-12-19 21:49:27 core-matter-server chip.CTL[127] ERROR Failed to perform commissioning step 18 2023-12-19 21:49:28 core-matter-server chip.EM[127] ERROR Failed to send Solitary ack for MessageCounter:7419791 on exchange 28190i:src/messaging/ExchangeContext.cpp:103: CHIP Error 0x00000002: Connection aborted

Update: I eventually managed to connect all my matter devices (Eve Energy and 4 Eve MotionBlinds) to Home Assistant. This is what I did. First I updated to iOS 17.2.1 (don't know if that solved my problem). Before that I noticed that in iOS under settings -> general -> Matter-accessories your matter devices are listed. And under a specific matter device I noticed that there is a connection with Apple Home, Google LLC and 4939. 4939 is apparently my Home Assistant. But this is incorrect because the commissioning failed. So I deleted the 4939 connection and tried to add the matter device again to Home Assisstant. This time it was successful. Although some of the devices I had to try several times (and every time I deleted the connection as stated above). So, I think that timeout values for the commission proces are too strict. But i'm happy that finally, after trial and error, I got all my matter devices integrated with HA.

jaccobezemer avatar Dec 19 '23 21:12 jaccobezemer

@marcelveldt I am trying to add a Nanoleaf Matter E27 Smart Bulb which is a Thread device. I have an AVM Fritz!Box 7530 AX as the only router in my network. There is no VLAN, but there are mDNS responders running on Macs on the network.

I have an Apple TV 4K as an additional Thread Boarder Router in my network. And I can connect the Bulb to Apple HomeKit and Amazon Alexa through this router.

@gjelbrim as this issue report has been hijacked with lots of other messages and reports I'm now a bit clueless if your issue has been resolved. With mDNS responders we mean mdns forwarders such as Avahi that try to forward mdns packets between vlans. Apple devices listening to mdns/bonjour are totally fine of course.

Matter traffic can not travel over multiple subnets due to its (IPv6) link local nature, especially in combination with Thread. Those mDNS forwarders make things even worse by malforming packets. Even in case there are no vlans and such a forwarder is active it can completely ruin the Matter experience, hence we keep mentioning to disable it as a lot of HA enthusiasts have these semi-professional network setups from Unifi and Omada, which are great for businesses but not for consumer grade protocols like Matter.

I have tested the Fritzbox network gear myself and that works out of the box great with Matter and Thread. If you use the Home Assistant iOS app to commission devices, it will automatically use your existing Apple TV as border router. So while you commission, make sure to keep the device close to both the phone and the border router.

Also note that if the device is already added to Apple Home, you can no longer use the QR code on the device. You will have to enable commissioning mode from within Apple Home to forward the device to HA.

Please let me know if you still run into issues and if so, provide step by step what you did and what error you got.

marcelveldt avatar Dec 22 '23 14:12 marcelveldt

I can start a separate thread if needed but I'm running into the same or very similar issues. I have a "consumer" RT-AC88U, no vlans and disabled avahi-daemon in the router. IPV6 is enabled and I can ping6 other ipv6 addresses in the network. HA/matter and thread are running on the same network. I am trying to pair an Aqara Door and Window Sensor P2 using the HA companion app on Android. If I start from the half-screen prompt from google and choose HA as the matter app, it is reported as "Device connected", but then fails on the next screen with the HA prompt to "Add Matter device". The device, phone, and skyconnect are all in the same room. I have not attempted to pair with the Google Home thread network. I have tried completely removing and reinstalling the matter integration, as this is my first matter/thread device, but that hasn't got me any closer.

HA v2023.12.3

These are the logs from when that happens.

2023-12-26 09:56:35 hostname matter_server.server.device_controller[1] INFO Starting Matter commissioning with code using Node ID 1.
2023-12-26 09:56:45 hostname chip.CTL[1] ERROR Commissioning discovery over BLE failed: src/platform/Linux/bluez/ChipDeviceScanner.cpp:173: CHIP Error 0x00000032: Timeout
2023-12-26 09:56:45 hostname chip.-[1] ERROR src/platform/Linux/bluez/ChipDeviceScanner.cpp:173: CHIP Error 0x00000032: Timeout at src/controller/SetUpCodePairer.cpp:324
2023-12-26 09:56:45 hostname chip.BLE[1] ERROR BLE scan error: src/platform/Linux/bluez/ChipDeviceScanner.cpp:173: CHIP Error 0x00000032: Timeout
2023-12-26 09:57:05 hostname chip.CTL[1] ERROR Discovery timed out
2023-12-26 09:57:05 hostname chip.EM[1] ERROR Failed to Send CHIP MessageCounter:107964781 on exchange 10281i sendCount: 4 max retries: 4
2023-12-26 09:57:12 hostname chip.SC[1] ERROR PASESession timed out while waiting for a response from the peer. Expected message type was 33
2023-12-26 09:57:12 hostname chip.ZCL[1] ERROR Secure Pairing Failed
2023-12-26 09:57:12 hostname matter_server.server.client_handler[1] ERROR [139927666049424] Error handling message: CommandMessage(message_id='43b373d58537431087a7a4dd7cb27a6a', command='commission_with_code', args={'code': '24635359046'})
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/matter_server/server/client_handler.py", line 188, in _run_handler
    result = await result
             ^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/matter_server/server/device_controller.py", line 201, in commission_with_code
    raise NodeCommissionFailed(
matter_server.common.errors.NodeCommissionFailed: Commission with code failed for node 1

D34DC3N73R avatar Dec 26 '23 10:12 D34DC3N73R

Nuked (stopped it from running, it's still on the computer) Avahi-daemon on all my Linux servers and now I can add Matter devices when before I was getting core-matter-server chip.DIS[126] ERROR Failed to parse mDNS query

systemctl mask avahi-daemon

https://ubuntuforums.org/showthread.php?t=2425530 https://ccm.net/computing/linux/2253-disabling-the-avahi-daemon/

nsaspook avatar Dec 28 '23 22:12 nsaspook

I'm closing this issue as the original reported did not respond. For those having issues with commissioning Matter devices:

  1. Read our documentation, especially around supported scenarios.
  2. Join our discord server to get (community) support
  3. If you join the discord server (matter channel) make sure to read the pinned posts!

Also, we currently have an issue with the Android app as we speak. Using the Companion app on Android fails to commission devices, a new update will be launched asap. Until then first commission the device to Google Home and share to HA from there. You can remove the device again from Google afterwards.

marcelveldt avatar Jan 04 '24 14:01 marcelveldt