core: Homekit problems with unresponsive device state updates
Home Assistant release with the issue:
0.83.x
Last working Home Assistant release (if known):
0.81.6
Operating environment (Hass.io/Docker/Windows/etc.):
Hassio
Component/platform:
https://www.home-assistant.io/components/homekit/
Description of problem:
After updating from version 81.6 to 83, when HA is running for a couple of hours (sometime minutes), all state changes from the HA UI or other device using the Home App, does not update the device change in real time to other iOS devices. For example: I have an iPad Mini fixed on the wall, If I turn of a light on my computer, this entity state does not mirror the change on the iPad Home app. I have to close the app, reconnect to the server then the state will change.
Related issue: https://github.com/home-assistant/home-assistant/issues/15675
Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):
homekit:
auto_start: False
filter:
exclude_domains:
- automation
- input_boolean
- remote
- script
- binary_sensor
- device_tracker
- fan
- media_player
- sensor
- alarm_control_panel
- climate
- cover
- light
- lock
- switch
include_entities:
- input_boolean.boa_noite
- input_boolean.bom_dia
- input_boolean.chegar_casa
- input_boolean.visita_casa
- input_boolean.entrar_muvrh
- input_boolean.sair_muvrh
- input_boolean.muvrh_desligar_tudo
- input_boolean.cafe_manha
- input_boolean.chaleira_manha
- device_tracker.antonio
- device_tracker.roberta
- binary_sensor.casa_movimento
- binary_sensor.muvrh_movimento
- binary_sensor.door_window_sensor_158d0001b8671f
- binary_sensor.door_window_sensor_158d0001bf2a09
- binary_sensor.entrada_casa
- binary_sensor.box_banheiro_suite
Traceback (if applicable):
NONE
Additional information: I believe this problem is related to the HAP-python code that was updated to version 2.4.1 on v83, issue addressed here: https://github.com/ikalchev/HAP-python/issues/176
No errors are show on log, very strange, it is like the connection from the server gets dropped.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 60 (6 by maintainers)
Hi, @cdce8p , I am experiencing the same issue where notifications are not coming through via the Home App of iOS HomeKit. If I close the app and open it again, it refreshes to the correct states. If I restart Home Assistant, the issue fixes itself for a brief period of time, and then it’s back to square one. 😦 Currently using an Apple TV 4 as a hub.
@tatunts , thanks for raising this issue. I first thought it was my setup, and tried almost everything to try and resolve this to no avail.
Hello devs! This problem was solved with the release of version 2.4.2. https://github.com/ikalchev/HAP-python/releases/tag/v2.4.2
Hope this gets included on release 85 😃 https://github.com/home-assistant/home-assistant/pull/19776
Thanks!
Thanks @tatunts for linking to the fix - I was having this issue after moving from homebridge to native HA HomeKit support (& updating from 0.5x). Replacing hap_server.py worked. Running 0.84.6
For those who are trying to find hap_server.py - mine was in /usr/local/lib/python3.6/site-packages/pyhap/hap_server.py on docker. Just trying the change now.
@jr3us : I’ve updated the kernel/firmware using rpi-update about an hour ago to test whether this would affect my setup. The good news is that the “fix” is still working well… all notifications coming through. I suggest you test with a fresh hassbian image.
@cdce8p : Thanks for your help once again!
@tatunts : Replacing the file is working well so far (even with updating the firmware)! Thanks!
Hello @wasp100! Please try this fix here: https://github.com/ikalchev/HAP-python/issues/176
It worked for me, everything works beautifully for almost a day now.
Hello @WhiteDogBe.
I believe most of the times that this problem happens is when I go out and return home, just like you said. Sometimes it works for ours when I am home and sometimes it does not, very strange.
Maybe the problem is related after all to the HAP-python code. The creator of the code used here is already trying to debug this problem: https://github.com/ikalchev/HAP-python/issues/176
What incredible people here… I really appreciate all effort and time spend here to help us mortals.
Thanks a lot!
@tatunts I haven’t seen the issue before. I don’t think that these are related to HAP-python, because it still uses sync networking and not uvloop for it (although not being fully async might be the root of the problems).
As for the notification issue, I was wondering if part of the issue is some kind of energy saving measure from iOS to limit communications with accessories.
Do you guys have either:
HomeHub?For info, I still have the issue but no longer the SSL errors. Those I think I fixed by tinkering a bit with httpd zs shown below (adding trusted_proxies etc.). So don’t assume it’s related.