Pairing issues with Homekit Addon on openHAB 3.0.0

Hi everyone!

I’ve run into pairing issues with Homekit after re-installing openHABian to upgrade to version 3.
This is my setup:

  • Raspberry Pi 3B running openHABian (64 bit)
  • openHAB version 3.0.0 - Release Build
  • HomeKit integration version 3.0.0
  • iPhone 6 on iOS 12.4.9 / iPhone 12 mini on iOS 14.3

After installing openHABian, I added all my devices (mostly Homematic Wired) using the web UI. I also added HomeKit tags to some of them, also in the web UI. I was able to pair openHAB and Homekit exactly once on my iPhone 6. I don’t remember why, but I had to reset my home in the Home app and I could not pair the devices again.

I tried restarting openHABian, clearing the HomeKit pairings in the console, removing all homekit.json files (including backups) removing most of the devices and even reinstalling the HomeKit binding, without any success. After clearing the pairings the openHAB bridge showed up in the Home app, but connecting to it failed every time.

Next I tried pairing with the iPhone 12 (which is linked to a different iCloud account). Surprisingly this worked just fine. I had only added HomeKit metadata to one of my devices, so after pairing worked, I went ahead and added the metadata to all the other devices, too. Since these devices were not automatically added to the Home app on my phone (apparently a bug in version 3.0.0 of the integration) I restarted HomeKit (without clearing the pairings or deleting any files!).

After the reboot there was an error message in the openhab logfile saying that all iOS devices must be re-added (the same message you get after deleting the homekit.json files. Note that I did not delete these files). I was not able to pair any of the phones after that. On the iPhone 12 the error message is that the bridge is not compatible. Changing the PIN in the binding settings made no difference as far as I can tell. So basically pairing works just fine, but only exactly once per iOS device.

Here are some of the error messages I got and the openHAB logs:

openHAB konnte nicht hinzugefügt werden: Home konnte keine Verbindung zu diesem Gerät herstellen” (“openHAB could not be added: Home could not connect to this device”) (iPhone 6, PIN 031-45-158)

2021-01-24 14:59:26.097 [TRACE] [rver.impl.http.impl.AccessoryHandler] - New HomeKit connection     from /192.168.178.xx:49208
2021-01-24 14:59:26.265 [TRACE] [server.impl.http.impl.LoggingHandler] - READ PooledUnsafeDirectByteBuf(ridx: 0, widx: 125, cap: 1024) [/192.168.178.xx:49208]:
<long hex string>

2021-01-24 14:59:26.454 [TRACE] [a.server.impl.pairing.PairingManager] - Starting pair for openHAB
2021-01-24 14:59:27.662 [TRACE] [er.impl.http.HomekitClientConnection] - 200 /pair-setup
2021-01-24 14:59:27.726 [TRACE] [server.impl.http.impl.LoggingHandler] - WRITE PooledUnsafeDirectByteBuf(ridx: 0, widx: 513, cap: 1024) [/192.168.178.xx:49208]:
<long hex string>

2021-01-24 14:59:27.987 [TRACE] [server.impl.http.impl.LoggingHandler] - READ PooledUnsafeDirectByteBuf(ridx: 0, widx: 578, cap: 1024) [/192.168.178.xx:49208]:
<long hex string>

2021-01-24 14:59:27.998 [TRACE] [a.server.impl.pairing.PairingManager] - Entering second stage of pair for openHAB
2021-01-24 14:59:29.159 [TRACE] [er.impl.http.HomekitClientConnection] - 200 /pair-setup
2021-01-24 14:59:29.170 [TRACE] [server.impl.http.impl.LoggingHandler] - WRITE PooledUnsafeDirectByteBuf(ridx: 0, widx: 172, cap: 232) [/192.168.178.xx:49208]:
<long hex string>

2021-01-24 14:59:29.261 [TRACE] [server.impl.http.impl.LoggingHandler] - READ PooledUnsafeDirectByteBuf(ridx: 0, widx: 280, cap: 1024) [/192.168.178.xx:49208]:
<long hex string>

