Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Harmony activities not working after restarting hub #945

Closed
Ulisus opened this issue Mar 31, 2018 · 52 comments · Fixed by #1085
Closed

Harmony activities not working after restarting hub #945

Ulisus opened this issue Mar 31, 2018 · 52 comments · Fixed by #1085
Assignees
Milestone

Comments

@Ulisus
Copy link

Ulisus commented Mar 31, 2018

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

@bwssytems
Copy link
Owner

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

@Ulisus
Copy link
Author

Ulisus commented Apr 10, 2018

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.

@bwssytems
Copy link
Owner

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.

@bwssytems
Copy link
Owner

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

@Ulisus
Copy link
Author

Ulisus commented Apr 13, 2018

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

@bwssytems
Copy link
Owner

Will take a look

@bwssytems bwssytems self-assigned this Apr 13, 2018
@toms001
Copy link

toms001 commented Apr 22, 2018

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.

@bwssytems
Copy link
Owner

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

@Kat-CeDe
Copy link

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

@superczar
Copy link

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

@scholzmichael
Copy link

scholzmichael commented May 24, 2018

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)

@audiofreak9
Copy link
Collaborator

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

@superczar
Copy link

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

@toms001
Copy link

toms001 commented May 25, 2018

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

@bwssytems
Copy link
Owner

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

@superczar
Copy link

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

@bwssytems
Copy link
Owner

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.

@scholzmichael
Copy link

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

@superczar
Copy link

superczar commented Jun 3, 2018

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:https://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 :)

@scholzmichael
Copy link

scholzmichael commented Jun 21, 2018

Tried this now as well
curl -X PUT http:https://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)

@joshtaz
Copy link

joshtaz commented Jul 9, 2018

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

@bwssytems
Copy link
Owner

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

@bwssytems
Copy link
Owner

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

@bwssytems
Copy link
Owner

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

@pojomojo1982
Copy link

pojomojo1982 commented Dec 10, 2018 via email

@Gaspode69
Copy link

Gaspode69 commented Dec 17, 2018

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.

@JsChiSurf
Copy link

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.

@Gaspode69
Copy link

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

@JsChiSurf
Copy link

Dang, that doesn't look good.

@bwssytems
Copy link
Owner

bwssytems commented Dec 18, 2018

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.

@xnifex
Copy link

xnifex commented Dec 19, 2018

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

@scholzmichael
Copy link

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.

@Kat-CeDe
Copy link

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

@BetoRn
Copy link

BetoRn commented Dec 19, 2018

Home Assistant has already figured out a fix:

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

@bwssytems
Copy link
Owner

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

@Kat-CeDe
Copy link

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

@sgupta999
Copy link

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.

@superczar
Copy link

superczar commented Dec 21, 2018

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)

@bwssytems
Copy link
Owner

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

@glsf91
Copy link

glsf91 commented Dec 21, 2018

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

@scholzmichael
Copy link

same here, 210 allows access again

@ashokaiyar
Copy link

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

@bwssytems
Copy link
Owner

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.

@rubenkr
Copy link

rubenkr commented Dec 22, 2018

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!

@ashokaiyar
Copy link

@rubenkr

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

@Kat-CeDe
Copy link

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

@pojomojo1982
Copy link

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

@jluc2808
Copy link

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

@bwssytems
Copy link
Owner

Yep, still working on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.