ERROR: Harmony-Binding

I have a Problem with harmony binding.
I get a lot of ERRORs like this:

2017-01-29 11:08:29.396 [ERROR] [ome.core.thing.internal.ThingManager] - Exception occured while calling thing updated at ThingHandler 'org.openhab.binding.harmonyhub.handler.HarmonyDeviceHandler@1eb7e76': null
java.util.concurrent.TimeoutException
	at java.util.concurrent.FutureTask.get(FutureTask.java:205)[:1.8.0_121]
	at org.eclipse.smarthome.core.common.SafeMethodCaller.callAsynchronous(SafeMethodCaller.java:188)[99:org.eclipse.smarthome.core:0.9.0.b4]
	at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:81)[99:org.eclipse.smarthome.core:0.9.0.b4]
	at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:65)[99:org.eclipse.smarthome.core:0.9.0.b4]
	at org.eclipse.smarthome.core.thing.internal.ThingManager.thingUpdated(ThingManager.java:518)[106:org.eclipse.smarthome.core.thing:0.9.0.b4]
	at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.notifyTrackers(ThingRegistryImpl.java:227)[106:org.eclipse.smarthome.core.thing:0.9.0.b4]
	at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.notifyListenersAboutUpdatedElement(ThingRegistryImpl.java:150)[106:org.eclipse.smarthome.core.thing:0.9.0.b4]
	at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.notifyListenersAboutUpdatedElement(ThingRegistryImpl.java:1)[106:org.eclipse.smarthome.core.thing:0.9.0.b4]
	at org.eclipse.smarthome.core.common.registry.AbstractRegistry.updated(AbstractRegistry.java:167)[99:org.eclipse.smarthome.core:0.9.0.b4]
	at org.eclipse.smarthome.core.common.registry.AbstractProvider.notifyListeners(AbstractProvider.java:57)[99:org.eclipse.smarthome.core:0.9.0.b4]
	at org.eclipse.smarthome.core.common.registry.AbstractProvider.notifyListenersAboutUpdatedElement(AbstractProvider.java:82)[99:org.eclipse.smarthome.core:0.9.0.b4]
	at org.eclipse.smarthome.core.common.registry.AbstractManagedProvider.update(AbstractManagedProvider.java:134)[99:org.eclipse.smarthome.core:0.9.0.b4]
	at org.eclipse.smarthome.config.discovery.internal.PersistentInbox.add(PersistentInbox.java:204)[96:org.eclipse.smarthome.config.discovery:0.9.0.b4]
	at org.eclipse.smarthome.config.discovery.internal.PersistentInbox.thingDiscovered(PersistentInbox.java:293)[96:org.eclipse.smarthome.config.discovery:0.9.0.b4]
	at org.eclipse.smarthome.config.discovery.internal.DiscoveryServiceRegistryImpl$2.run(DiscoveryServiceRegistryImpl.java:269)[96:org.eclipse.smarthome.config.discovery:0.9.0.b4]
	at org.eclipse.smarthome.config.discovery.internal.DiscoveryServiceRegistryImpl$2.run(DiscoveryServiceRegistryImpl.java:1)[96:org.eclipse.smarthome.config.discovery:0.9.0.b4]
	at java.security.AccessController.doPrivileged(Native Method)[:1.8.0_121]
	at org.eclipse.smarthome.config.discovery.internal.DiscoveryServiceRegistryImpl.thingDiscovered(DiscoveryServiceRegistryImpl.java:266)[96:org.eclipse.smarthome.config.discovery:0.9.0.b4]
	at org.eclipse.smarthome.config.discovery.AbstractDiscoveryService.thingDiscovered(AbstractDiscoveryService.java:253)[96:org.eclipse.smarthome.config.discovery:0.9.0.b4]
	at org.openhab.binding.harmonyhub.discovery.HarmonyDeviceDiscoveryService.discoverDevices(HarmonyDeviceDiscoveryService.java:103)[190:org.openhab.binding.harmonyhub:2.0.0]
	at org.openhab.binding.harmonyhub.discovery.HarmonyDeviceDiscoveryService.hubStatusChanged(HarmonyDeviceDiscoveryService.java:64)[190:org.openhab.binding.harmonyhub:2.0.0]
	at org.openhab.binding.harmonyhub.handler.HarmonyHubHandler.updateStatus(HarmonyHubHandler.java:148)[190:org.openhab.binding.harmonyhub:2.0.0]
	at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.updateStatus(BaseThingHandler.java:415)[106:org.eclipse.smarthome.core.thing:0.9.0.b4]
	at org.openhab.binding.harmonyhub.handler.HarmonyHubHandler.connectToHub(HarmonyHubHandler.java:251)[190:org.openhab.binding.harmonyhub:2.0.0]
	at org.openhab.binding.harmonyhub.handler.HarmonyHubHandler.hubDiscovered(HarmonyHubHandler.java:177)[190:org.openhab.binding.harmonyhub:2.0.0]
	at org.openhab.binding.harmonyhub.discovery.HarmonyHubDiscovery$HarmonyServer.run(HarmonyHubDiscovery.java:253)[190:org.openhab.binding.harmonyhub:2.0.0]

