Ha-bridge: Harmony activities not working after restarting hub

Created on 31 Mar 2018  Â·  52Comments  Â·  Source: bwssytems/ha-bridge

Hello,

i have my harmony hub set to automatically turn off at night via a switchable power outlet.

Now the problem is that after the hub is switched on again ha-bridge can't send any commands to it. I then have to restart ha-bridge and everything works fine again. (The hub is set to a fixed ip so that can't be causing any problems.)

Is there a workaround for this behaviour?

Thanks in advance...

enhancement question

Most helpful comment

So, the java-harmony-client library I use is being updated to use the websockets. When that is done and tested it will be included and released immediately with 5.2.2

All 52 comments

Is your hub assigned an ip address by dhcp? If so you need to have it be static.

The ip is assigned by DHCP but set as static in the router, so it is always the same.

The ip doesn't seem to be the problem since a ha-bridge restart (without changing any settings) resolves the problem.

Yes, that is correct. Since the way the harmony impl works, it assumes the hub is always up and keeps the connection running. Since you shutdown the hub, that connection is not valid and it does not try to reconnect.

Could you post your log from the command line as it will have an exception output that would let me take a look where this occurs and maybe we can try to see what to do. Thanks

Thanks for looking into it. Here you go:

2018-04-13 12:58:02,983 [Smack-Single Threaded Executor 0 (1)] INFO com.bwssystems.HABridge.plugins.harmony.HarmonyServer - activity changed: [-1] PowerOff
2018-04-13 13:17:46,199 [pool-1-thread-1] WARN net.whistlingfish.harmony.HarmonyClient - Send heartbeat failed
java.lang.RuntimeException: Failed communicating with Harmony Hub
at net.whistlingfish.harmony.HarmonyClient.sendOAStanza(HarmonyClient.java:328)
at net.whistlingfish.harmony.HarmonyClient.sendOAStanza(HarmonyClient.java:317)
at net.whistlingfish.harmony.HarmonyClient.sendPing(HarmonyClient.java:386)
at net.whistlingfish.harmony.HarmonyClient$2.run(HarmonyClient.java:181)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.jivesoftware.smack.SmackException$NoResponseException: No response received within reply timeout. Timeout was 5000ms (~5s). Waited for response using: net.whistlingfish.harmony.protocol.OAR
eplyFilter@64a2ff6a.
at org.jivesoftware.smack.SmackException$NoResponseException.newWith(SmackException.java:110)
at org.jivesoftware.smack.SmackException$NoResponseException.newWith(SmackException.java:97)
at net.whistlingfish.harmony.HarmonyClient.getNextStanzaSkipContinues(HarmonyClient.java:340)
at net.whistlingfish.harmony.HarmonyClient.sendOAStanza(HarmonyClient.java:326)
... 10 common frames omitted
2018-04-13 13:19:04,293 [qtp130212586-15] ERROR spark.http.matching.GeneralError -
java.lang.RuntimeException: Failed communicating with Harmony Hub
at net.whistlingfish.harmony.HarmonyClient.sendOAStanza(HarmonyClient.java:328)
at net.whistlingfish.harmony.HarmonyClient.startActivity(HarmonyClient.java:441)
at com.bwssystems.HABridge.plugins.harmony.HarmonyHandler.startActivity(HarmonyHandler.java:78)
at com.bwssystems.HABridge.plugins.harmony.HarmonyHome.deviceHandler(HarmonyHome.java:163)
at com.bwssystems.HABridge.hue.HueMulator.callUrl(HueMulator.java:1465)
at com.bwssystems.HABridge.hue.HueMulator.changeState(HueMulator.java:1220)
at com.bwssystems.HABridge.hue.HueMulator.lambda$39(HueMulator.java:444)
at spark.RouteImpl$1.handle(RouteImpl.java:72)
at spark.http.matching.Routes.execute(Routes.java:61)
at spark.http.matching.MatcherFilter.doFilter(MatcherFilter.java:130)
at spark.embeddedserver.jetty.JettyHandler.doHandle(JettyHandler.java:50)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1568)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:564)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:317)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
at org.eclipse.jetty.util.thread.Invocable.invokePreferred(Invocable.java:128)
at org.eclipse.jetty.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:673)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:591)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.jivesoftware.smack.SmackException$NotConnectedException: The connection HarmonyXMPPTCPConnection[client@1111/main] (1) is no longer connected. done=true smResumptionPossible=false
at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketWriter.throwNotConnectedExceptionIfDoneAndResumptionNotPossible(XMPPTCPConnection.java:1307)
at org.jivesoftware.smack.tcp.XMPPTCPConnection.throwNotConnectedExceptionIfAppropriate(XMPPTCPConnection.java:356)
at org.jivesoftware.smack.AbstractXMPPConnection.sendStanza(AbstractXMPPConnection.java:670)
at net.whistlingfish.harmony.protocol.HarmonyXMPPTCPConnection.sendStanza(HarmonyXMPPTCPConnection.java:49)
at net.whistlingfish.harmony.HarmonyClient.sendOAStanza(HarmonyClient.java:325)
... 26 common frames omitted