2021-01-24 14:59:29.271 [TRACE] [a.server.impl.pairing.PairingManager] - Entering third stage of pair for openHAB
2021-01-24 14:59:29.522 [TRACE] [er.impl.http.HomekitClientConnection] - 200 /pair-setup
2021-01-24 14:59:29.531 [TRACE] [server.impl.http.impl.LoggingHandler] - WRITE PooledUnsafeDirectByteBuf(ridx: 0, widx: 243, cap: 256) [/192.168.178.xx:49208]:
<long hex string>
2021-01-24 14:59:29.583 [TRACE] [rver.impl.http.impl.AccessoryHandler] - Terminated HomeKit connection from /192.168.178.xx:49208
2021-01-24 14:59:29.610 [TRACE] [rver.impl.http.impl.AccessoryHandler] - New HomeKit connection from /192.168.178.xx:49210
2021-01-24 14:59:29.711 [TRACE] [server.impl.http.impl.LoggingHandler] - READ PooledUnsafeDirectByteBuf(ridx: 0, widx: 158, cap: 1024) [/192.168.178.xx:49210]:
<long hex string>
2021-01-24 14:59:29.734 [TRACE] [impl.pairing.PairVerificationManager] - Starting pair verification for openHAB
2021-01-24 14:59:29.811 [TRACE] [er.impl.http.HomekitClientConnection] - 200 /pair-verify
2021-01-24 14:59:29.820 [TRACE] [server.impl.http.impl.LoggingHandler] - WRITE PooledUnsafeDirectByteBuf(ridx: 0, widx: 243, cap: 256) [/192.168.178.xx:49210]:
<long hex string>
2021-01-24 14:59:29.856 [TRACE] [server.impl.http.impl.LoggingHandler] - READ PooledUnsafeDirectByteBuf(ridx: 0, widx: 247, cap: 1024) [/192.168.178.xx:49210]:
<long hex string>
2021-01-24 14:59:30.056 [TRACE] [impl.pairing.PairVerificationManager] - Completed pair verification for openHAB
2021-01-24 14:59:30.069 [TRACE] [er.impl.http.HomekitClientConnection] - 200 /pair-verify
2021-01-24 14:59:30.097 [TRACE] [server.impl.http.impl.LoggingHandler] - WRITE PooledUnsafeDirectByteBuf(ridx: 0, widx: 105, cap: 256) [/192.168.178.xx:49210]:
485454502F312E3120323030204F4B0D0A436F6E74656E742D747970653A206170706C69636174696F6E2F70616972696E672B746C76380D0A436F6E74656E742D4C656E6774683A20330D0A436F6E6E656374696F6E3A206B6565702D616C6976650D0A0D0A060104

2021-01-24 14:59:30.205 [TRACE] [server.impl.http.impl.LoggingHandler] - READ PooledUnsafeDirectByteBuf(ridx: 0, widx: 78, cap: 512) [/192.168.178.xx:49210]:
<long hex string>