Same problem here…

017-03-24 09:22:44.189 [WARN ] [ome.core.thing.internal.ThingManager] - Initializing handler for thing 'harmonyhub:device:HarmonyHub:42794772' takes more than 5000ms.
2017-03-24 09:22:44.198 [WARN ] [ome.core.thing.internal.ThingManager] - Initializing handler for thing 'harmonyhub:device:HarmonyHub:42793058' takes more than 5000ms.
2017-03-24 09:22:44.203 [ERROR] [ome.core.thing.internal.ThingManager] - Exception occured while calling thing updated at ThingHandler 'org.openhab.binding.harmonyhub.handler.HarmonyDeviceHandler@636755': null
java.util.concurrent.TimeoutException
	at java.util.concurrent.FutureTask.get(FutureTask.java:205)[:1.8.0_121]
	at org.eclipse.smarthome.core.common.SafeMethodCaller.callAsynchronous(SafeMethodCaller.java:194)[99:org.eclipse.smarthome.core:0.9.0.201703201701]
	at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:83)[99:org.eclipse.smarthome.core:0.9.0.201703201701]
	at org.eclipse.smarthome.core.common.SafeMethodCaller.call(SafeMethodCaller.java:67)[99:org.eclipse.smarthome.core:0.9.0.201703201701]
	at org.eclipse.smarthome.core.thing.internal.ThingManager.thingUpdated(ThingManager.java:506)[106:org.eclipse.smarthome.core.thing:0.9.0.201703201701]
	at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.notifyTrackers(ThingRegistryImpl.java:227)[106:org.eclipse.smarthome.core.thing:0.9.0.201703201701]
	at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.notifyListenersAboutUpdatedElement(ThingRegistryImpl.java:150)[106:org.eclipse.smarthome.core.thing:0.9.0.201703201701]
	at org.eclipse.smarthome.core.thing.internal.ThingRegistryImpl.notifyListenersAboutUpdatedElement(ThingRegistryImpl.java:1)[106:org.eclipse.smarthome.core.thing:0.9.0.201703201701]
	at org.eclipse.smarthome.core.common.registry.AbstractRegistry.updated(AbstractRegistry.java:167)[99:org.eclipse.smarthome.core:0.9.0.201703201701]
	at org.eclipse.smarthome.core.common.registry.AbstractProvider.notifyListeners(AbstractProvider.java:57)[99:org.eclipse.smarthome.core:0.9.0.201703201701]
	at org.eclipse.smarthome.core.common.registry.AbstractProvider.notifyListenersAboutUpdatedElement(AbstractProvider.java:82)[99:org.eclipse.smarthome.core:0.9.0.201703201701]
	at org.eclipse.smarthome.core.common.registry.AbstractManagedProvider.update(AbstractManagedProvider.java:134)[99:org.eclipse.smarthome.core:0.9.0.201703201701]
	at org.eclipse.smarthome.config.discovery.internal.PersistentInbox.add(PersistentInbox.java:204)[96:org.eclipse.smarthome.config.discovery:0.9.0.201703201701]
	at org.eclipse.smarthome.config.discovery.internal.PersistentInbox.thingDiscovered(PersistentInbox.java:293)[96:org.eclipse.smarthome.config.discovery:0.9.0.201703201701]
	at org.eclipse.smarthome.config.discovery.internal.DiscoveryServiceRegistryImpl$2.run(DiscoveryServiceRegistryImpl.java:269)[96:org.eclipse.smarthome.config.discovery:0.9.0.201703201701]
	at org.eclipse.smarthome.config.discovery.internal.DiscoveryServiceRegistryImpl$2.run(DiscoveryServiceRegistryImpl.java:1)[96:org.eclipse.smarthome.config.discovery:0.9.0.201703201701]
	at java.security.AccessController.doPrivileged(Native Method)[:1.8.0_121]
	at org.eclipse.smarthome.config.discovery.internal.DiscoveryServiceRegistryImpl.thingDiscovered(DiscoveryServiceRegistryImpl.java:266)[96:org.eclipse.smarthome.config.discovery:0.9.0.201703201701]
	at org.eclipse.smarthome.config.discovery.AbstractDiscoveryService.thingDiscovered(AbstractDiscoveryService.java:253)[96:org.eclipse.smarthome.config.discovery:0.9.0.201703201701]
	at org.openhab.binding.harmonyhub.discovery.HarmonyDeviceDiscoveryService.discoverDevices(HarmonyDeviceDiscoveryService.java:103)[214:org.openhab.binding.harmonyhub:2.1.0.201703212140]
	at org.openhab.binding.harmonyhub.discovery.HarmonyDeviceDiscoveryService.hubStatusChanged(HarmonyDeviceDiscoveryService.java:64)[214:org.openhab.binding.harmonyhub:2.1.0.201703212140]
	at org.openhab.binding.harmonyhub.handler.HarmonyHubHandler.updateStatus(HarmonyHubHandler.java:154)[214:org.openhab.binding.harmonyhub:2.1.0.201703212140]
	at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.updateStatus(BaseThingHandler.java:415)[106:org.eclipse.smarthome.core.thing:0.9.0.201703201701]
	at org.openhab.binding.harmonyhub.handler.HarmonyHubHandler.connectToHub(HarmonyHubHandler.java:277)[214:org.openhab.binding.harmonyhub:2.1.0.201703212140]
	at org.openhab.binding.harmonyhub.handler.HarmonyHubHandler.hubDiscovered(HarmonyHubHandler.java:185)[214:org.openhab.binding.harmonyhub:2.1.0.201703212140]
	at org.openhab.binding.harmonyhub.discovery.HarmonyHubDiscovery$HarmonyServer.run(HarmonyHubDiscovery.java:266)[214:org.openhab.binding.harmonyhub:2.1.0.201703212140]

