I am running openHAB 2 on a Raspberry Pi 2, installed using the apt-get method and the web interface is interacting well with the items installed (currently some MiLights)
I’m currently in the process of integrating Homekit into the openHAB2 environment, but I am encountering some issues. It does find openHAB, but when connecting it responds with “can’t connect to device”.
Homekit is configured in the Paper UI as a ‘service’ (org.openhab.homekit) with the default port number (9154) and PIN (031-45-154). the IP address is the same as openHAB is running on (should it be?)
I have done research around this forum and found that the problem could be that it wouldn’t recognize any items, so to be sure I’ve added some test-switches, as can be seen in my home.items file:
I’ve added the -console=5555 as is described in multiple other topics, but there doesn’t seem to be an osgi console running. At least I cant telnet into it.
Anything that can help me a bit further is much appreciated!
Hi Niels, I will jump in and dig with ya…
We are close to the same point. My configuration is the same. (I am running Pine64 v RPI) I receive the error “couldn’t add openHAB:Home couldn’t connect to this accessory”
I am curious, when you attempt to add the accessory:(openHAB) in iOS are you getting any log entries?
Each time I change the HomeKit config in PaperUI I do get the following [INFO] log entries but nada when trying to connect via iOS:
15:45:58.068 [INFO ] [com.beowulfe.hap.HomekitRoot ] - Added accessory openHAB
15:45:58.080 [INFO ] [com.beowulfe.hap.HomekitRoot ] - Added accessory HommieOfficeLight
15:45:58.086 [INFO ] [pl.http.impl.NettyHomekitHttpService] - Resetting connections
All this to say “hey siri please turn on the lights” and have her say "__Kerr I am not sure I understand did you say you want to fight for your right "
Haha, it does sound a bit exxagerated to go through all this trouble just to let Siri control the living room
But back to the topic, I’ve tried your sh /usr/share/openhab2/runtime/bin/client approach, without any success… Authentication failed:
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sun Dec 11 10:22:14 2016 from gebruik-9d3iaq7.local
osmc@osmc:~$ sh /usr/share/openhab2/runtime/bin/client
client: Ignoring predefined value for KARAF_HOME
Logging in as openhab
Authentication failed
osmc@osmc:~$
Could it be that the OSMC-image is interfering with the openHAB permissions?
Did you find a solution to this issue? It seems like I have the exact same problem. Have checked the logs, and nothing in the logs when trying to pair. I observe the same as you Kerr, I see it in the log when I do configuration, but nothing when I try to pair…
Hi all. I solved this at last. For future reference I did a “smarthome:homekit clearPairings” and a “smarthome:homekit allowUnauthenticated true” from the console, and then restarted the openHAB service. After this HomeKit connected successfully.
unable to connect iOs to openhab accessory since b5 version (2.0 release doesn’t solved the issue).
It was working perfectly with b4 under exactly same config.
Here is the error message in console:
17:38:50.205 [ERROR] [lfe.hap.impl.connections.HttpSession] - Could not handle request
java.lang.NullPointerException
at com.beowulfe.hap.characteristics.FloatCharacteristic.getValue(FloatCharacteristic.java:72)[211:org.openhab.io.homekit:2.0.0]
at com.beowulfe.hap.characteristics.BaseCharacteristic.makeBuilder(BaseCharacteristic.java:71)[211:org.openhab.io.homekit:2.0.0]
at com.beowulfe.hap.characteristics.FloatCharacteristic.makeBuilder(FloatCharacteristic.java:48)[211:org.openhab.io.homekit:2.0.0]
at com.beowulfe.hap.characteristics.BaseCharacteristic.toJson(BaseCharacteristic.java:61)[211:org.openhab.io.homekit:2.0.0]
at com.beowulfe.hap.impl.json.AccessoryController.toJson(AccessoryController.java:73)[211:org.openhab.io.homekit:2.0.0]
at com.beowulfe.hap.impl.json.AccessoryController.listing(AccessoryController.java:39)[211:org.openhab.io.homekit:2.0.0]
at com.beowulfe.hap.impl.connections.HttpSession.handleAuthenticatedRequest(HttpSession.java:70)[211:org.openhab.io.homekit:2.0.0]
at com.beowulfe.hap.impl.connections.ConnectionImpl.doHandleRequest(ConnectionImpl.java:51)[211:org.openhab.io.homekit:2.0.0]
at com.beowulfe.hap.impl.connections.ConnectionImpl.handleRequest(ConnectionImpl.java:46)[211:org.openhab.io.homekit:2.0.0]
at com.beowulfe.hap.impl.http.impl.AccessoryHandler.channelRead0(AccessoryHandler.java:47)[211:org.openhab.io.homekit:2.0.0]
at com.beowulfe.hap.impl.http.impl.AccessoryHandler.channelRead0(AccessoryHandler.java:15)[211:org.openhab.io.homekit:2.0.0]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)[211:org.openhab.io.homekit:2.0.0]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)[211:org.openhab.io.homekit:2.0.0]
at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:32)[211:org.openhab.io.homekit:2.0.0]
at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:299)[211:org.openhab.io.homekit:2.0.0]
at io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:36)[211:org.openhab.io.homekit:2.0.0]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)[211:org.openhab.io.homekit:2.0.0]
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)[211:org.openhab.io.homekit:2.0.0]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]
I tried these steps on my side but I still have the same error: "Coudn’t add openHAB"
And despite having the log set at TRACE for com.beowulfe.hap, not a single line giving me any feedback in the logs.
I have now used Xcode to try to get some logs. Stripping down the unnecessary bit, here is what seems relevant (I have changed the last 4 characters of the value 32:f:40:93:xx:xx)
Feb 23 23:05:03 Ben-6S homed(CoreHAP)[1860] <Info>: [IP Accessory Server 32:f:40:93:xx:xx openHAB] Starting a reconfirm with Bonjour during pairing
Feb 23 23:05:03 Ben-6S homed(CoreHAP)[1860] <Info>: [IP Accessory Server 32:f:40:93:xx:xx openHAB] Accessory doesn't support auth, prompting user...
Feb 23 23:05:03 Ben-6S homed(HomeKitDaemon)[1860] <Info>: Accessory Browser: User already consented to adding unauthenticated accessory to home - skipping auth prompt
Feb 23 23:05:03 Ben-6S homed(CoreHAP)[1860] <Info>: Pair-setup starting for server openHAB device 32:f:40:93:xx:xx...
Feb 23 23:05:03 Ben-6S mDNSResponder[91] <Info>: 18: DNSServiceQueryRecord(400000, 8, openHAB._hap._tcp.local., SRV) START PID[1860](homed)
Feb 23 23:05:51 Ben-6S locationd[1412] <Notice>: message 'kCLConnectionMessageWatchdog' received from client 'com.apple.Home'
Feb 23 23:05:51 Ben-6S locationd[1412] <Notice>: message 'kCLConnectionMessageWatchdog' received from client '/System/Library/PrivateFrameworks/HomeKitDaemon.framework'
Feb 23 23:05:51 Ben-6S locationd[1412] <Notice>: message 'kCLConnectionMessageWatchdog' received from client 'com.apple.Home'
Feb 23 23:05:53 Ben-6S locationd[1412] <Notice>: message 'kCLConnectionMessageWatchdog' received from client 'com.apple.Home.HomeUIService'
Feb 23 23:06:03 Ben-6S homed(CoreHAP)[1860] <Notice>: __55-[HAPAccessoryServerIP _continuePairingAfterAuthPrompt]_block_invoke ### Unable to send initial Pair Setup request, received response object: (null), MIME type: Unknown, error: Error Domain=HMErrorDomain Code=54 "Failed with OSStatus code -6722 (kTimeoutErr)" UserInfo={NSLocalizedDescription=Failed with OSStatus code -6722 (kTimeoutErr), NSUnderlyingError=0x1002c48a0 {Error Domain=NSOSStatusErrorDomain Code=-6722 "kTimeoutErr" UserInfo={NSLocalizedDescription=kTimeoutErr}}}
Feb 23 23:06:03 Ben-6S homed(CoreHAP)[1860] <Info>: [CoreHAP] Invalidating HTTP client and tearing down pairing session, will reconfirm with Bonjour for 32:f:40:93:xx:xx
Feb 23 23:06:03 Ben-6S homed(CoreHAP)[1860] <Info>: invalidating HTTP client for 32:f:40:93:xx:xx
Feb 23 23:06:03 Ben-6S homed(CoreUtils)[1860] <Notice>: <private>
Feb 23 23:06:03 Ben-6S homed(CoreHAP)[1860] <Notice>: [HAP HTTP Client] Received invalidate callback from CoreUtils HTTPClient due to -6722 (kTimeoutErr)
Feb 23 23:06:03 Ben-6S homed(HomeKitDaemon)[1860] <Info>: Ignoring didStopPairingWithError:(Error Domain=HMErrorDomain Code=54 "Failed with OSStatus code -6722 (kTimeoutErr)" UserInfo={NSLocalizedDescription=Failed with OSStatus code -6722 (kTimeoutErr), NSUnderlyingError=0x1002c48a0 {Error Domain=NSOSStatusErrorDomain Code=-6722 "kTimeoutErr" UserInfo={NSLocalizedDescription=kTimeoutErr}}}) and starting a pairing interrupted timer for unpaired accessory openHAB/32:f:40:93:xx:xx
Feb 23 23:06:03 Ben-6S homed(HomeKitDaemon)[1860] <Info>: Pairing interrupted timer exists for unpaired accessory openHAB/32:f:40:93:xx:xx - skipping
Feb 23 23:06:03 Ben-6S homed(HomeKitDaemon)[1860] <Info>: WAC/Bonjour reconfirm timer exists for unpaired accessory openHAB/32:f:40:93:xx:xx - skipping
Feb 23 23:06:03 Ben-6S mDNSResponder[91] <Info>: 17: DNSServiceGetAddrInfo(osmc-1.local.) STOP PID[1860](homed)
Feb 23 23:06:03 Ben-6S mDNSResponder[91] <Info>: 18: DNSServiceQueryRecord(openHAB._hap._tcp.local., SRV) STOP PID[1860](homed)
Feb 23 23:06:11 Ben-6S locationd[1412] <Notice>: message 'kCLConnectionMessageWatchdog' received from client 'com.apple.Home'
Feb 23 23:06:46 Ben-6S homed(HomeKitDaemon)[1860] <Info>: Indicating addAccessory failure for accessory openHAB(32:f:40:93:xx:xx) with error Error Domain=HMErrorDomain Code=4 "(null)"
Feb 23 23:06:46 Ben-6S homed(CoreHAP)[1860] <Info>: Adding a WAC scan request with scan interval of 10.000000 seconds
Feb 23 23:06:46 Ben-6S homed(HomeKitDaemon)[1860] <Info>: Removing password and handlers for accessory 8718ED2D-264D-4676-B3FC-DF054744Axxx
Feb 23 23:06:46 Ben-6S homed(HomeKitDaemon)[1860] <Notice>: Failed to add accessory openHAB with error: Error Domain=HMErrorDomain Code=4 "(null)"
I am not sure I understand where 32:f:40:93:xx:xx comes from and how I could fix my issue.
Does anyone understand what the log below really means?
I am using OpenHABian and had problems to connect. Tried several tips, but this worked: I set the interface IP for the HomeKit service (configuration/ service/ HomeKit) and the next try I was successful.