Homekit: No reaction of devices (have to restart OH)

Hi!

I’m using OpenHab as Docker (in host network witout brideging) in Version 3.3.0 - Release Build.

Sometimes the Homekit Items on my iPhone do not react any more. Then I have to restarte the OH container. How can I prevent this?

Regards, Christoph

Hi Christoph,

how often is happens, e.g. every day, every week?
next time you get the issue, dont restart openhab but try to change this setting in homekit setting in the UI

often it helps instead of the restart and maybe the different setting will also fix issue

I’m not sure. Happens sporadic. I will try to test the suggestion with the mDNS.
But even if the Homekit app says it’s not reachable, it happens that I can use the control and the whings work…
Seems that the errors in between and the Homekit state is remebered, but it’s working.
But as said there are also cases were it completely stops working. How can we debug that?
Thanks for the help!

Christoph

UPDATE:
I right now had the situation the app stopped working after I closed the app (hardly) on iOS and restated it. As I reopened it, I had no response from everything. Changing the mDNS slider and leaving the App open did not change anything immediately in the app. Also a second closing and reopening of the app changed the state.
I restarted the docker container. But since now it stopped working completely and is unusable. Maybe it needs some time to work again?

But there seems to be a bigger (may networking oder service) issue…

UPDATE 2:
I followed this link: HomeKit Add-on - System Integrations | openHAB
opened the console and tried:

openhab> log:set TRACE org.openhab.io.homekit.internal
openhab> log:tail org.openhab.io.homekit.internal

But I don’t see any messages when I e.g. reopen the iOS App… Indeed there are’t any messages at all…

I faced similar problem with Homekit (Openhab in a container running on a Synology). I tried the trick suggested by @yfre. It worked fine. Just an additional question: does this switch can be deactivated/activated within a rule ? The idea is to do it every 2-3 days to keep homekit accessories alive.

Hmm. I’m completely lock out now. What can I do to get it back running? Restart doesn’t help any more.

How to debug that?

first of all, dont delete anything from home app or execute clearPairing. re-pairing is the last option if nothing else helps.

there are 2 reasons it could stop working:

  1. mDNS is not working. mDNS tells home app that openHAB exists and which IP address and port it has
  2. home app cannot access openhab on the IP address and port from mDNS

so, first check - mDNS.

please install Disovery app ‎Discovery - DNS-SD Browser on the Mac App Store or similar on your iphone. If you start it, you should see the mDNS entry for openHAB under _hap._tcp

check the ip address and port.

that should be the IP exposed to outside of docker, i.e. accessible from iphone

if mDNS has not entry for openHAB then something block multicast. could be docker or your router if iphone and docker are in different networks.
if mDNS has wrong IP address, please add correct IP in homekit configuration in openHAB UI.

Hey yfre!

Thank you for the fast help! :smiling_face_with_three_hearts:

Ok. I didn’t do that… Only restarting the container and switch on/off mDNS was done.

This is what the Discovery App finds:

I have installed a ping app on my iPhone. I’ve tried to ping “DiskStation-fritz-box.local”. But that was not possible. The iPhone is in the 5 GHz WLAN. My Desktop PC is connected over Ethernet. My PC is able to ping “DiskStation-fritz-box.local”.

The Docker Container is running in the host network. So no NAT…

Maybe that is the problem?

Christoph

ok. it is good that you see openhab. so, mDNS is working.

then it is

  • homekit binding. e.g. it is not running. so, please check in karaf console with “list” that homekit is running
  • or something with connection, e.g. wrong IP, port, docker network settings are wrong.
    try to connect with putty, telnet or something to it, maybe there even an app to test a connection on specific port.
    e.g. here is the putty test on my PC
    image

you dont get any response but it should connect

important - ping does not tell much. it is often blocked.

another approach - you have mentioned it was working before, not perfect, but it was working. what have you changed? anything related to network, ip address? any upgrades?

I get this entry, when I type list:

309 │ Active │  80 │ 3.3.0                  │ openHAB Add-ons :: Bundles :: IO :: Homekit

I tried that from a Telnet client on my iPhone (with DiskStation-fritz-box.local as hostname) and it connects…