2021-01-24 14:59:30.213 [TRACE] [ons.LengthPrefixedByteArrayProcessor] - Received message of length 78. Existing buffer is 0
2021-01-24 14:59:30.218 [TRACE] [ons.LengthPrefixedByteArrayProcessor] - Attempting to read message of length 78
2021-01-24 14:59:30.222 [TRACE] [ons.LengthPrefixedByteArrayProcessor] - Read complete message
2021-01-24 14:59:30.226 [TRACE] [ons.LengthPrefixedByteArrayProcessor] - Returning 1 results
2021-01-24 14:59:30.259 [TRACE] [er.impl.jmdns.JmdnsHomekitAdvertiser] - Re-creating service due to change in discoverability to false
2021-01-24 14:59:32.267 [INFO ] [er.impl.jmdns.JmdnsHomekitAdvertiser] - Registering _hap._tcp.local. on port 9123
2021-01-24 14:59:32.809 [TRACE] [er.impl.http.HomekitClientConnection] - 200 /accessories
2021-01-24 14:59:32.892 [TRACE] [server.impl.http.impl.LoggingHandler] - WRITE PooledUnsafeDirectByteBuf(ridx: 0, widx: 10960, cap: 16384) [/192.168.178.xx:49210]:
<long hex string>
2021-01-24 14:59:33.099 [TRACE] [server.impl.http.impl.LoggingHandler] - READ PooledUnsafeDirectByteBuf(ridx: 0, widx: 180, cap: 512) [/192.168.178.xx:49210]:
<long hex string>
2021-01-24 14:59:33.104 [TRACE] [ons.LengthPrefixedByteArrayProcessor] - Received message of length 180. Existing buffer is 0
2021-01-24 14:59:33.107 [TRACE] [ons.LengthPrefixedByteArrayProcessor] - Attempting to read message of length 180
2021-01-24 14:59:33.110 [TRACE] [ons.LengthPrefixedByteArrayProcessor] - Read complete  message
2021-01-24 14:59:33.114 [TRACE] [ons.LengthPrefixedByteArrayProcessor] - Returning 1 results
2021-01-24 14:59:33.130 [TRACE] [er.impl.jmdns.JmdnsHomekitAdvertiser] - Re-creating service due to change in discoverability to true
2021-01-24 14:59:35.138 [INFO ] [er.impl.jmdns.JmdnsHomekitAdvertiser] - Registering _hap._tcp.local. on port 9123
2021-01-24 14:59:35.143 [TRACE] [er.impl.http.HomekitClientConnection] - 200 /pairings
2021-01-24 14:59:35.154 [TRACE] [server.impl.http.impl.LoggingHandler] - WRITE PooledUnsafeDirectByteBuf(ridx: 0, widx: 123, cap: 256) [/192.168.178.xx:49210]:
<long hex string>
2021-01-24 14:59:35.252 [TRACE] [rver.impl.http.impl.AccessoryHandler] - Terminated HomeKit connection from /192.168.178.xx:49210

No error message, Home app hangs on connecting screen (iPhone 6, PIN 031-45-158)

2021-01-24 15:13:18.519 [TRACE] [rver.impl.http.impl.AccessoryHandler] - New HomeKit connection from /192.168.178.xx:49212
2021-01-24 15:13:18.614 [TRACE] [server.impl.http.impl.LoggingHandler] - READ PooledUnsafeDirectByteBuf(ridx: 0, widx: 125, cap: 1024) [/192.168.178.xx:49212]:
504F5354202F706169722D736574757020485454502F312E310D0A486F73743A206F70656E4841422E5F6861702E5F7463702E6C6F63616C0D0A436F6E74656E742D4C656E6774683A20360D0A436F6E74656E742D547970653A206170706C69636174696F6E2F70616972696E672B746C76380D0A0D0A000100060101

