openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.86k stars 3.58k forks source link

[homekit] "No response" error on all openHAB items #3522

Closed radokristof closed 5 years ago

radokristof commented 6 years ago

Dear Community and Developers!

I have been using the homekit addon now for months and I have a problem with it, which I found on the forum, most of us has this problem. Sometimes the whole Home becomes unavailable, all the items in the Home app shows "No response" message. I have tried to debug it, but I can't find any relevant info, openhab does not show any error or log message when this happens. Also it happens very randomly... Sometimes works for days, sometimes just for hours. The only solution is to restart openhab (but somehow it works after a while, no need to restart, but this can take hours).

Tell me how can I help to solve this bug!

Ways to reproduce the bug: Use the builtin HomeKit addon and enable on a device the Hub function.

Solution: It seems that the Hub feature causes this issue. Temporary fixes: Turn off the Hub Use the temporary workaround by @andrey-yantsen

Thanks!

Scorched81 commented 5 years ago

Same here, upgraded to 2.4.0 last weekend and havent had any problems except for a lot of "no route to host / Connection timed out" messages in the log. Now let's hope it stays this way ;)

radokristof commented 5 years ago

@Scorched81 If I'm right, that is not really an 'Error'. It would be better if this is treated as a warn by the binding (maybe this is a design bug), but that only shows that on of the HomeKit devices disconnected.

Julian0o commented 5 years ago

Have the same Problem. MY Homekit stops working when i change some configuration in OH. It disappears for a while (sometimes days) and then the items in Homekit are back but all items are in the Stanradroom and i have to assign them again.

EDIT: Working with OH 2.3 and have a iPad as Homekit Central. Will try to Update to 2.4.

radokristof commented 5 years ago

@Julian0o Try updating to 2.4.0 Milestone release. Since then, I don't have problems with HomeKit and HomeKitHub

radokristof commented 5 years ago

It has worked for about 2 weeks in a row, without an issue, but today I got again the No response error on 2.4 M4 However bundle:refresh helps and the room associations are stored

radokristof commented 5 years ago

Closing this now, since it seems that the problem is solved!

maslyankov commented 5 years ago

Still happening... đź‘Ž

marbon87 commented 5 years ago

Same here

Scorched81 commented 5 years ago

haven't had this problem since the early versions of 2.4. Have ran into other limits, where you can't use more than 25 accessoires per scene, but that seems Homekit related and not OpenHAB.

ccutrer commented 5 years ago

I found the problem! If you have a large number of accessories (I have nearly 150, and that's even after I pruned what I was publishing to HomeKit), HomeKit can send requests that have to be broken up into multiple encryption frames, and the HAP-Java library had a bug in it. Basically it would stop responding to the HomeKit connection, and it would take a while before that connection was dropped a nd a new one established. https://github.com/beowulfe/HAP-Java/pull/64 fixes that bug. I'm also looking into if there is a hard limit of 150 accessories per bridge in HomeKit. The official HAP specifications says a bridge shouldn't expose more than 100. I ran into problems last night at ~150 that I need to see if still happen with this first fix in place. If this is the case, I'll work on the HomeKit OpenHAB add-on to automatically publish multiple bridges if necessary.

ccutrer commented 5 years ago

yup, 150 is a hard limit. HomeKit refuses to connect to a bridge that has more than 150 accessories (counting the bridge device itself).

andylintner commented 5 years ago

Since the spec says 100 is the limit, we should probably enforce that in the library and throw an exception when you add the 101st as well.

maslyankov commented 5 years ago

I don’t have more than 150 devices/accessories, not now, not when I got the error. The reason was that the homekit configuration in openHAB didn’t have the ip config set.

On Feb 10, 2019, at 12:33 AM, Andy Lintner notifications@github.com wrote:

Since the spec says 100 is the limit, we should probably enforce that in this library and throw an exception when you add the 101st

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

ccutrer commented 5 years ago

@maslyankov : indeed, that is definitely a very common issue. The fix I'm referring to here is rarer, and requires having lots of accessories. But I've also looked into the "have to specify my IP" issue. Turns out HAP-Java doesn't necessarily advertise via Bonjour the same place it's going to listen for requests on. I've also attempted to address that issue with https://github.com/ccutrer/HAP-Java/commit/c8a4c399cfbbf3bc12e08a2774d9aa97ca607536, which seems to be working well on my development machine (a Mac, with like 10 network interfaces of various sorts, where it happened to be binding to a hybrid ipv4/ipv6 address), but I'm not confident enough in it yet to send it upstream.

@beowulfe : probably a good idea. but not until we can have a solution for the OpenHAB HomeKit add-on to allow multiple bridges, otherwise I'll be broken! (I'm at 131 at the moment). I'm still trying to decide if it would be better to have the user specify via config how many bridge instances they want to publish, and then assign accessories via hashing, or try and keep track of which items end up on which bridge, automatically adding bridges as you hit the limit. They both have usability problems. But I'm thinking accessories "jumping" among bridges (and having to reconfigure them in HomeKit - favorite, room, status, etc.) is worth then having to occasionally go pair another bridge.