Will take a look

I got the same problem. My accesspoints autorestarts one time per day. After this, no commands are recognized in harmony-hub - i have to restart ha-bridge.

confirmed, just did it to myself as well. This change will need to be done in he harmony client library.

Hi,
all of my Hubs are also powered down when not used. I solved this problem with HarmonyHubControl and scripts like

!/bin/sh

./HarmonyHubControl MyHarmony-account MyHarmony-password $1 issue_device_command $2 $3
to control a device with the hub IP $1 to the device $2 and the command $3

with

!/bin/sh

./HarmonyHubControl MyHarmony-account MyHarmony-password $1 start_activity $2
I start the activity with ID $2 on hub with IP $1

HarmonyHubControl is open source and I compiled it for my 64bit QNAP which also runs HA-Bridge. I created the needed authorization token from Logitech on my linux system and copied it to the NAS.

Ralf

Same issue - My harmony buttons/activities stop responding after a power-cycle
The area I live in is prone to short brown-outs and while the bridge is on a UPS, the harmony hubs aren't
for now I have solved it with a script to restart the bridge after a power down/up event is detected

Also, I was wondering if it's possible to reinitialise the bridge(rather than restart) from the command line so that I can edit my script to reinitialise instead

Same here, restart of HA-Bridge needed every day after IP address change of my router.
Correction, its a timing issue (approx. once a day)

I too have the similar problem, ha-bridge on UPS, Harmony Hubs not, but cannot control Harmony Hubs after about a day. Utility power is not my root cause, just time. On v5.2.1

I am also on 5.2.1 but this problem has been around for some time now including the prev releases.
I am also not entirely sure if the issue is actually related to brown-outs or if it is time based - just that we get a brown-out of a few mins once or twice a day in the summers so I pinned it on that :)

For what it's worth, the hub restart script also sometimes fails to get the harmony devices back up - sometimes both will work and at times one or neither.
I have added a second restart after 20 seconds as one of the old tickets on this issue talks about a second re-init being required - let me see if that resolves it

Unfortunately the Harmony skills is also not available for my region (India) so this is the only choice I have

I got the problem since 5.2.1 - before i don't have to restart ha-bridge to make it working again.

I still have not gotten to researching this issue in the harmony library I use. Will look soon.

Quick request @bwssystems
Is it possible to reinitialise the bridge directly from cli/script?
At the moment I am using a cron job to restart the systemctl service every 4 hours but it's a bit of a hit & miss

Unfortunately, you have to restart the whole process as you are doing with the cron job. Re-init from the bridge does not reset the harmony library.

Hmm, reinit from web interface of HA-Bridge is good enough to make my harmony hubs functional again...no need for complete restart of PI or HA-Bridge, at least here

Same here
In fact a restart of ha-bridge sometimes fails to get harmony functional again but re-init seems to be doing the trick
For what it's worth, I figured out the re-init call via safari's timeline recording to get the required curl request :
curl -X PUT http://192.168.x.x/system/control/reinit