2021-01-24 15:13:18.621 [TRACE] [a.server.impl.pairing.PairingManager] - Starting pair for openHAB
2021-01-24 15:13:19.256 [TRACE] [er.impl.http.HomekitClientConnection] - 200 /pair-setup
2021-01-24 15:13:19.266 [TRACE] [server.impl.http.impl.LoggingHandler] - WRITE PooledUnsafeDirectByteBuf(ridx: 0, widx: 513, cap: 1024) [/192.168.178.xx:49212]:
485454502F312E3120323030204F4B0D0A436F6E74656E742D747970653A206170706C69636174696F6E2F70616972696E672B746C76380D0A436F6E74656E742D4C656E6774683A203430390D0A436F6E6E656374696F6E3A206B6565702D616C6976650D0A0D0A06010202108198A821D6CB13753DE5A6B88CEA1A1203FF53A3F5DC3C1C58C1C2DC39FB48FD7E500CC78C5F7BC11D7B02C98E6233109F08D8155539E0BBB89461D12E76C306BF54EF3FA722510781477DAE02C5A2A0CF8FE67B08C36C691E02AC2D4D4FC63EDB476276544356D3F65B43784977F8DB43682D110440ED815E7F8AEF3F67165F739BFA5C56942880467261080A3089068BEC244B352E7D4135055D6138C338E7A7E390A8ED9BF812F41C32D75A5FF5F35DA279768DA0F7422B03F51FF445675C0B612F17DE784BE59E8390B9B2209269A5412B8CD7F2EA77D4FBBBF8B50EA0637D89D3B5D645ADE73630E154EB21480C402F500EF9D07207F3458641E791261FAD9A43048C8AECC43874A291DA7D1B788D0381C14016B3FBE6E806A43EE847EBA19C4BE65CBAEB91FA3BA36E049966D4307083BE44748E54DE68947B6C630889A464611585075732DFFD557F63A8C4D1BDCA3F47D699067B01C7D2720A5D06C5AD36229A40DC74F6C0B6C6E5CBDC9074A3C54183B75812B9479146A141708EA82BA477AAF83EBB8E437159A5B46B6A99EAB07228

2021-01-24 15:13:25.680 [TRACE] [server.impl.http.impl.LoggingHandler] - READ PooledUnsafeDirectByteBuf(ridx: 0, widx: 578, cap: 1024) [/192.168.178.xx:49212]:
504F5354202F706169722D736574757020485454502F312E310D0A486F73743A206F70656E4841422E5F6861702E5F7463702E6C6F63616C0D0A436F6E74656E742D4C656E6774683A203435370D0A436F6E74656E742D547970653A206170706C69636174696F6E2F70616972696E672B746C76380D0A0D0A06010303FF24174719828E60DA568A88DB76882CAA5A12F8DE522A6520877BE2A44BC50EE44FC2ED58F3B5797A34ABD3739A3ACDC674CE01FD20B02E2428C1AEB5BC41FEE34115DEF6548114F05E05969B4FBCBFC604FCBEB490A0C021D81A259AC01DA9B7A71E89463FA9EEA4BA9E2BE560C74BCE8C636DC3AE569E50AB4D355293E7D2BAA0C330978387F5A4F370C04CA8D7618EC93FF8D86F2D020048B1A675D9FE5F3D19478E6CD14544B352CF3B4095F931A7853CAB653B0E904C21230B9C3744148AEC787336AD32CBC66D0C60F3652BBA051DCA5122CA37733E8E35C2C677115B83C926A9EEC5CFF1AFECBF8ACC560A65A9F36C6A352A4EAE4EC8BDD2D1164AD103812A309D9B2332782CFF7EC972DB5DEBE37C628FA73EC786D0E5DBA9471A78E912286537C23FE098849E3E7ACBDE0FF65559A2AC8B5C7BFCADE96DFFABA06D5E520AEE9D9D17E774AF8277DF559EE783F2B40812C5864110BA4171C33AFEE762C4BE1049F1E96ED6C7FE53A306B4C5B25E5D99CA33308C173BAE7C0A2870BC236F37044064C9DED02451DE02E6DBD2432A7202F24E7616B3C2E8054AB54EC82275DF59794E815CE89A0E998A60774DE4084551934965F04AD99CF7617D9713E759E104D7

