Openhab Docker homekit - HomeKit doesn't discover the openHAB bridge even after typing in the manual code

Hello, I followed the setup a new instance of openhab with docker (https://hub.docker.com/r/openhab/openhab). Impressively easy and all bindings (i.e. novelan, tesla, jablotron add-on etc) work right out the gate. The only exception is the HomeKit binding: simply said the HomeKit app does not see the openHAB bridge when I tap + in HomeKit (iOS 13). When I build a new (identical) instance with the same bindings + configuration on a RPI or Mac HomeKit discovers the new openHAB bridge immediately and I can add it with the associated nine items. I then wondered whether I have to map the port 9124 in docker (docker port 9124, localhost 9124 tcp) but that didn’t make it work either. Please advise as I am obviously fishing in the dark here…

Mapping the port should be necessary. So yea do it.

I just flew threw the HomeKit Doc and saw this

openHAB HomeKit hub shows up when I manually scan for devices, but Home app reports “can’t connect to device”
If you see this error in the Home app, and don’t see any log messages, it could be because your IP address in the networkInterface setting is misconfigured. The openHAB HomeKit hub is advertised via mDNS. If you register an IP address that isn’t reachable from your phone (such as localhost , 0.0.0.0 , 127.0.0.1 , etc.), then Home will be unable to reach openHAB.

Could this be it? Setting the networkInterface ?

Hi, thanks - the NetworkInterface is ok and I mapped the port 9124. But it doesn’t resolve the issue unfortunately. Does anyone know how to make bonjour/mdns work for a docker container with openhab?

@rlkoshak is pretty good with docker, maybe he has an Idea.
(Hope it’s okay if I just link you like that @rlkoshak)

That’s what the @ is for.

@ckishappy, unfortunately I don’t have a whole lot to offer. If you are mapping ports that probably means you are not using --net=host in your docker run command? If not than openHAB will be running on a totally separate subnetwork from your LAN and the broadcast packets it uses to discover those types of services only go across the local subnetwork.

If you are using --net=host than I think it’s supposed to work, though I don’t use any services like this that require the use of such broadcast packets so I couldn’t say for sure even if it supposed to work or not.

Networking and access to utilities (e.g. stuff that you might want to do with Exec binding) are the two big drawbacks with running in Docker.

1 Like

@rlkoshak @BrutalBirdie thanks for your guidance and clarifications. I didn’t get it to work out of the box with --net=host but that could be entirely because of my setup with Docker on the Mac server. Whilst I like the agility of docker in general, I leave it out for openhab w/homekit use case for the time being. Thanks!!

Brief update: when I run docker on a RPI4, the HomeKit binding works well when I use --net=host given the identical subnetwork. The documentation for openhab docker (https://hub.docker.com/r/openhab/openha) is straightforward.

1 Like

Hello
I have the same issue - homekit does not discover - and I fix the issue after reading https://community.home-assistant.io/t/containers-avoiding-privileged-and-host-network-as-much-as-possible/60792/6

basically : set enable-reflector=yes in /etc/avahi/avahi-daemon.conf.

and

  • network interface I set ‘openhab’ which is the name of my docker container
  • map the port 9124

But I’m still stuck because the pairing fails and I have no logs in the console. So I think I’m still missing something …

regards