Hey everyone! Thank you for your fantastic work on everything HA. This ecosystem is absolutely fantastic
Today I upgraded HA to 2021.7 and my HomeKit Controller started acting up.
The homebridge-backed entities would become unavailable intermittently, without any interesting messages in the HA logs. Interestingly, the entities would come back if a device state was modified outside of HA (let’s say from homebridge, or by tapping a switch).
After messing around with the code for a while, I figured out that the polling part of HomeKit was failing. A recent change in the codebase, Set homekit controller available state at startup (#51013) · home-assistant/core@98535c9 · GitHub, made it so if the poller fails a few times, it marks the accessory as unavailable - before it would just ignore these failures. So I suspect that the poller was always broken for me, but I hadn’t noticed because the push updates have been working.
I still didn’t know why this was failing, so I removed the exception catch and got this:
home-assistant | 2021-07-10 21:16:16 DEBUG (MainThread) [homeassistant.components.homekit_controller.connection] Starting HomeKit controller update: [clipped]
home-assistant | 2021-07-10 21:16:16 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
home-assistant | Traceback (most recent call last):
home-assistant | File "/usr/src/homeassistant/homeassistant/components/homekit_controller/connection.py", line 424, in async_update
home-assistant | new_values_dict = await self.get_characteristics(
home-assistant | File "/usr/src/homeassistant/homeassistant/components/homekit_controller/connection.py", line 466, in get_characteristics
home-assistant | return await self.pairing.get_characteristics(*args, **kwargs)
home-assistant | File "/usr/local/lib/python3.9/site-packages/aiohomekit/controller/ip/pairing.py", line 243, in get_characteristics
home-assistant | response = await self.connection.get_json(url)
home-assistant | File "/usr/local/lib/python3.9/site-packages/aiohomekit/controller/ip/connection.py", line 316, in get_json
home-assistant | response = await self.get(target)
home-assistant | File "/usr/local/lib/python3.9/site-packages/aiohomekit/controller/ip/connection.py", line 310, in get
home-assistant | return await self.request(
home-assistant | File "/usr/local/lib/python3.9/site-packages/aiohomekit/controller/ip/connection.py", line 464, in request
home-assistant | raise HttpErrorResponse(
home-assistant | aiohomekit.exceptions.HttpErrorResponse: Got HTTP error 422 for GET against /characteristics?id=3.10,7.10,33.10,34.10,35.10,36.10,37.10,38.10,39.10,40.10,41.10,42.10,43.10,44.10,45.10,46.10,47.10,48.10,49.10,50.10,51.10,52.10,53.10,54.10,55.10,6.10,6.11,12.10,12.11,31.10,31.11,16.10,16.11,25.10,25.11,27.10,27.11,28.10,28.11,29.10,29.11,2.10,7.14,7.15,7.16,7.19,16.14,16.15,16.16,25.14,25.15,25.16,27.14,27.15,27.16,28.14,28.15,28.16,29.14,29.15,29.16,33.14,33.15,33.16,34.14,34.15,34.16,34.19,34.22,34.25,35.14,35.15,35.16,36.14,36.15,36.16,37.14,37.15,37.16,38.14,38.15,38.16,39.14,39.15,39.16,40.14,40.15,40.16,41.14,41.15,41.16,42.14,42.15,42.16,43.14,43.15,43.16,44.14,44.15,44.16,44.19,44.22,44.25,45.14,45.15,45.16,45.19,45.22,45.25,46.14,46.15,46.16,46.19,46.22,46.25,47.14,47.15,47.16,47.19,47.22,47.25,48.14,48.15,48.16,49.14,49.15,49.16,49.19,49.22,49.25,50.14,50.15,50.16,50.19,50.22,50.25,51.14,51.15,51.16,51.19,51.22,51.25,52.14,52.15,52.16,52.19,52.22,52.25,53.14,53.15,53.16,53.19,53.22,53.25,54.14,54.15,54.16,54.19,54.22,54.25,55.14,55.15,55.16,55.19,55.22,55.25,2.10,34.19,44.19,45.19,46.19,47.19,49.19,50.19,51.19,52.19,53.19,54.19,55.19,4.10,5.10,8.10,9.10,10.10,11.10,13.10,14.10,15.10,17.10,18.10,19.10,20.10,21.10,22.10,23.10,24.10,26.10,30.10,32.10
I don’t know why this is happening. Homebridge does not print any errors at all, even in debug mode. HA does not print anything else either.
How can I figure out the exact reason behind this error and perhaps fix it?
Thanks!
-Alex