core: Paring thread Wemo Stage programmable switch fails

The problem

I paired a Wemo Stage programmable switch over Thread to my HomeKit home, then removed it from the home and tried to pair it in Home Assistant. That operation failed.

What version of Home Assistant Core has the issue?

2022.10.2

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

HomeKit Controller

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

: homeassistant.components.homekit_controller.config_flow
Source: components/homekit_controller/config_flow.py:479 
Integration: HomeKit Controller ([documentation](https://www.home-assistant.io/integrations/homekit_controller), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+homekit_controller%22)) 
First occurred: 12:15:15 (5 occurrences) 
Last logged: 12:21:38

Pairing attempt failed with an unhandled exception
OSError: [Errno 101] received through errqueue

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/homekit_controller/config_flow.py", line 479, in async_step_pair
    self.finish_pairing = await discovery.async_start_pairing(self.hkid)
  File "/usr/local/lib/python3.10/site-packages/aiohomekit/controller/coap/discovery.py", line 57, in async_start_pairing
    salt, srpB = await self.connection.do_pair_setup(
  File "/usr/local/lib/python3.10/site-packages/aiohomekit/controller/coap/connection.py", line 283, in do_pair_setup
    response = await asyncio.wait_for(
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 445, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.10/site-packages/aiocoap/protocol.py", line 597, in _run_outer
    await cls._run(app_request, response, weak_observation, protocol, log)
  File "/usr/local/lib/python3.10/site-packages/aiocoap/protocol.py", line 656, in _run
    blockresponse = await blockrequest.response
aiocoap.error.NetworkError: [Errno 101] received through errqueue

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 56 (55 by maintainers)

Commits related to this issue

Most upvoted comments

The fix was included in https://github.com/home-assistant/core/pull/80402. It’s tagged for inclusion in 2022.10.5.

If you are raising a separate ticket for for coap warning I’ll close this one.

Thanks for your help with this.

Awesome. I’ve merged all the fixes we need into aiohomekit. I’ll try and cut a release and get it into a 2022.10 patch release but failing that it should be in 2022.11.

I can decode your device’s GATT data now, see the changes here:

https://github.com/Jc2k/aiohomekit/pull/189/files

Would be great if you could take it for a spin

Thanks @chrysn. AIUI the summary is:

@jfroy has a Thread border router on one vlan and a Home Assistant instance on another. He has a custom kernel on his UniFi router so that it can accept routes from the Thread border router (they are RA’s with “additional” route info). It took quite a bit of back and forth to enable IPv6 to function correctly, but when it did we saw errors like:

Received Type.ACK from <UDP6EndpointAddress [fdbc:107:de33:0:8f7d:9b0a:a2e8:5e93] (locally fd00::1:7304:6ac2:6dfc:4a30%eth0)>, but could not match it to a running exchange.

We didn’t really understand what they meant, and I was worried it was because we had done something stupid with his IPv6 setup. https://github.com/home-assistant/core/issues/80133#issuecomment-1278296463 and the comment above it cover what those addresses all are.

It does seem to work however, and we’ve since gotten his device paired. We are just fixing decoding some HomeKit data as this device is the first thread device we’ve encountered with linked services and stateless event characteristics.

We should get to the bottom of what the warning from aiocoap means, but it doesn’t seem to be blocking us so no rush to help us given your personal situation i think!