Harmony hub loses connection frequently

I have my harmony hub linked in Hassio but it looses connection and becomes unavailable multiple times per day.

I have an automation that monitors it and runs the harmony.sync service to try and get it back again. ( I also have a notification fired to the mobile app)
It works, but it’s happening 20+ times per day!

Is this a known bug?
Is there a ‘proper’ fix?
From what I’m seeing in search results I can’t find one?

Appears you’re the only one with this problem. That points to network issues.

You assume this false.

I own 2 harmony hubs: One reboots about once a week, the other one every 2-3 days, but some times more often, most while heavy using the hub scrolling through films on the fire tv or zipping though the programs. And that is not a network issue, as all other devices stay connected.

A colleague has this problem, too.

It would be easier to live with it, if the harmony integration would reconnect automatically if the connection drops.

That’s the thing, the remotes I own never disconnect from HA.

Could you describe what you did in detail? This would help me to get the hub reconnected.

I think the reboot problem of the hub is temperature related. I moved one hub away from other heatsources and the reboot-rate dropped.

Then you are a lucky one.

Whats the signal strength where your hub is located? Also, what protocol are you using XMPP or the API?

100%. It is 3m in direct sight to the access-point. And it is not access-point related as this was changed twice since I use the harmony hub.

Logs when disconnecting?

also, if your remote is going ‘unavialable’, then this automation could give it a 2 minute rest (for it to cool down), and it will perform the sync:

- alias: Restart Harmony
  trigger:
  - platform: state
    state: unavailable
    entity_id: remote.harmony
    for:
      minutes: 2
  action:
  - service: harmony.sync
    entity_id: remote.harmony
1 Like
2020-07-29 12:05:57 ERROR (MainThread) [slixmpp.basexmpp] [Errno 111] Connect call failed ('192.168.2.112', 5222)
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/slixmpp/xmlstream/xmlstream.py", line 834, in handler_callback_routine
    await cb(data)
  File "/usr/local/lib/python3.8/site-packages/aioharmony/hubconnector_xmpp.py", line 277, in _disconnected_handler
    if await self.hub_connect(is_reconnect=is_reconnect):
  File "/usr/local/lib/python3.8/site-packages/aioharmony/hubconnector_xmpp.py", line 188, in hub_connect
    await connected
  File "/usr/local/lib/python3.8/site-packages/slixmpp/xmlstream/xmlstream.py", line 328, in _connect_routine
    await self.loop.create_connection(lambda: self,
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 1025, in create_connection
    raise exceptions[0]
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 1010, in create_connection
    sock = await self._connect_sock(
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 924, in _connect_sock
    await self.sock_connect(sock, address)
  File "/usr/local/lib/python3.8/asyncio/selector_events.py", line 494, in sock_connect
    return await fut
  File "/usr/local/lib/python3.8/asyncio/selector_events.py", line 526, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 111] Connect call failed ('192.168.2.112', 5222)

I use the normal integration, can’t see a setting there, but I assume it is XMPP by the error message.

grafik

OK, I will give it a try.

Is there a way to switch between XMPP and API?

My learning from having the same issue - harmony hubs do not like high channel settings, use 1 or 6, avoid 11 - might be unstable (don’t ask me why, found it by trial and error). Same with channel width, limit it to 20MHz, do not use Auto or forced 40MHz. If you have more than 1 AP or mesh network… hubs do not like switching between APs, I had to disable roaming.

3 Likes

Here also 1 Hub never disconnect as well. In past I have this problem. Changed the channel of the wifi , because lots of other wifi signals used same channel, since then no problem at all

I have to disagree. One should never assume.
All other aspects of my network run OK, with no connection drops / timeouts / losses etc.
The integration was working flawlessly before upgrading hassio.
I cant pinpoint exactly when the problem started, as its one of those that just runs, but for sure after bumping to hassio 0.90+
And it has become more frequents since i started monitoring and upgraded to 0.113.

My hub doesn’t seem to be rebooting, as it is still functional from the physical harmony remote, only home assistant cannot ‘access’ it :man_shrugging:

So theres no chance of others having problems… :thinking: :wink:

Hub is approx. 6-7 feet away from the router. It doesn’t have a 100% clear line of sight, but other devices right next to the hub work OK. Not a router issue.
Im not sure how i can check the actual strength of signal the hub is getting, but my phone right next to the hub on the same ssid sees approx. -45dBm signal strength
Again, in my opinion this is not the issue

Whatever is standard for me. I didn’t even know there was a way to change?
Is there? Please let me know if its possible, I’m willing to try anything at this juncture.

This is interesting.
My ISP (Sky in the UK) provided router is very limited in what i can actually change, channel selection is currently set to auto, and is using 1 at the minute.
I don’t seem to have an option to change width for a 2.4GHz …there is a mode option, but its grayed out…not changeable.

Finally, here is some output from the log. This appears multiple times
I dont see anything like @sublevel7 posted above

2020-08-04 21:37:29 ERROR (MainThread) [aioharmony.hubconnector_websocket] 192.168.0.191: Connection timed out for hub 14271593
2020-08-04 21:37:32 ERROR (MainThread) [homeassistant.components.automation] Harmony Hub Monitor: Error executing script. Service not found for call_service at pos 2: Unable to find service remote/harmony_sync
2020-08-04 21:37:32 ERROR (MainThread) [homeassistant.components.automation] While executing automation automation.harmony_hub_monitor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 409, in async_trigger
      await self.action_script.async_run(variables, trigger_context)
        File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 790, in async_run
            await asyncio.shield(run.async_run())
              File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 185, in async_run
                  await self._async_step(log_exceptions=False)
                    File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 193, in _async_step
                        await getattr(
                          File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 382, in _async_call_service_step
                              await service_task
                                File "/usr/src/homeassistant/homeassistant/core.py", line 1231, in async_call
                                    raise ServiceNotFound(domain, service) from None
                                    homeassistant.exceptions.ServiceNotFound: Unable to find service remote/harmony_sync

Sorry for the long post!

Will this be the problem? I don’t know how wifi devices will handle when every minute channel change…

From my experiences this isn’t (hasnt) been an issue in the past.
No other wifi connected devices have issues with the auto channel selection.
I dont think the channel is changing every minute. Ive only ever seen channel 1 in use.
I can manually select it as a test.

No, but in software it doesn’t just magically change from one user to the next. Configuration & Networks change. The configuration on home assistant’s side is just and IP and Port. There’s little to no configuration on harmonys side. So what does that leave for trouble shooting? Just take a look at the other gentleman that replied. His issue is completely different than you. He’s using XMPP and you’re using the websocket API. 2 separate connection protocols.

Based on your logs, the communication is timing out. That points to network connection issues as well or routing issues.

Are you able to ping the harmony ip & port after the connection drops? This line here indicates the drop:

2020-08-04 21:37:29 ERROR (MainThread) [aioharmony.hubconnector_websocket] 192.168.0.191: Connection timed out for hub 14271593

Also, when is the last time you reset the hub? I’ve had to reset mine from time to time, once every 3 months just about because the hub stops communicating with my Yamaha receiver.

This is changed through the app. Harmony Setup → Add / Edit Device & Activities → Remote & Hub → Enable XMPP.

Back in december of 18 - Jan 19, harmony disabled this protocol. This is how HA originally communicated with the Harmony Remote. The whole entire open source community (not just HA) through a fit. Sometime in February `19, they reenabled it, but you had to opt into the protocol.