Harmony hub loses connection frequently

Yep, agreed. Software doesn’t ‘magically change’, but it does get updated.
Hassio has been updated multiple times since the problem presented. And the latest harmony hub firmware update v4.15.264 was pushed around March time I think.
I’m not ‘blaming’ hassio, or Harmony for that matter. Just looking for help.

I should have specified, my network has not changed at all. Same hardware / software. All DNS queries made by the hub are answered, as are any Hassio initiated queries.

With regards to the protocol being used, websocket API or XMPP, how can one configure this? Is it auto selected by hassio / harmony?

I have not tried pinging the hub when hassio loses connection, timing it wont be easy. But for sure i will try. My guess would be it would respond OK. This is based on the physical harmony remote working 100% of the time and the mobile harmony app working 100% of the time.

Hub was reset within the last 2 months ish, cant remember precisely when.

The physical remote does not use internet connection or a network connection to communicate with the hub. It uses RF to communicate with the hub. So this is 100% separate from your network connection.

If you attempt to edit your activities it will force the hub to connect to the internet. So that would be a valid test.

I replied to this before you answered

I use the harmony hub together with HA for over 2 years now and I also did not have a single disconnect in this time.

yes, you’re right. I hadn’t thought of this
Editing activities does work, although the “Connecting to HArmony Servers” loading screen does seem to hang for a while, maybe 20-25 seconds before i get to the actual editing screen.

Yes, now you have pointed me there, i remember seeing it when i was first exploring the app, but immediately dismissed activating it because of the vulnerability warnings given.
Are there any real risks?

Just another note, maybe unrelated…the speed at which my activities run can vary hugely, both when using Hassio to activate them or the physical remote, or Google assistant.
As in it will run immediately one time, then the next it takes 15+ seconds.
Both powering on and off activities, or switching activities.

I mean, it’s the same risks you had before when using XMPP. It doesn’t do a ‘is this really you’ check. So, if you have a dude who is really experienced at XMPP he could in theory turn stuff on and off.

Makes sense I guess.
I’ll try and catch a connection loss and attempt to ping the hub.
Then I may try switching to XMPP, see if the problem persists.

as an FYI, harmony used XMPP for years before fixing this “Hole”. So, you’re not risking anything new if you used XMPP prior to december 2018.

I got the hub in January 2019, so chances are I have never used XMPP.
seems like in switching to XMPP I would be exposing myself to a greater risk, albeit a very small risk.

Then you are lucky. My problem is not direct HA related, as the reboots started before I had my HA working.

It’s for shure a reboot with the hubs I know, as you are not able to use the connected companion remote control and the control LED is red for about 30 seconds Logitech gives for the boot time.

Just tried this having managed to catch a drop
Seems I was wrong…I can’t ping the hub

So I switched to XMPP, and I still see the hub losing connection, if anything more often…so often in fact, i have stopped the notifications on my phone!

Just looking at the logs again:

Log Details (ERROR)
Logger: aioharmony.helpers
Source: runner.py:119
First occurred: 9:32:13 AM (2 occurrences)
Last logged: 9:32:14 AM

get_config was not called due to mismatch in callback type.
discovery was not called due to mismatch in callback type.
Log Details (ERROR)
Logger: aioharmony.hubconnector_websocket
Source: runner.py:119
First occurred: August 5, 2020, 12:37:06 PM (202 occurrences)
Last logged: 9:41:24 AM Connection timed out for hub 14271593

Some more XMPP related log entries:

2020-08-07 10:17:30 ERROR (MainThread) [aioharmony.harmonyclient] Unable to determine if XMPP is enabled: [Errno 113] Connect call failed ('', 5222)

still getting errors on this unfortunately
Can anyone help me? Any ideas on further diagnosis?

2020-08-10 14:29:39 DEBUG (MainThread) [aioharmony.harmonyclient] Initialize HUB
2020-08-10 14:29:39 DEBUG (MainThread) [aioharmony.harmonyclient] XMPP is enabled
2020-08-10 14:29:39 DEBUG (MainThread) [aioharmony.harmonyclient] Using XMPP
2020-08-10 14:29:43 DEBUG (MainThread) [aioharmony.harmonyclient] Retrieving HUB information
2020-08-10 14:29:44 DEBUG (MainThread) [aioharmony.harmonyclient] Getting configuration
2020-08-10 14:29:45 DEBUG (MainThread) [aioharmony.harmonyclient] Harmony Hub Lounge: Retrieving current activity
2020-08-10 14:29:45 DEBUG (MainThread) [aioharmony.harmonyclient] Harmony Hub Lounge: Current activity: Play Xbox One(39772232)
2020-08-10 14:29:45 DEBUG (MainThread) [aioharmony.harmonyclient] Harmony Hub Lounge: HUB configuration version is: 243
2020-08-10 14:29:45 DEBUG (MainThread) [aioharmony.harmonyclient] Harmony Hub Lounge: HUB ID : 14271593
2020-08-10 14:29:45 DEBUG (MainThread) [aioharmony.harmonyclient] Harmony Hub Lounge: Connected to HUB on IP with ID 14271593.
2020-08-10 14:29:45 INFO (MainThread) [homeassistant.components.remote] Setting up remote.harmony
2020-08-10 14:35:09 ERROR (MainThread) [aioharmony.hubconnector_xmpp] Connecting to HUB failed with error: [Errno 113] Connect call failed ('', 5222)
2020-08-10 14:35:53 ERROR (SyncWorker_1) [homeassistant] Error doing job: Task was destroyed but it is pending!

Note the SyncWorker error.
Im unsure if this is related

If your hub is disconnecting from your network frequently, you gotta take a look from your network side. See what settings harmony requires in order to work. HA wont’ be able to do anything if the hub is dropping from the network.

There’s no logic as to why it (might be) losing connection.
And im unsure on where to look now.
Both connection methods, websocket and XMPP seem to present the same issue.
I have pihole running on my network, and all requests made by the hub are answered.

but you said it yourself. When this happens, you can’t ping it. If a computer can’t ping it, how can home assistant?

Correct, i cant ping it, but only for a moment, and we’re talking seconds
leaving ping just run on the IP of the hub returns cannot reach host, for maybe 2-3 seconds, then i get a response.
Now i understand this is enough to throw HA potentially, but there doesnt seem to be any reconnection to the hub by Hassio.

Maybe i have 2 issues here then?

  1. My hub keeps loosing connection
  2. Hassio will not reconnect to harmony once it loses connection

And it won’t. Typically that is by design. You’re welcome to write the issue up on github but I personally wouldn’t be surprised if nothing is done about it. That’s why I’m urging you to look over your network and it’s settings. I see a ton of issues when google searching harmony and frequent disconnects.

I have done a huge amount of searching. Maybe i need to up my google game
As for my network, i am confident there are no issues.
That said, i can use the new features of pihole to have the hub bypass pihole completely…just to be extra sure.
Although no requests made by the hub are blocked, so im certain it wont make any difference.

Don’t know what else to tell you. You keep saying your network is rock solid but your device keeps disconnecting. To me, that means a setting is incorrect on the lan or wan.

I’m also seeing issues when people are using extenders or mesh networks. If you have 2 waps, you might want to assign a different SSID to the closest wap and have it only login to that wap.