2021-01-24 15:13:25.686 [TRACE] [a.server.impl.pairing.PairingManager] - Entering second stage of pair for openHAB
2021-01-24 15:13:26.223 [WARN ] [a.server.impl.pairing.PairingManager] - Exception encountered while processing pairing request
com.nimbusds.srp6.SRP6Exception: Bad client credentials
	at io.github.hapjava.server.impl.pairing.HomekitSRP6ServerSession.step2(HomekitSRP6ServerSession.java:270) ~[bundleFile:?]
	at io.github.hapjava.server.impl.pairing.SrpHandler.step2(SrpHandler.java:76) ~[bundleFile:?]
	at io.github.hapjava.server.impl.pairing.SrpHandler.handle(SrpHandler.java:47) ~[bundleFile:?]
	at io.github.hapjava.server.impl.pairing.PairingManager.handle(PairingManager.java:40) [bundleFile:?]
	at io.github.hapjava.server.impl.connections.HttpSession.handlePairSetup(HttpSession.java:111) [bundleFile:?]
	at io.github.hapjava.server.impl.connections.HttpSession.handleRequest(HttpSession.java:53) [bundleFile:?]
	at io.github.hapjava.server.impl.connections.ConnectionImpl.doHandleRequest(ConnectionImpl.java:56) [bundleFile:?]
	at io.github.hapjava.server.impl.connections.ConnectionImpl.handleRequest(ConnectionImpl.java:49) [bundleFile:?]
	at io.github.hapjava.server.impl.http.impl.AccessoryHandler.channelRead0(AccessoryHandler.java:52) [bundleFile:?]
	at io.github.hapjava.server.impl.http.impl.AccessoryHandler.channelRead0(AccessoryHandler.java:17) [bundleFile:?]
	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:56) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:365) [bundleFile:4.1.42.Final]
	at io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:66) [bundleFile:4.1.42.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1044) [bundleFile:4.1.42.Final]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [bundleFile:4.1.42.Final]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [bundleFile:4.1.42.Final]
	at java.lang.Thread.run(Thread.java:834) [?:?]
2021-01-24 15:13:26.290 [TRACE] [er.impl.http.HomekitClientConnection] - 401 /pair-setup
2021-01-24 15:13:26.297 [TRACE] [server.impl.http.impl.LoggingHandler] - WRITE PooledUnsafeDirectByteBuf(ridx: 0, widx: 72, cap: 232) [/192.168.178.xx:49212]:
<long hex string>

2021-01-24 15:13:26.449 [TRACE] [rver.impl.http.impl.AccessoryHandler] - Terminated HomeKit connection from /192.168.178.xx:49212
2021-01-24 15:14:48.262 [TRACE] [rver.impl.http.impl.AccessoryHandler] - New HomeKit connection from /192.168.178.xx:49213
2021-01-24 15:14:48.271 [TRACE] [server.impl.http.impl.LoggingHandler] - READ PooledUnsafeDirectByteBuf(ridx: 0, widx: 125, cap: 1024) [/192.168.178.xx:49213]:
<long hex string>
2021-01-24 15:14:48.278 [TRACE] [a.server.impl.pairing.PairingManager] - Starting pair for openHAB
2021-01-24 15:14:48.812 [TRACE] [er.impl.http.HomekitClientConnection] - 200 /pair-setup
2021-01-24 15:14:48.825 [TRACE] [server.impl.http.impl.LoggingHandler] - WRITE PooledUnsafeDirectByteBuf(ridx: 0, widx: 513, cap: 1024) [/192.168.178.xx:49213]:
<long hex string>

2021-01-24 15:14:49.091 [TRACE] [server.impl.http.impl.LoggingHandler] - READ PooledUnsafeDirectByteBuf(ridx: 0, widx: 578, cap: 1024) [/192.168.178.xx:49213]:
<long hex string>