andylintner commented 5 years ago

I think I'd favor not doing it automatically at all - that will just be confusing. We could use the metadata attributes to allow the user to specify a bridge number.

It does add configuration overhead, but a user with more than 100 accessories is likely a power user.

ccutrer commented 5 years ago

but a user with more than 100 accessories is likely a power user.

Well, I wasn't a month ago, but I guess I am now... (My HomeKit from OpenHAB has fans, lights, smoke detectors, CO detectors, leak sensors, motion sensors, shades, all properly exposed...)

But yeah, I guess this is a good idea. It would allow me to logically group my bridges - a shades bridge, an alarm items bridge, etc.

aihysp commented 5 years ago

I did not have the error for a long time!!!

but about one month ago my Ipad Hub stooped working, both my wife iPhone and my iPhone and my apple watch are all working but my hub stooped

aaronk6 commented 5 years ago

Hi, I have this issue again after it has been working great for a long time. I think it broke after rebooting my server. I didn’t update openHAB though. I’m on 2.5.0.M1 and it has been working fine for weeks.

I tried:

bundle:refresh org.openhab.io.homekit

I see in the log that it refreshes all accessories, but even after minutes, the accessories are still marked with “No Response” in the Home app.

I had the networkInterface set to the machine’s DNS name, which I suspected could be the problem. However, it’s also not working when a use the machine’s IPv4 address.

I only have 26 devices, so I’m definitely not running into the limit @ccutrer and @beowulfe mentioned.

Any idea what I can do?

EDIT: I also tried setting -Djava.net.preferIPv4Stack=true which was recommended in https://www.openhab.org/addons/integrations/homekit/ to solve connectivity issues. However, this didn’t help either.

EDIT 2: I checked with Bonjour Browser. When using the DNS name as networkInterface, I see the service it advertised with both IPv4 and IPv6—screenshot below. I can connect to 9123 via telnet on both IPv4 and IPv6 and see the connection attempts in the openHAB log. When using the IPv4 for networkInterface, it only advertises IPv4. In both cases, I don’t get a response in the Home app.

screen shot 2019-03-04 at 20 51 58

ccutrer commented 5 years ago

the limit I mentioned is an absolute hard limit. if you have over 150 accessories (including the bridge itself), the home app will refuse to connect to the bridge at all (and the one time I did it with a bridge I was already associated with, it removed all my accessories from the home app, not just show them as Not Responding). 26 accessories may be few enough to hit the packetization problem. I really just depends on how the packets got chopped up over the network. I would highly recommend running the version of HomeKit from either https://github.com/hap-java/openhab2-addons/releases/tag/v2.4.0-homekit-6 or https://github.com/ccutrer/openhab2-addons/releases/tag/2.5.0-cody2 until we can get all of our fixes merged into openhab proper.

aaronk6 commented 5 years ago

I’m now using your release from https://github.com/ccutrer/openhab2-addons/releases/tag/2.5.0-cody2. It solved the issue! Thanks so much!

malfurion commented 5 years ago

Hi, I’m having the same issue after updating my openhabian.

my openHAB was on version 2.0 or 2.1 before and now I’m on 2.4