This bug is identified? Anyone is handling it?
Regards

We are actually refactoring the binding as we speak, so this might be fixed in current nightly builds

@digitaldan Thanks for the update.

Are there any news about this issue? Got the same error and a huge latency between the commands :frowning:

I am currently having issues with the harmony binding too. I am completely up to date with the snapshot. In the last few days my Volume Up and Volume Down buttons work once but then cease to work. - Should I just wait until the binding is “refactored” or is this something I need to “fix”.

@ianj001, @neok0 There was a regression during the refactoring that causes button commands to timeout. @digitaldan and yours truly are testing a fix for it.

If you want to help testing try this org.openhab.binding.harmonyhub-2.1.0-SNAPSHOT.jar. So far button commands seem to work properly with this fix for me.

Sorry for the tardy response. I am going to load this SNAPSHOT and let you know how it goes.
UPDATE: I can confirm that with this snapshot the functionality works again. I can turn the telly up and down now :slight_smile:
Sadly, my apt-get has stopped updating the nightly builds again. I guess I am going to have to apt-get purge again to get it to start working once more (SIGH)

I have just checked using apt-cache policy openhab2 at it shows that I do indeed have the latest available snapshot however, I haven’t seen it do an update for while. Here’s what I have:
openhab2:
Installed: 2.1.0~20170331113737-1
Candidate: 2.1.0~20170331113737-1
Version table:
*** 2.1.0~20170331113737-1 0
500 http://openhab.jfrog.io/openhab/openhab-linuxpkg/ unstable/main amd6

can anyone confirm that the that is the latest version?

1 Like

There has been an issue with the build server since April 1st so that is probably causing your updates to fail.

See also:

Thanks, I didn’t know that there was a problem with the build server. - Looks like I am as good as I can be for now. BTW, my missus was happy that the volume button is working again, she hated having to mess with the “real remote” we almost forgot which one it was :wink:

Thats great to hear! I’ll be putting in a PR for this fix some time soon. :slight_smile:

1 Like

Sorry, maybe this ist not an issue of the binding for me, but I am facing severe problems with the connection to the hub.
Maybe it is a hardware issue.
Could someone check this for me:
Does your hub answer every time if you ping it? (ping harmony hub)
For me it does it only about every 30 ping

@LuFriFri I have 2 hubs that both reply to each and every ping:

--- 192.168.1.32 ping statistics ---
25 packets transmitted, 25 received, 0% packet loss, time 24009ms
rtt min/avg/max/mdev = 0.820/2.083/12.007/2.458 ms