2021-01-24 15:14:49.097 [TRACE] [a.server.impl.pairing.PairingManager] - Entering second stage of pair for openHAB
2021-01-24 15:14:49.622 [WARN ] [a.server.impl.pairing.PairingManager] - Exception encountered while processing pairing request
com.nimbusds.srp6.SRP6Exception: Bad client credentials
	at io.github.hapjava.server.impl.pairing.HomekitSRP6ServerSession.step2(HomekitSRP6ServerSession.java:270) ~[bundleFile:?]
	at io.github.hapjava.server.impl.pairing.SrpHandler.step2(SrpHandler.java:76) ~[bundleFile:?]
	at io.github.hapjava.server.impl.pairing.SrpHandler.handle(SrpHandler.java:47) ~[bundleFile:?]
	at io.github.hapjava.server.impl.pairing.PairingManager.handle(PairingManager.java:40) [bundleFile:?]
	at io.github.hapjava.server.impl.connections.HttpSession.handlePairSetup(HttpSession.java:111) [bundleFile:?]
	at io.github.hapjava.server.impl.connections.HttpSession.handleRequest(HttpSession.java:53) [bundleFile:?]
	at io.github.hapjava.server.impl.connections.ConnectionImpl.doHandleRequest(ConnectionImpl.java:56) [bundleFile:?]
	at io.github.hapjava.server.impl.connections.ConnectionImpl.handleRequest(ConnectionImpl.java:49) [bundleFile:?]
	at io.github.hapjava.server.impl.http.impl.AccessoryHandler.channelRead0(AccessoryHandler.java:52) [bundleFile:?]
	at io.github.hapjava.server.impl.http.impl.AccessoryHandler.channelRead0(AccessoryHandler.java:17) [bundleFile:?]
	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:56) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:365) [bundleFile:4.1.42.Final]
	at io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:66) [bundleFile:4.1.42.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1044) [bundleFile:4.1.42.Final]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [bundleFile:4.1.42.Final]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [bundleFile:4.1.42.Final]
	at java.lang.Thread.run(Thread.java:834) [?:?]
2021-01-24 15:14:49.631 [TRACE] [er.impl.http.HomekitClientConnection] - 401 /pair-setup
2021-01-24 15:14:49.642 [TRACE] [server.impl.http.impl.LoggingHandler] - WRITE PooledUnsafeDirectByteBuf(ridx: 0, widx: 72, cap: 232) [/192.168.178.xx:49213]:
<long hex string>

2021-01-24 15:14:49.946 [TRACE] [rver.impl.http.impl.AccessoryHandler] - Terminated HomeKit connection from /192.168.178.xx:49213
2021-01-24 15:15:10.365 [TRACE] [rver.impl.http.impl.AccessoryHandler] - New HomeKit connection from /192.168.178.xx:49214
2021-01-24 15:15:10.372 [TRACE] [server.impl.http.impl.LoggingHandler] - READ PooledUnsafeDirectByteBuf(ridx: 0, widx: 125, cap: 1024) [/192.168.178.xx:49214]:
<long hex string>

2021-01-24 15:15:10.380 [TRACE] [a.server.impl.pairing.PairingManager] - Starting pair for openHAB
2021-01-24 15:15:10.893 [TRACE] [er.impl.http.HomekitClientConnection] - 200 /pair-setup
2021-01-24 15:15:10.905 [TRACE] [server.impl.http.impl.LoggingHandler] - WRITE PooledUnsafeDirectByteBuf(ridx: 0, widx: 513, cap: 1024) [/192.168.178.xx:49214]:
<long hex string>

2021-01-24 15:15:11.196 [TRACE] [server.impl.http.impl.LoggingHandler] - READ PooledUnsafeDirectByteBuf(ridx: 0, widx: 578, cap: 1024) [/192.168.178.xx:49214]:
<long hex string>

