openHAB homekit add-on is not exposed on the network

Hi Nicolas
do you see openHAB in discovery app? not unter _openhab-sever._tcp?
if not, is it network issues - something block traffic between your mobile and openhab server.
if you see it, then it is an issue with homekit binding

Hi Eugen,

I can see openHAB under _openhab-server._tcp. and _openhab-server-ssl._tcp.

I think it must be a problem with the binding which I couldn‘t figure out yet.

ok. then it is binding.
if not tried yet, try to switch off “Use openHAB mDNS service” in homekit settings in main UI.
check also log files for any errors.

This is funny, because today it worked like 5 hours when I activated the mDNS service :smiley: . But when I came back home, every accessory showed „No response“ again. Poorly, I am facing a new problem with the binding. I am able to see openHAB via Discovery App and via Home app, but when I‘m trying to connect it as an accessory, the app responds „Home couldn‘t establish any connection to this accessory“. I get this problem on every iOS device in my household, so it must be a network or binding error.

I followed the steps shown in this topic: [SOLVED] HomeKit Integration - Pairing Problems (iOS 10 - iOS 14) - #86 by marco72 but didn‘t solve it. Any ideas?

I get the following log while pairing:

thank you!

if you see you can see openHAB in Discovery App, do see it under _hap._tcp or something else?

if you see _hap._tcp then the network should fine, i would try to disable homekit bridges (apple tv, homepod, ipad) and check whether it helps.
if you dont see _hap._tcp but you see _openhab-server._tcp then the network is ok, but homekit binding was deregistered from mDNS. try to change the switch for mDNS service in main UI.

another thing to check:

  • you dont use “Private Address” for your home network on your iOS devices
  • you dont use IPv6 on openhab server (can be check via discovery app for example)
  • the ip address of openHAB does not change (can be check via discovery app for example)

Hi all,

i faced similar issues. It works pretty well for hours and then it’s gone.
The item in the discovery app is then simply gone (_hap._tcp.) / openHab.

After restarting with

bundle:restart org.openhab.io.homekit

it’s working again.
I’ve set the log to trace but cannot see any entries.
Is this command correct?

log:set trace "org.openhab.io.homekit"

Best Regards
/Franz

Hi Franz

anything from this list?

  • openhab in docker container
  • usage of ipv6
  • network interruptions, e.g. openhab server get disconnected from network

Hi Eugen (@yfre) ,

thanks for supporting. Here is my situation.

  • openhab in docker container
    • Yes the openhab is running in a docker environment with docker-compose.
    • network_mode: host
  • usage of ipv6
    • No, this is even disabled in my router
  • network interruptions, e.g. openhab server get disconnected from network
    • Raspi is connected using Ethernet
    • Maybe if the internet connection is disconnected or the router is rebooting

The only thing that is weird is that it works again if I restart the service.

The Hue Bridge in the Network is working all time with HomeKit.

Thanks, BR and have a good Weekend
/Franz

Hi Franz,

the process is like this:

  • openhab homekit binding register itself in mDNS (multicast DNS) services. mDNS is distributed service, one instance is running on openHAB server, another one on Hue Bridge, etc.
  • home app on IOS search for _hap in mNDS if it starts. if it find something, it connects
  • for some not fully understood reason, homekit binding get re-registered / removed from mDNS. it looks like it happens in case on change on network interface, i.e. new ip address, re-connection
  • so, home app cannot find it anymore
  • if you restart openhab, homekit binding or just toggle the “use openHAB mDNS service” setting in homekit setting, the homekit binding register itself again

probably we could think about some kind of monitoring in homekit binding that automatically re-register in mdns if it cannot find itself there anymore. but currently such feature is not there.

please check your openhab logs for exceptions and errors, which happen before you lose homekit binding. something network related

Hi @yfre,

thanks for the quick reply.
I’ve turned on logging with

log:set trace "org.openhab.io.homekit"

I hope this is enough for a good debug log.
Let’s see what happens :slight_smile:

If I got more information I’ll let you know.

BR
/Franz

Hi Eugen,

I’m seeing both services in the discovery app (_hap._tcp and _openhab-server._tcp). When mDNS service is disabled, I cannot see openHAB in my home app, but when this service is activated, I can see it, but cannot connect to it. I get the same error message every time I try:

In english: Home couldn’t establish any connection to this accessory.

Any thoughts? I tried nearly everything…its so frustrating

Hi Nicolas,

good investigations. then it is very probably the homekit port that is blocked / not accessible form your ios device.

the default port is 9124. if you are using docker, make sure port is accessible from outside.

you can also try to change the port to something else via homekit settings. i would restart OH afterwards, just to be on the save side

Hi Eugen,

changing the port to 9123 didn‘t solve the problem, still got the same error message.
I tried connecting it with the QR code, didn‘t worked either, but I got a different error message then trying it with the PIN.

Now its saying the accessory is not compatible, though I set unauthenticated access true.

Is it possible there is a router problem?

router typically do not create any issue at that stage. if you can discover openHAB in home app then routing works.
either it is still an issue with port, e.g. maybe all ports are blocked except of 8080/80/22,
or you have some broken configuration. could you try first with very simple item like switch or lightning. without colour, brightness, etc.
you can add them later.

goddamn, thank you for your the solution. I didn‘t knew that the homekit configuration „color temperature“ is still causing this massive problems. Deleting this solved it, thank you!

fyi: color temperature was fixed in the version 3.2 of openhab binding, which was release few weeks ago

Hello Friends,
For a year now I’ve been using OpenHAB as a regular install (not openHABian) on Raspberry Pi 4, and I set it up successfully to work with the Homekit binding.

Today, I started using a new Intel based home server running UnRAID.
I installed OpenHAB as a docker app from the UnRAID community apps repository, and continued to manually recreate the previous OpenHAB setup I used on the Raspberry Pi 4.

I managed to properly recreate almost everything, except for the Homekit integration connection.
At the moment, when I scan the Homekit Binding’s QR code with the iOS Home app, OpenHAB is not found as a bridge.

Some info and questions:

  1. what should I choose for the OpenHAB docker app Network Type? (Bridge, Host, None, Custom?).

  2. I set these ports in the OpenHAB docker app: HTTP port: 8787. HTTPS Port: 7443. and I added a third port for Homekit: 9123.

  3. In the Homekit Integration binding settings, what IP should I enter for Network Interface? Should I enter the main IP of the UnRAID server? or the IP of the docker container?

  4. I installed the Discovery iOS app. When the docker app’s Network Type is set to Custom, the Discovery app doesn’t find _hap._tcp or _openhab-server._tcp service types.
    If I set Network Type to Host, the Discovery app finds _openhab-server-ssl._tcp. , _openhab-server._tcp. and _hap._tcp. , but _hap._tcp. has no IP info and just shows “scanning”.

  5. In the Homekit Integration binding settings I currently set Use openHAB mDNS service to false.

Can someone please help me fix the Homekit setup so that I can connect OpenHAB to the iOS Home app?

Hope someone can help.

you should use the IP address which is accessible from outside of the docker, i.e. main IP of the unRAID server. this is the IP home app will connect to.

i had the impression that “host” is the best network type.
but let continue discussion in

so that we can do docker troubleshooting in one place

1 Like

Hi @yfre ,
Thank you for your reply. I followed your advice and set the Network Type to Host and the Network Interface to the main IP of the UnRAID server.
Changing these settings didn’t help, and OpenHAB was still not found by the iOS Home app.
However, I then tried to enable Use openHAB mDNS and to my surprise, OpenHAB is now found by the iOS Home app.

I will write this also in the other thread you sent me. Hopefully, it might help @ThomyTP1 and other users searching this issue.

1 Like

It helped me. I had the same issue. Thank you random openHAB engineer. :slight_smile:

1 Like