HomeKit is working for some days and after some time it’s saying no response Until waiting some time it fixes itself

I have only 15 items so would not be a problem with the maximum

Is there a other known reason why this could happen?

kandersen01 commented 4 years ago

Why is this issue marked as closed, when its not solved?

abbe79 commented 4 years ago

Same problem here - openHAB 2.5 Please reopen this issue.

elads commented 4 years ago

Hello, I too am still having the issue described here. Now it seems on an almost daily basis.

openHAB 2.5.1-2 (Release Build) - 20 items shared from OpenHAB to HomeKit Connect with (2) iPhones running iOS 13.3, and (1) iPad running iOS 12.2 No Homekit Hub in my system

To those working on this problem, what is the current understanding of the issue? I would be willing to try the forked versions of the .jar above, but:

  1. I am not sure if they are now older than the current build
  2. cannot figure out how to install them (I am a mere tinker)

Thank you to those who are developing this great platform and this Add-On which brings so may opportunities.

appreciate any help that can be lent.

mcjimbob commented 4 years ago

I have the same problem. It’s great when I works (When seems to involve clearPairings, restart and re-adding the hub from HomeKit), after a while (a couple of hours usually) all devices go back to “No Response”

Updated to 2.5.4 last night but no change.

Only have 9 items shared from OpenHAB. Apple kit we have is three Apple TV’s (2 of which were recent additions), two iPhones and 2 iPads.

I’ve recently added homebridge but these issues pre-date that addition.

frank-f commented 4 years ago

I seem to have the same issue. It's been happening since 2.4.0 on and off. I've been successfully using one of the forked libs for quite a while (months, if I recall correctly), but had to upgrade, when iOS 13 came out.

kdub454 commented 4 years ago

Fwiw, I had this issue as well - I was able to resolve it by toggling the HomeKit settings on my Apple TV on and off. My issues appeared to be mostly remote-access based.

frank-f commented 4 years ago

Fwiw, I had this issue as well - I was able to resolve it by toggling the HomeKit settings on my Apple TV on and off. My issues appeared to be mostly remote-access based.

I have two HomePods in my setup. I can try to remove those later, but that can't be my solution. I want those to be in the setup to be able to use voice commands. This used to work for months, too - it just got worse and worse again with the recent updates of both, openHAB and iOS.

3dr14n commented 4 years ago

I’m now using your release from https://github.com/ccutrer/openhab2-addons/releases/tag/2.5.0-cody2. It solved the issue! Thanks so much!

the limit I mentioned is an absolute hard limit. if you have over 150 accessories (including the bridge itself), the home app will refuse to connect to the bridge at all (and the one time I did it with a bridge I was already associated with, it removed all my accessories from the home app, not just show them as Not Responding). 26 accessories may be few enough to hit the packetization problem. I really just depends on how the packets got chopped up over the network. I would highly recommend running the version of HomeKit from either https://github.com/hap-java/openhab2-addons/releases/tag/v2.4.0-homekit-6 or https://github.com/ccutrer/openhab2-addons/releases/tag/2.5.0-cody2 until we can get all of our fixes merged into openhab proper.

This made me move forward from Homekit addon problems after a fresh installation of openHabian. It actually made me pair my iPad Air (iOS 12.4.7) to Openhab. The latest Homekit addon version 2.5.7 snapshot only allows the initialization of Homekit in openHab, pairing was never successful because of Terminated HomeKit connection from /192.168.10.143:49167 which was the iPad during paring.

vlas commented 3 years ago

OH latest stable v3 — same issue. My setup with about 20-30 items suddenly just stopped working with the same problem: no response from all accessories... im not using hubs i.e. apple tv etc, iphones are connected directly to OH...

openhab-bot commented 3 years ago

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/homekit-no-response-error-on-all-openhab-items/118200/1

arins commented 1 year ago

I had the same issue but after disabling ipv6 which I read in the forum it worked for me. I followed this guide to disable ipv6 https://techdocs.broadcom.com/us/en/ca-enterprise-software/it-operations-management/network-flow-analysis/21-2/installing/system-recommendations-and-requirements/linux-servers/disable-ipv6-networking-on-linux-servers.html