Calling the command above every 6 hours seems to have everything working as expected - unless of course someone decides to invoke a command exactly at 12:00:01 PM :)

Tried this now as well
curl -X PUT http://192.168.x.x:xx/system/control/reinit
but can't get it to work via my LMAir

edit: working now, authentication failure, had to adjust security settings (user/pw deleted)

Any update on this? Harmony works great for me for 3-6 hours and then stops working.

Haven't gotten around to updating the code yet. The life of open software....

ha-bridge will now detect failure and try to reconect.

Harmony communication does still not work after hub restart here with 5.2.2RC2. Allthough Alexa now confirms "ok" on a Harmony activity nothing happens, it works after a bridge reinit though.
Log shows:

WARN | Send heartbeat failed | net.whistlingfish.harmony.HarmonyClient
then
WARN | Issue in communcicating with Harmony Hub, retrying connect....
but without reinit of ha bridge communication will not pick up again

Ok, thanks, will take a look

Please fix this. This is a real issue and has brought my system down (6 hubs) down to a cripple since I upgrade to v5.x.

@aameradam Will get to it when I can.... This is not a commercial product.... It gets worked on when I have time.

Agreed. Did not mean to imply otherwise. Appreciate you maintaining this
codebase.

On Mon, Dec 10, 2018 at 9:28 AM BWS Systems notifications@github.com
wrote:

@aameradam https://github.com/aameradam Will get to it when I can....
This is not a commercial product.... It gets worked on when I have time.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/bwssytems/ha-bridge/issues/945#issuecomment-445834167,
or mute the thread
https://github.com/notifications/unsubscribe-auth/Aax9L5A8xczAytNTnFNxdyLuLygHNcyxks5u3m-pgaJpZM4TCf_g
.

>

Sent from my iPhone

Hi,
I came here from issue #1034 (Harmony Hub Communication Lost #1034), which is classified as duplicat of this issue here.
Is this really the same issue? For me, everything worked perfekt until 2 hours ago. Suddenly the LED of my Harmony Hub started flashing for about 5 minutes (probably forced Firmware Update?). Since then I get no connection from HA bridge to Harmony Hub at all. In the log file I get the message "Cannot get harmony client (HarmonyHub) setup, Exiting with message: Failed communicating with Harmony Hub"
Other as described in this issue here, there is no chance to get it working. Reinitializing the bridge does not help either.
Also restarting the Harmony Hub does not help. The problem suddenly occurred with HA Bridge 5.0.0. Now I tested with the latest RC 5.2.2 which does also not work.

Hi,
I came here from issue #1034 (Harmony Hub Communication Lost #1034), which is classified as duplicat of this issue here.
Is this really the same issue? For me, everything worked perfekt until 2 hours ago. Suddenly the LED of my Harmony Hub started flashing for about 5 minutes (probably forced Firmware Update?). Since then I get no connection from HA bridge to Harmony Hub at all. In the log file I get the message "Cannot get harmony client (HarmonyHub) setup, Exiting with message: Failed communicating with Harmony Hub"
Other as described in this issue here, there is no chance to get it working. Reinitializing the bridge does not help either.
Also restarting the Harmony Hub does not help. The problem suddenly occurred with HA Bridge 5.0.0. Now I tested with the latest RC 5.2.2 which does also not work.

While I did not see this thread until after, as mentioned in my thread, I was thinking the same thing after having been pointed here and reading through. No amount of re-initializing would seem to matter if it can't communicate with the hub in the first place. I did not see that the hub had been upgraded, but will verify from my side when returning home as well to compare firmware versions.

I fear this is something completely different. Logitech obviously blocks port 5222 with their latest firmware 4.15.206! The installation of this firmware was done automatically on my HUB!
See https://community.logitech.com/s/question/0D55A00008D1oIoSAJ/firmware-update-blocked-api-access

Dang, that doesn't look good.

Another post about this as well

https://www.home-assistant.io/blog/2018/12/17/logitech-harmony-removes-local-api/

