ERROR: Harmony-Binding

@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:
Installed: 2.1.0~20170331113737-1
Candidate: 2.1.0~20170331113737-1
Version table:
*** 2.1.0~20170331113737-1 0
500 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:

--- 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

--- 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 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 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([246:org.openhab.binding.harmonyhub:2.0.0]
	at org.xmlpull.mxp1.MXParser.more([246:org.openhab.binding.harmonyhub:2.0.0]
	at org.xmlpull.mxp1.MXParser.nextImpl([246:org.openhab.binding.harmonyhub:2.0.0]
	at org.jivesoftware.smack.tcp.PacketReader.parsePackets([246:org.openhab.binding.harmonyhub:2.0.0]
	at org.jivesoftware.smack.tcp.PacketReader.access$000([246:org.openhab.binding.harmonyhub:2.0.0]
	at org.jivesoftware.smack.tcp.PacketReader$[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
java.lang.RuntimeException: Failed communicating with Harmony Hub
	at net.whistlingfish.harmony.HarmonyClient.connect([246:org.openhab.binding.harmonyhub:2.0.0]
	at org.openhab.binding.harmonyhub.handler.HarmonyHubHandler.connectToHub([246:org.openhab.binding.harmonyhub:2.0.0]
	at org.openhab.binding.harmonyhub.handler.HarmonyHubHandler.hubDiscovered([246:org.openhab.binding.harmonyhub:2.0.0]
	at org.openhab.binding.harmonyhub.discovery.HarmonyHubDiscovery$[246:org.openhab.binding.harmonyhub:2.0.0]
Caused by: org.jivesoftware.smack.SmackException$ConnectionException
	at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectUsingConfiguration([246:org.openhab.binding.harmonyhub:2.0.0]
	at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectInternal([246:org.openhab.binding.harmonyhub:2.0.0]
	at org.jivesoftware.smack.XMPPConnection.connect([246:org.openhab.binding.harmonyhub:2.0.0]
	at net.whistlingfish.harmony.HarmonyClient.connect([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
java.lang.RuntimeException: Failed communicating with Harmony Hub
    at net.whistlingfish.harmony.HarmonyClient.connect([191:org.openhab.binding.harmonyhub:]
    at net.whistlingfish.harmony.HarmonyClient.connect([191:org.openhab.binding.harmonyhub:]
    at org.openhab.binding.harmonyhub.handler.HarmonyHubHandler.connect([191:org.openhab.binding.harmonyhub:]
    at org.openhab.binding.harmonyhub.handler.HarmonyHubHandler.access$4([191:org.openhab.binding.harmonyhub:]
    at org.openhab.binding.harmonyhub.handler.HarmonyHubHandler$[191:org.openhab.binding.harmonyhub:]
    at java.util.concurrent.Executors$[:1.8.0_101]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201([:1.8.0_101]
    at java.util.concurrent.ScheduledThreadPoolExecutor$[:1.8.0_101]
    at java.util.concurrent.ThreadPoolExecutor.runWorker([:1.8.0_101]
    at java.util.concurrent.ThreadPoolExecutor$[:1.8.0_101]
Caused by: java.lang.InterruptedException
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos([:1.8.0_101]
    at org.jivesoftware.smack.SynchronizationPoint.waitForConditionOrTimeout([191:org.openhab.binding.harmonyhub:]
    at org.jivesoftware.smack.SynchronizationPoint.checkIfSuccessOrWait([191:org.openhab.binding.harmonyhub:]
    at org.jivesoftware.smack.SynchronizationPoint.checkIfSuccessOrWaitOrThrow([191:org.openhab.binding.harmonyhub:]
    at org.jivesoftware.smack.AbstractXMPPConnection.connect([191:org.openhab.binding.harmonyhub:]
    at net.whistlingfish.harmony.HarmonyClient.connect([191:org.openhab.binding.harmonyhub:]
    ... 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.

To clarify things: I installed the latest OH2 snapshot 2.1.0 from 2017-04-17. The error can be reproduced as follows:

  1. Harmony Hub up and running
  2. Start OH2
  3. Everything is OK: OH2 finds HarmonyHub and can control it
  4. Reset Harmony Hub (switch off and on again)
  5. OH2 produces heartbeat failed and connection errors
  6. This error messages stay on (until you restart OH2). I thought that the binding should be able to reconnect to Harmony Hub again after heartbeat failed messages (at least if I look at the code this should be the behvaiour)

@Dan Cunningham: Could you please investigate this issue. This is very annoying (the reset of HarmonyHub) and reconnection worked with OH 2.0.0 (official release).

Just an update from my side:
Today I got my new harmony hub and it seems that my connection problems have gone :slight_smile:

I am also running the 2.1.0.SNAPSHOT version of the Harmony Hub binding. The errors I am seeing every 60 seconds appear to be the same as @Celaeno1 and @Felix_Losch

2017-04-19 08:51:34.227 [WARN ] [oftware.smack.AbstractXMPPConnection] - Connection XMPPTCPConnection[not-authenticated] (7981) closed with error 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:304
	at org.xmlpull.mxp1.MXParser.fillBuf([193:org.openhab.binding.harmonyhub:]
	at org.xmlpull.mxp1.MXParser.more([193:org.openhab.binding.harmonyhub:]
	at org.xmlpull.mxp1.MXParser.nextImpl([193:org.openhab.binding.harmonyhub:]
	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets([193:org.openhab.binding.harmonyhub:]
	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300([193:org.openhab.binding.harmonyhub:]
	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$[193:org.openhab.binding.harmonyhub:]
2017-04-19 08:51:34.267 [ERROR] [harmonyhub.handler.HarmonyHubHandler] - Could not connect to HarmonyHub at
java.lang.RuntimeException: Failed communicating with Harmony Hub
	at net.whistlingfish.harmony.HarmonyClient.connect([193:org.openhab.binding.harmonyhub:]
	at net.whistlingfish.harmony.HarmonyClient.connect([193:org.openhab.binding.harmonyhub:]
	at org.openhab.binding.harmonyhub.handler.HarmonyHubHandler.connect([193:org.openhab.binding.harmonyhub:]
	at org.openhab.binding.harmonyhub.handler.HarmonyHubHandler.access$4([193:org.openhab.binding.harmonyhub:]
	at org.openhab.binding.harmonyhub.handler.HarmonyHubHandler$[193:org.openhab.binding.harmonyhub:]
	at java.util.concurrent.Executors$[:1.8.0_121]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201([:1.8.0_121]
	at java.util.concurrent.ScheduledThreadPoolExecutor$[:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor.runWorker([:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor$[:1.8.0_121]
Caused by: java.lang.InterruptedException
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos([:1.8.0_121]
	at org.jivesoftware.smack.SynchronizationPoint.waitForConditionOrTimeout([193:org.openhab.binding.harmonyhub:]
	at org.jivesoftware.smack.SynchronizationPoint.checkIfSuccessOrWait([193:org.openhab.binding.harmonyhub:]
	at org.jivesoftware.smack.SynchronizationPoint.checkIfSuccessOrWaitOrThrow([193:org.openhab.binding.harmonyhub:]
	at org.jivesoftware.smack.AbstractXMPPConnection.connect([193:org.openhab.binding.harmonyhub:]
	at net.whistlingfish.harmony.HarmonyClient.connect([193:org.openhab.binding.harmonyhub:]
	... 11 more

My initial thoughts that changing the heartbeat interval were incorrect. It seems any manual intervention to contact the Harmony Hub brings it online again - like editing the heartbeat interval. But it does not stay online for long,