Closed digitaldan closed 5 years ago
Will have a look
The root cause is outside of openHAB in the HAP-java library. It requests a subscription with a null callback. I‘ll check how to catch that as early as possible, but it has to be fixed somewhere else.
I was wondering if the problem is related to something like how we unregister items and possibly are not removing the callback properly , so its null next time a state is published on the item. But i don't know the code very well, so was kinda a wild guess.
Good point. There is at least another flaw (not sure if that is the real problem. When we unset the bridge, we do not remove the accessories from that bridge. Maybe that is, why unsubscribe is not called and an old subscription stays in place. Anyway, I have seen subscribe-requests with a null-callback, that seems to be wrong.
I have prepared a fix, would you like to try it? The new .jar is here.
You can update your installation with bundle:update <number> https://janessa.me/esh/org.openhab.io.homekit-fix-npe.jar
and probably restarting that bundle.
Please open a different issue for that, it is not related. Include your item-configuration and if possible the version it worked with before. Thanks
Current Behavior
After enabling the homekit binding, initially it works. After some amount of time, this could be 10 mins or even an hour, the homekit functionality ceases to work ( Home apps show devices are "not responding" ). Aditionally i see this message in my logs , hundreds of times:
This has also been reported on the community forums as well. https://community.openhab.org/t/homekit-the-unsetitemregistry-method-has-thrown-an-exception/70942/5?u=digitaldan
Possible Solution
I am guessing that the callback here https://github.com/openhab/openhab2-addons/blob/4ff0808f1859038ff88d9b39a9819f8018866ff4/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitAccessoryUpdater.java#L55 is null, and i could submit a patch that checks for that, but my guess is that would not be solving the core issue of why its null.
Steps to Reproduce (for Bugs)
Context
Your Environment
Version used: (e.g., openhab and addon versions) openHAB nightly build May 19th (2.5.0.201905191816)
Environment name and version (e.g. Chrome 39, node.js 5.4, Java 8, ...): openjdk version "1.8.0_152" OpenJDK Runtime Environment (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 1.8.0_152-b76) OpenJDK Client VM (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 25.152-b76, mixed mode, Evaluation)
Operating System and version (desktop or mobile, Windows 10, Raspbian Jessie, ...): Debian Jessie, asus tinkerboard