2021-01-24 15:15:11.202 [TRACE] [a.server.impl.pairing.PairingManager] - Entering second stage of pair for openHAB
2021-01-24 15:15:11.714 [WARN ] [a.server.impl.pairing.PairingManager] - Exception encountered while processing pairing request
com.nimbusds.srp6.SRP6Exception: Bad client credentials
	at io.github.hapjava.server.impl.pairing.HomekitSRP6ServerSession.step2(HomekitSRP6ServerSession.java:270) ~[bundleFile:?]
	at io.github.hapjava.server.impl.pairing.SrpHandler.step2(SrpHandler.java:76) ~[bundleFile:?]
	at io.github.hapjava.server.impl.pairing.SrpHandler.handle(SrpHandler.java:47) ~[bundleFile:?]
	at io.github.hapjava.server.impl.pairing.PairingManager.handle(PairingManager.java:40) [bundleFile:?]
	at io.github.hapjava.server.impl.connections.HttpSession.handlePairSetup(HttpSession.java:111) [bundleFile:?]
	at io.github.hapjava.server.impl.connections.HttpSession.handleRequest(HttpSession.java:53) [bundleFile:?]
	at io.github.hapjava.server.impl.connections.ConnectionImpl.doHandleRequest(ConnectionImpl.java:56) [bundleFile:?]
	at io.github.hapjava.server.impl.connections.ConnectionImpl.handleRequest(ConnectionImpl.java:49) [bundleFile:?]
	at io.github.hapjava.server.impl.http.impl.AccessoryHandler.channelRead0(AccessoryHandler.java:52) [bundleFile:?]
	at io.github.hapjava.server.impl.http.impl.AccessoryHandler.channelRead0(AccessoryHandler.java:17) [bundleFile:?]
	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:56) [bundleFile:4.1.42.Final]
	at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:365) [bundleFile:4.1.42.Final]
	at io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:66) [bundleFile:4.1.42.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1044) [bundleFile:4.1.42.Final]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [bundleFile:4.1.42.Final]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [bundleFile:4.1.42.Final]
	at java.lang.Thread.run(Thread.java:834) [?:?]
2021-01-24 15:15:11.721 [TRACE] [er.impl.http.HomekitClientConnection] - 401 /pair-setup
2021-01-24 15:15:11.732 [TRACE] [server.impl.http.impl.LoggingHandler] - WRITE PooledUnsafeDirectByteBuf(ridx: 0, widx: 72, cap: 232) [/192.168.178.xx:49214]:
<long hex string>

2021-01-24 15:15:11.744 [TRACE] [rver.impl.http.impl.AccessoryHandler] - Terminated HomeKit connection from /192.168.178.xx:49214

The same errors also occured with the default pin. I did not change any of the other binding settings.

This setup worked just fine on openHAB 2.5, so I don’t think it’s an issue with my phone.

Honestly I’m out of ideas now since I tried every debugging trick that I am aware of. Please let me know if there’s anything I missed.

Thanks!

can you try to update to the latest snapshot version?
from karaf console

update <binding_id> https://openhab.jfrog.io/artifactory/libs-snapshot-local/org/openhab/addons/bundles/org.openhab.io.homekit/3.1.0-SNAPSHOT/org.openhab.io.homekit-3.1.0-20210124.032543-32.jar

e.g. in my case

update 222 https://openhab.jfrog.io/artifactory/libs-snapshot-local/org/openhab/addons/bundles/org.openhab.io.homekit/3.1.0-SNAPSHOT/org.openhab.io.homekit-3.1.0-20210124.032543-32.jar

I installed the snapshot version, but unfortunately pairing still doesn’t work properly. The error messages are still the same: “could not connect” on the iPhone 6 and “device incompatible” on the iPhone 12. As far as I can tell, connecting by scanning the QR code does not make any difference. I’ll try with an iPhone 6s on iOS 13 next.

please try pairing using QR code and enable logging.
with QR code should not get the “Bad client credentials” anymore.

I’ve attached the log file since it is too big to paste directly. I tried to pair the bridge using the QR code with an iPhone 6s on 14.3 first, then with an iPhone 6 on 12.4.9

https://controlc.com/60f312d8

This is the error message on 12.4.9:

openHAB konnte nicht hinzugefügt werden
Home konnte keine Verbindung zu diesem Gerät herstellen
(“Home could not connect to this device”)

and on 14.3:

Gerät kann nicht hinzugefügt werden
Gerät ist nicht kompatibel
*(“Device is not compatible”)

These are the settings in the UI:

Looks much better now. pairing works.
issue is the “color temperature” characteristic. see discussion here

the fix is not ready yet, so, you will need remove the color temperature.

not sure what it was working before and stopped working now, especially as it does not work even on older iOS like 12.4.9

Thank you very much, it works now on the 6s.