openHAB 2 Homekit Integration Java exception

Hi openHAB community,

i installed openHAB on a virtual ubuntu server while waiting for my Pine64 to arrive. Just to play a little…

I updated everything to the newest version and installed Oracle Java 1.8.0_91.

Then installed the openhab2-offline package with apt-get.

openHAB is starting and i activated the Max binding - working fine - my devices show up in inbox…

After the devices showed up in the UI, i tried to connect my iPhone with the Homekit integration, but openHAB won’t show up. I didn’t change anything in Homekit settings. After some "google"ing i found the following in openhab.log:

[ERROR] [ ] - [org.openhab.homekit(149)] The modified method has thrown an exception java.lang.NumberFormatException: For input string: "9124.0"
at java.lang.NumberFormatException.forInputString([:1.8.0_91]
at java.lang.Integer.parseInt([:1.8.0_91]
at java.lang.Integer.parseInt([:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke([:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke([:1.8.0_91]
at java.lang.reflect.Method.invoke([:1.8.0_91]
at org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod([33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.helper.BaseMethod.access$500([33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke([33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.helper.BaseMethod.invoke([33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.helper.ActivateMethod.invoke([33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.manager.SingleComponentManager.invokeModifiedMethod([33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.manager.SingleComponentManager.modify([33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.manager.SingleComponentManager.reconfigure([33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.manager.SingleComponentManager.reconfigure([33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.config.ConfigurableComponentHolder.configurationUpdated([33:org.apache.felix.scr:2.0.2]
at org.apache.felix.scr.impl.config.ConfigurationSupport.configurationEvent([33:org.apache.felix.scr:2.0.2]

Changing the Port in the configuration changes the error only from "…For input string: “9124.0” to eg "…For input string: “9125.0”.

Did i miss something?

Is there any additional configuration to be done to get Homekit integration to work?

Thanks for your help

what iOS app are you using to “discover” the openhab instance (running homekit)? Change the port back to the default and pull down an app like Hesperus on the App store. You’ll discover and pair homekit through Hesperus and, after that, should be able to use Siri to control your switches, lights, etc. You can also use Hesperus to view temp/hum and actuate relays and switches from your openHAB instance.

Hi Nick,

i am trying to discover openHAB with iOS 10. I did see openHAB once but i could not connect. Then i found that error in “openhab.log” logfile. Now it won’t even show up in homekit app.

I did not change the port in the first place, this was only to see if the error is somewhat related to the port setting or if it’s just coincidence. And i thought there might be a typo in the default port setting as a TCP/UDP port is not a decimal value.

But as using “9125” gave the same error in the logfile i reverted to “9124”.

I will try another homekit app later, but as there is a java exception when starting the homekit service, i guess homekit integration is not working correctly.

Ah, ok. So I referenced my homekit.cfg file and discovered I’m using port 9124. I believe it was the default port entered when loading the binding. Have you tried 9124?

Ahh, sorry typo on my side it was always 9124 not 9024…the exception i postet has 9124, too…i’ll correct the typo’s, sorry

i found a sloution:

the file " /var/lib/openhab2/cache/org.eclipse.osgi/7/data/config/org/openhab/homekit.config" contains the homkit configuration, and there you can see the port value is “9124.0”


When i change the port value within the file to a non decimal value the exception is gone - have to check homekit functionality later, when i am at home…

When i change the value with the configuartion dialog again, the the value is decimal again… so it seems there is a bug with the configuration dialog the puts the port value as a decimal value into the configuration file.

I finally found an already open issus for it…