HomeKit Integration - Pairing Problems

Hey,

I use the latest stable version of openHAB but I can’t pair it with HomeKit. I have an iPhone XS and an iPad with the latest iOS version. I deleted the binding and Json dB ( inclusive backup). I get the message with the new ,ac address but my phone can’t find the openHAB. I go into home app and type the code but after a few minutes my phone nothing found. What can I do?

if you dont see openhab in the home app then it is typically an issue with infrastructure. something like - different sub networks, firewall blocking required ports, router blocking multicast.

Homekit uses protocols multicast DNS (mDNS) and bonjour to advertise bridges, i.e. in our case make OpenHAB visible to home app.

so, please make sure

  • port 5353 is not blocked by firewalls
  • if home app and openhab are in different subnetwork, make sure multicast does not get blocked by router. e.g. my Unifi router has a special setting called " Enable MulticastDNS Service"

hi all, i’m also trying to make homekit work!
Now i can just see the bridge on the iPhone, it ask me for the code, but the after a while is saying it can not connect and can’t add openhab bridge.

I installed homekit from paper ui, misc-homekit - 2.5.3

I read a lot of discussions, but up to now doesn’t work.

My ios is 13.5

i would be grateful for any suggestion!

thank you!

Hi Filippo,

do you have any items tagged for homekit? if there are no items tagged you cannot add openhab bridge.

any chance to upgrade to more recent openhab homekit integration. 2.5.3 is pretty old.

hi Eugen,

yes, i’ve one, just for test!

This is my item file:

Switch iDQ0 “DQ0” [“Switchable”] { channel=“modbus:data:ModbusServer:DQLogo:DQ0:switch” }

Could you tell me which binding version should i use and where to find it?

thank you!

Hi Filippo
your config looks good. you should get one switch in home app.
please upgrade the binding. the older version had issue with newer iOS.

Hi Eugen,

i checked version and seem to be upadted, it’s 2.5.8
I installed from PaperUI.
Stil the same behaviour, from Home app i can see the bridge but then no accessory are added.

No ideas why…

could you suggest me somethong else?

Thank you!

Hi Filippo,

ok. this is already very good. what you get if you execute following in the karaf console

homekit list

this will list all known homekit accessories in openhab.
if you dont get the one you are expecting (iDQ0), then it is an issue with configuration.
if you get the accessories you have configured, then it is something else. e.g. missing state information for that item.

Hi! accessories are visible in the list:
Capture

states should be ok because from basic ui i can send command and get states.

i cleared pairings and allowe unauthenticated pairings!

thank you

does it work now ? with unauthenticated pairings?

Unfortunately no…Always the same, my phone can see the bridge but no accessory are added!

hm. ok.
please try following
1.set allowUnauthenticated to false
2. enable additional logging in karaf with
log:set TRACE io.github.hapjava
3. check in Paper UI > Configuration > Services > Homekit that you have network interface specified (IP address of openHAB) and check the PIN
4. add new home in home app on the iphone, add accessory, select openhab and enter the PIN if it asks for it.
5. if you still dont get accessory, please check the log file for something like
“/accessories …” and paste few lines before it and after it here.

still not working…
This is my log:
[INFO ] [mekit.internal.HomekitChangeListener] - Created 5 HomeKit items.
[TRACE] [thub.hapjava.server.impl.HomekitRoot] - Added accessory java.util.concurrent.CompletableFuture@423a0111[Completed normally]
[TRACE] [thub.hapjava.server.impl.HomekitRoot] - Added accessory java.util.concurrent.CompletableFuture@5d7fa0a4[Completed normally]
[TRACE] [thub.hapjava.server.impl.HomekitRoot] - Added accessory java.util.concurrent.CompletableFuture@729c03ce[Completed normally]
[TRACE] [thub.hapjava.server.impl.HomekitRoot] - Added accessory java.util.concurrent.CompletableFuture@4091f47[Completed normally]
[TRACE] [thub.hapjava.server.impl.HomekitRoot] - Added accessory java.util.concurrent.CompletableFuture@1629b45e[Completed normally]
[TRACE] [thub.hapjava.server.impl.HomekitRoot] - Added accessory java.util.concurrent.CompletableFuture@36f35cbf[Completed normally]
[TRACE] [pl.http.impl.NettyHomekitHttpService] - Bound homekit listener to /192.168.1.61:9124
[TRACE] [er.impl.jmdns.JmdnsHomekitAdvertiser] - Advertising accessory openHAB
[INFO ] [er.impl.jmdns.JmdnsHomekitAdvertiser] - Registering _hap._tcp.local. on port 9124