No nothing. The only thing after it worked was what I did: hardly close the Homekit iOS App an reopen it when it was telling me that the devices are not reachable (may that happened over night or something)…

ok. im getting out of ideas
so.

  • mDNS is working and IP is correct
  • you can connect per telnet from iPhone to that Ip address and port. => network is ok and binding is running and accepting requests
  • version 3.3 => the bug with lost pairing is fixed
  • you dont see any message in the log files, means, binding does not receive any request from home app

hard restart of the app should not create any issues, i do all all the time

maybe last 2 things to try

  • if you have apple tv or homepod or ipad - disable homekit bridge there
  • restart iphone

and as the last options - re-paring: delete openhab as bridge from home app, execute “homekit clearParings” in karaf and pair again with scanning of QR code with home app.
but this will delete all your settings in home app, e.g. rooms assignments, icons of accessories, changed names. so, do it only if nothing else helped.

Hmm. I don’t know if it’s 100% correlated, but as I removed power from my HomePod mini, and as I closed and started the Homekit app it startet working :face_with_peeking_eye:

I will try if that somehow corresponds.

1 Like

It now stopped working again. I did not change anything. Docker container is running since days without interruption. For testing I disconnected the homepod. But it was not turning working. Then I looked into the discovery app and notices that _hap._tcp did not find anything.

I then changed the slider in the Homekit Settings (use OpenHAB mDNS service) from “off” to “on”.
No it is working again.

So OpenHAB mDNS service = OFF seems to be ONE problem…

Christoph

I now had it 2 times that it stopped working. First time I switched use OpenHAB mDNS service = from “off” to “on” and then it ran again.

THe second time I switched it from “on” to “off”.

Should I write an automation that toggles the switch every night? :face_with_peeking_eye:

Somehow the mDNS service (anyone) stops working after some time…

I think this is a bug isn’t it?

yes, it looks like a bug. could you please check next time whether you see “_openhab-server._tcp” in the discovery app.
so, mDNS is used by homekit binding but also by openHAB itself.
if only “_hap._tcp” disappears then it is a bug in openHAB binding. probably something related to short network interruptions.
if both, “_hap._tcp” and “_openhab-server._tcp” disappear, then it is probably a bug in the mDNS library homekit and openHAB are using

Today happened again. “_hap._tcp” was not reachable.

For “_openhab-server._tcp”, there is an entry “openhab” and an entry “openhab (2)”. Seems they differ in IPv4 und IPv6.

But after switching on mDNS on & off it did not work either. I had to restart the OpenHab docker, and now all my renamings were resettet in the Home App :face_with_peeking_eye:

Seems that the system is not stable at the Moment…

And the WAF decreasing rapidly :expressionless:

have you lost the renaming just after the restart of openhab? i assume, you have lost also assignment to the rooms, right? have you done anything else besides of openhab restart, e.g. changing some items configuration or maybe clearPairing in karaf console?

there is a fix/enhancement in preparation which should solve the issues with lost renaming and room assignment, not sure whether it will made it into next openhab releases.

regarding issue with mDNS, to me it looks like an issue with IP addresses, which maybe changing.
please compare following IP addresses

  • configured in homekit settings
  • IP addresses you saw/see in _openhab-server._tcp entries
  • IP address you see in “_hap._tcp”
  • IP address you use to access openHAB main UI

we had multiple reports here in community forum about similar issues with docker containers and homekit, sometimes deactivation of ipv6 solved the issue.

Yes!

Yes…

192.168.178.33 (the IPv4 IP of my NAS)

openhab._openhab-server._tcp.local.

fd37-8d44-a925-4fe1-211-32ff-fe93-e802-ovs_eth3.local:8080
fd37:8d44:a925:4fe1:211:32ff:fe93:e802:8080

uri = /rest

openhab (2)._openhab-server._tcp.local.

DiskStation-fritz-box.local:8080
192.168.178.33:8080

uri = /rest

http://diskstation:8080

The hostname in my router is set to “diskstation” and the IP is set to be always the same for this host…

I deactivated IPv6 for testing.

1 Like

Is there a way to backup that?

there is app called “controller for homekit” that can make backup and restore of home app settings.

1 Like