--- 192.168.1.37 ping statistics ---
25 packets transmitted, 25 received, 0% packet loss, time 24006ms
rtt min/avg/max/mdev = 0.780/1.653/7.007/1.794 ms

Sadly I still have some issues. I have the 2.1.0.201704060908 HarmonyHub Binding installed, the latecy between the commands are issued are rater long. Up to 10 seconds. Anyone with the same issue?

thank you very much, now it looks like a hardware issue :frowning:

Hi Lutz

It may be a hardware issue but maybe there is a workaround… I too am getting inconsistent network response from my Harmony Hub. This was giving me constant errors in the openHAB log and the Thing would reports as offline with a connection error. When i tried pinging the Hub it would give me wildly varying response times and regular timeouts.

Even after removing the items, things and the binding and a complete reinstall it would work for a little while and then be reported as disconnected. Today I noticed the Thing has a provision for a heart beat interval. It is defaulted to 60 seconds. I change mine to 1 and the Hub immediately reported as online. I only just changed this so time will tell if this is a durable fix. Every second seemed a lot so I have experimented with 15 seconds and it still seems OK.

The Harmony system only uses the wifi for updates I think. It may be for power saving or some other reason the wifi is not always active. The setup process using the Harmony iOS app seems to initiate a connection to the hub as required. So maybe setting a shorter heartbeat interval keeps the network interface alive more consistently for access by openHAB?

It is worth giving this a try to see if it helps before looking to replace the hardware…?

Thank you for your thoughts.

But playing with heart beat interval does not change anything :frowning:

It turns out to be very strange:
ping from my Mac or my Raspi via LAN does not look very good
Ping from iPhone/iPad via WLAN seems to work without problems
The Harmony iOS App works as expected without any problems

Since I have the harmony hub I have problems with the connection from iobroker and later also openhab
For some time it worked quite well, but some days ago it stopped working without any change made to the systems.

I already did a complete reset of the hub - also without using an existing setup, so completely new configuration.
I also changed IP and name of the hub.

Everytime I reboot the hub it gets recognised as new thing by openhab2 but shortly after the connection stops:

In the logs I find:

2017-04-13 17:42:57.349 [WARN ] [rg.jivesoftware.smack.XMPPConnection] - Connection closed with error
java.io.EOFException: no more data available - expected end tag </stream:stream> to close start tag <stream:stream> from line 1, parser stopped on END_TAG seen ...</mechanisms></stream:features>... @1:297
	at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:3035)[246:org.openhab.binding.harmonyhub:2.0.0]
	at org.xmlpull.mxp1.MXParser.more(MXParser.java:3046)[246:org.openhab.binding.harmonyhub:2.0.0]
	at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1144)[246:org.openhab.binding.harmonyhub:2.0.0]
	at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)[246:org.openhab.binding.harmonyhub:2.0.0]
	at org.jivesoftware.smack.tcp.PacketReader.parsePackets(PacketReader.java:279)[246:org.openhab.binding.harmonyhub:2.0.0]
	at org.jivesoftware.smack.tcp.PacketReader.access$000(PacketReader.java:47)[246:org.openhab.binding.harmonyhub:2.0.0]
	at org.jivesoftware.smack.tcp.PacketReader$1.run(PacketReader.java:81)[246:org.openhab.binding.harmonyhub:2.0.0]

2017-04-13 17:43:27.302 [ThingAddedEvent           ] - Thing 'harmonyhub:hub:harmony' has been added.
2017-04-13 17:43:27.347 [hingStatusInfoChangedEvent] - 'harmonyhub:hub:harmony' changed from UNINITIALIZED to INITIALIZING
2017-04-13 17:43:27.360 [hingStatusInfoChangedEvent] - 'harmonyhub:hub:harmony' changed from INITIALIZING to UNKNOWN

2017-04-13 17:43:57.377 [hingStatusInfoChangedEvent] - 'harmonyhub:hub:harmony' changed from UNKNOWN to OFFLINE (COMMUNICATION_ERROR): No hubs found for hub name

