home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
74k stars 31.05k forks source link

HomeKit Bridge loses pairing after a short time resulting in not responding devices with iOS 16.x #79304

Closed baze closed 2 years ago

baze commented 2 years ago

The problem

I'm running home assistant in docker on a raspberry pi with all devices coming in via zwavejs and bridge those devices into HomeKit. I have three roller shutters via zwave and nine light switches. That's all my devices in home assistant.

For a few days now I had the problem that all my devices bridged in HK via home assistant appear as not responding after some time and when I checked the home assistant web interface I found that it showed me the HomeKit pairing code. .storage/homekit.xyz.state shows no paired devices either but the devices are still shown in the Home app on iOS.

I then removed the bridge and added it again which fixed the problem but after at the most 1h it always returns: all devices not responding, HomeKit paring code shown, home assistant bridge still shown in Home app.

The devices are responding and working just fine from within home assistant!

I reproduced this with the latest build (2022.11 as well as 2022.9.7, 2022.9.6 and 2022.9.5 which is the latest stable at this point) always with the same results. Now I'm on 2022.8.7 which seems to keep the devices responding after an hour but home assistant shows me the HomeKit pairing code again.

What version of Home Assistant Core has the issue?

2022.9.7

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

HomeKit

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

I'm also running Homebridge on the raspberry pi which has no issues at the same time, so I believe the problem is not with HomeKit but with home assistant.

My HomeKit hubs are running tvOS 16.1 beta with the new Home architecture enabled.

homeassistant commented 2 years ago

Hey there @bdraco, mind taking a look at this issue as it has been labeled with an integration (homekit) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)


homekit documentation homekit source (message by IssueLinks)

montiville93 commented 2 years ago

I have this very similar issue. Ill add what I have found in case it helps.

After a power loss to HASS or network loss all devices from the HomeKit bridge from HASS show No Response.

“Accessory” devices seem to stay linked.

”Bridge” devices show NO Response and do not come back unless you setup a new bridge and pair. Which then have to setup new rooms again.

baze commented 2 years ago

4 hours later and while 2022.8.7 shows the HomeKit pairing code and the .state file says no paired clients it continues to work in HomeKit. So at least 2022.9.6 and upwards seem to have additional issues. I can try 2022.9.0 to .5 tomorrow.

raaaf commented 2 years ago

Same problem over here. I think it has to do with iOS 16 (and 16.1 Beta).

Very annoying stuff.

jdopson0624 commented 2 years ago

Having the same issue as well. Updated my phones and Apple TV's to 16.1 and now homekit is becoming "unpaired" from the bridge somehow.

ChadGnad commented 2 years ago

Having a similar issue, upgraded to iphone 14 and ios16, All accessories have gone no-response in bridge mode. When I reloaded a new bridges, it received the current state of the device; then went no response across the board.

EDIT: I have an Apple TV in the house, I disabled HomeKit from the settings menu, poof, Home came back online! EDIT2: The issue is with the Apple Hubs, ensure they are on the same network as your bridge, not just allowed to access with Firewall rules.

ChadGnad commented 2 years ago

Having the same issue as well. Updated my phones and Apple TV's to 16.1 and now homekit is becoming "unpaired" from the bridge somehow.

try disabling the homekit in the apple TV and see if it comes back

baze commented 2 years ago

It seems like the new tvOS 16.1 beta 4 has fixed some issues and might even fix this one: after updating yesterday not only could I restart and update my HA docker container without the devices resulting in 'no response' and lots of errors in the Home app about HomePods not being able to connect to the WIFI network are gone since them but also the Home Assistant web interface does not show the pairing code anymore.

This was an indicator for things going to break in the last weeks: even though the bridge was paired, the homekit.state file showed no paired clients (which it so far has kept after updating to tvOS 16.1 beta 4) but also the web interface showed the pairing code, which I guess is just the consequence of no clients being paired and the UI showing it accordingly.

Fingers crossed this is solved!

baze commented 2 years ago

So far no problems anymore. Even after updating the container and restarts, its stable. Fixed by tvOS 16.1 beta 4.

jdopson0624 commented 2 years ago

My bridges became unpaired again with tvOS 16.1 beta 4. They're still showing in the Home app, but all of the homekit*.state files show no paired_clients.

baze commented 2 years ago

Oh, that’s bad to hear, sorry :(

jdopson0624 commented 2 years ago

Just an update, everything continues to work even though my bridge still shows as unpaired. Also, all of the Homekit Bridges in accessory mode are showing as unpaired.

EDIT: After my automatic backup ran and the container restarted, getting "No Response" on all accessories again.

baze commented 2 years ago

After updating to 16.1 beta 5 I'm back to losing pairing again.

edit: and tomorrow they went back to not responding. Too bad, but also not fixed for me after all

ethank commented 2 years ago

Same issue, running IOS 16.1 betas on many of the devices (except the Apple TV's). It was working fine before.

bdraco commented 2 years ago

Someone mentioned they thought it was because of the unstable iid allocation, but it could be completely unrelated.

I spent a few weeks fixing that and finally have a working PR at https://github.com/home-assistant/core/pull/79913 but I'm waiting for a HAP-python update to make it happen.

ethank commented 2 years ago

One thing I did to increase stability (it seams) is remove dead devices, and repair my HomePod mini. Also I disabled a lot of the AppleTV's from actings as Hubs. I also made the iPad I use as a dashboard a HomeKit hub.