Might be a big problem, but based on the comments at the logitech forum, it looks as this will be back as it has made many users angry and logitech seems to be listening.

looks like Logitech has come out & said they will NOT be fixing the local API.

This is what I read as well. In this case Logitech is dead for me, allready looking for an alternative. Maybe NEEO, unfortunately there is not a lot of alternatives on the market.

Hi,
I did a downgrade today and blocked the recommended IP in PiHole. I also will buy a Neeo today and Broadlink might also be an alternative option.

Disappointed by Logitech Ralf

I need to review that as at one point it looks like HA still doesn't want any one to go past 4.15.193 version

Hi,
to be exact .201 was the last working official version. All the world is talking about .193 because this is the version you get when you downgrade.

Ralf

I can confirm using link above follow instructions to downgrade hub to 4.15.93
Took me a while to figure out how to repair the hub to HA Bridge - if i tried it in myHarmony or on iPhone it would upgrade firmware.

Essentially you delete and readd hub in bridge control. Hit Save and it will reinitialize and pair.

I block the offending URLS in my dns server for the hub and phone - so I can still control them with my phone and through HA Bridge.

If I have to add or modify activity or device - I will have to upgrade firmware make the change and then redo the whole process.

Logitech needs to figure this out.

I haven't updated or changed anything on my hubs in ages.
Blocked Internet access altogether on both hubs on my router (Sophos XG) and rolled back HA bridge to 5.2.1

All is good for now - well, at least until I change any of my IR controlled devices and need to update the hub settings

Coming to think of it, I went through the pain of importing these hubs to India and for what..
If only broadlink devices would come with a physical remote - sigh!

@sgupta999 - AFAIK, the downgrade process will roll back your hub to the previous release version
Thus once the next version of the FW comes out, the downgrade process will get you back to the current version (with local API closed)

So, the java-harmony-client library I use is being updated to use the websockets. When that is done and tested it will be included and released immediately with 5.2.2

@bwssytems
Logitech have just made an update on the item. See: https://community.logitech.com/s/question/0D55A00008D4bZ4SAJ/harmony-hub-firmware-update-fixes-vulnerabilities

Use of local API is possible again. I updated the hub already.

same here, 210 allows access again

@bwssytems

Will 5.2.2 have an option to continue using XMPP (now that it is re-enabled) or will we have to switch to websockets?

If I have to switch to websockets when 5.2.2 is released, will I have to re-add my Harmony Hub and re-create Bridge devices that use the Harmony Hub?

I will leave the xmpp for now, but if I did switch to websockets, you not see a difference in operation as it is handled for you.

Hi,
I did a downgrade today and blocked the recommended IP in PiHole. I also will buy a Neeo today and Broadlink might also be an alternative option.

Disappointed by Logitech Ralf

which host/ip did you block in pihole to stop automatic updates? thanks!

@rubenkr

Install the developer firmware (v .210). It adds XMPP support back, and you don't need to back any domains.

Hi,
I blocked:
svcs.myharmony.com
pubsub.pubnub.com
content.dhg.myharmony.com
logging.dhg.myharmony.com
myharmony.com
sus.dhg.myharmony.com

found this as a solution on reddit.

Ralf

This issue is still there in RC3.

Harmony communication does still not work after hub restart here with 5.2.2RC3. Allthough Alexa now confirms "ok" on a Harmony activity nothing happens, it works after a bridge reinit though.
Log shows:

WARN | Send heartbeat failed | net.whistlingfish.harmony.HarmonyClient
then
WARN | Issue in communcicating with Harmony Hub, retrying connect....
but without reinit of ha bridge communication will not pick up again

hello, i get the same problem with heartbeat failed with my harmony Hub and alexa.
does this issue still alive ?

Yep, still working on this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jayjupdhig picture jayjupdhig  Â·  55Comments

altheeagle picture altheeagle  Â·  27Comments

bwssytems picture bwssytems  Â·  68Comments

painkillerde picture painkillerde  Â·  46Comments

tonlof picture tonlof  Â·  32Comments