Ip of the ethernet card is specified, Code is ok…
Is strange because when i try to add objects the bridge is not always discovered, and also in this case no accessory added…

Are there any chance to make it work??

Thank you for your support!

Another different behaviour, sfter restarting the service it works for a couple of minutes. If i made the pairing during this time accessories are found and works for a couple of minutes.
After that everything goes offline and the only way is restart the service.
Again 2 minutes working and then stoppes.

I can’t understand what’s wrong.

Full log file attached.

openhab.log (298.8 KB)

Thank’s a lot for your help!

the only error in the log is complain that it cannot start homekit binding as homekit binding is already running.
can we check one thing

  1. go to karaf
  2. check with command list that you have only one homekit binding running.
    e.g. following command should return only one result.
    list | grep Homekit

another strange thing - it keeps adding and removing accessory all the time. this process is trigged by changes in the items configuration. almost every minute openHAB tells homekit to re-create all accessory as they all were changed. strange. not sure how that could happen.
but let first exclude the error due multiple homekit bindings.

It seem only one!

ok. this is good. one potential root cause excluded.

but i have no ideas, what actual root cause could be. the log looks really strange.
i would try the standard solutions - reinstall homekit binding, restart openhab, etc.
i will take a look on openHAB code later to understand what could trigger “add item/remove item” events.

Thank You! shall be done via paper ui or someother way?

PaperUI is fine.
alternative from karaf with “uninstall <binding_id>” and install "

Hello,

I’ve also tried to integrate Homekit with OpenHab… unfortunetely with the same result. I’ve tried all the solutions explained without success.
My configuration :

  • Raspberry Ppi 3 B+
  • Openhab 2.5.9
  • iOS 14.2

Logs :

2020-12-08 22:13:46.983 [TRACE] [a.server.impl.pairing.PairingManager] - Starting pair for openHAB
2020-12-08 22:13:47.501 [TRACE] [er.impl.http.HomekitClientConnection] - 200 /pair-setup
2020-12-08 22:13:47.506 [TRACE] [server.impl.http.impl.LoggingHandler] - WRITE PooledUnsafeDirectByteBuf(ridx: 0, widx: 512, cap: 512) [/192.168.68.101:50259]:
485454502F312E3120323030204F4B0D0A436F6E74656E742D747970653A206170706C69636174696F6E2F70616972696E672B746C76380D0A436F6E74656E742D4C656E6774683A203430380D0A436F6E6E656374696F6E3A206B6565702D616C6976650D0A0D0A060102020F192277A5E974706EE2B7FE35534CB403FFC1AFBC0252F3295F11DC7F9E85687F1A1C059466A28051C3CD4B45FC3719FFFFA536960373F26BD0989491D2A8EED56EE35D099B3D94B6AEDB3D59859BDCDCFB76D14071028E7C86AED29C11077BF66020290392C42BA8B6EC5E3BDF29003006BAD64F1C3841C082A7C4453E75FC6688114BD56B026D2BFA360D4D5323EB57893D07017C25FAE8E3D991201106E588AD44034BF38BDD6B2D08B43A51474D04A249D7597E71E08BCC57B533C4943A43440839D55A9222DE70FD693261B1F2DC67C8698A9308E66EC1111439D18AA2FC6F3772511C90AE7115E2B59473A65AA2697F6581B2AE10ABFCC0741A06516D91897DE03BCD68B499AF350DED6DE0264A03819AFE2E809958658DE11A2F5B7E6CF0B0E6ED8B37CB4AA123A2F2CFD5F56CB71B0016BD1798A09E59E597726E98E3A015FEB2756E5F029D5694FB69A18C6E185A639240EEF2206A49AB15C23EAF5F25A105C635A6D843BBD1CCF2B691A9B4CF15DD4F830B93EC473D4882AB9CD23F32310E20F04C95AC5F1DBAFC1A605545C437EA

2020-12-08 22:13:47.570 [TRACE] [rver.impl.http.impl.AccessoryHandler] - Terminated HomeKit connection from /192.168.68.101:50259

Did you find solutions in the meantime ?

Thx