2017-04-13 17:53:48.761 [ERROR] [harmonyhub.handler.HarmonyHubHandler] - Could not connect to HarmonyHub at 192.168.108.2
java.lang.RuntimeException: Failed communicating with Harmony Hub
	at net.whistlingfish.harmony.HarmonyClient.connect(HarmonyClient.java:186)[246:org.openhab.binding.harmonyhub:2.0.0]
	at org.openhab.binding.harmonyhub.handler.HarmonyHubHandler.connectToHub(HarmonyHubHandler.java:238)[246:org.openhab.binding.harmonyhub:2.0.0]
	at org.openhab.binding.harmonyhub.handler.HarmonyHubHandler.hubDiscovered(HarmonyHubHandler.java:177)[246:org.openhab.binding.harmonyhub:2.0.0]
	at org.openhab.binding.harmonyhub.discovery.HarmonyHubDiscovery$HarmonyServer.run(HarmonyHubDiscovery.java:253)[246:org.openhab.binding.harmonyhub:2.0.0]
Caused by: org.jivesoftware.smack.SmackException$ConnectionException
	at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectUsingConfiguration(XMPPTCPConnection.java:433)[246:org.openhab.binding.harmonyhub:2.0.0]
	at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectInternal(XMPPTCPConnection.java:808)[246:org.openhab.binding.harmonyhub:2.0.0]
	at org.jivesoftware.smack.XMPPConnection.connect(XMPPConnection.java:396)[246:org.openhab.binding.harmonyhub:2.0.0]
	at net.whistlingfish.harmony.HarmonyClient.connect(HarmonyClient.java:122)[246:org.openhab.binding.harmonyhub:2.0.0]
	... 3 more

Only in a few times I now get to see the actions I defined for the hub in openhab2 as new things

This workaround does not also seem to be that durable in my setup either. At a heartbeat interval of 15 I still have rules failing to fire and no response from controls on my sitemap. When I look at the Thing in the Paper UI it is reporting as Offline; Communication Error and the log is littered with errors relating to the Harmony Hub.

If I manually go and tinker then I can get the Harmony Hub back online and it wil then be responsive. But left to its own devices it stops talking to OpenHAB.

Having the same error every 60 seconds:

10:44:56.397 [ERROR] [harmonyhub.handler.HarmonyHubHandler] - Could not connect to   HarmonyHub at 192.168.178.45
java.lang.RuntimeException: Failed communicating with Harmony Hub
    at net.whistlingfish.harmony.HarmonyClient.connect(HarmonyClient.java:200)[191:org.openhab.binding.harmonyhub:2.1.0.201703310852]
    at net.whistlingfish.harmony.HarmonyClient.connect(HarmonyClient.java:115)[191:org.openhab.binding.harmonyhub:2.1.0.201703310852]
    at org.openhab.binding.harmonyhub.handler.HarmonyHubHandler.connect(HarmonyHubHandler.java:207)[191:org.openhab.binding.harmonyhub:2.1.0.201703310852]
    at org.openhab.binding.harmonyhub.handler.HarmonyHubHandler.access$4(HarmonyHubHandler.java:178)[191:org.openhab.binding.harmonyhub:2.1.0.201703310852]
    at org.openhab.binding.harmonyhub.handler.HarmonyHubHandler$3.run(HarmonyHubHandler.java:249)[191:org.openhab.binding.harmonyhub:2.1.0.201703310852]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_101]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_101]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[:1.8.0_101]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.8.0_101]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_101]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_101]
    at java.lang.Thread.run(Thread.java:745)[:1.8.0_101]
Caused by: java.lang.InterruptedException
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2067)[:1.8.0_101]
    at org.jivesoftware.smack.SynchronizationPoint.waitForConditionOrTimeout(SynchronizationPoint.java:243)[191:org.openhab.binding.harmonyhub:2.1.0.201703310852]
    at org.jivesoftware.smack.SynchronizationPoint.checkIfSuccessOrWait(SynchronizationPoint.java:151)[191:org.openhab.binding.harmonyhub:2.1.0.201703310852]
    at org.jivesoftware.smack.SynchronizationPoint.checkIfSuccessOrWaitOrThrow(SynchronizationPoint.java:126)[191:org.openhab.binding.harmonyhub:2.1.0.201703310852]
    at org.jivesoftware.smack.AbstractXMPPConnection.connect(AbstractXMPPConnection.java:380)[191:org.openhab.binding.harmonyhub:2.1.0.201703310852]
    at net.whistlingfish.harmony.HarmonyClient.connect(HarmonyClient.java:126)[191:org.openhab.binding.harmonyhub:2.1.0.201703310852]
    ... 11 more

I also have the same errors. The funny thing is that it used to work with OH 2.0 stable build from January.
This is very annoying since I use speec recognition via Alexa and OH2 to control my TV and audio devices.