Core: 2nd Harmony Hub is marked as "Unavailable"

Created on 12 Jan 2019  路  26Comments  路  Source: home-assistant/core

Home Assistant release with the issue:

0.85.0

Last working Home Assistant release (if known):

0.84.6

Operating environment (Hass.io/Docker/Windows/etc.):

Docker

Component/platform:

remote.harmony

Description of problem:

Starting in 0.85.0, only one Harmony Hub connects to Home Assistant; my second Hub shows as "Unavailable".

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

remote:
  - platform: harmony
    name: Basement TV
    host: 192.168.1.101

Traceback (if applicable):

192.168.1.101: Exception trying to establish web socket connection for hub 14130751: [Errno 104] Connection reset by peer

Additional information:

I am able to ping the device on the local network and can access it locally through the Harmony app.

harmony

Most helpful comment

It seems that depending on which platform HA runs on the websocket connection might get reset.

If the issue is that upon start of HA it is working but after certain amount of time it stops, and solution is then to restart HA and then it works again; that issue is fixed and part of 0.86. Upon disconnect it would only try to reconnect once and then nothing.
With the change coming with 0.86 it will keep on trying to reconnect every 10 seconds.

All 26 comments

I saw this too, I ended up unplugging the hub in question and restarting HA once or twice and it was able to connect and work again.

I have a venv install.

FWIW, a hub unplug/re-plug + a HASS restart made it available. I鈥檒l leave this open for a bit in case there is a bug.

My hub becomes unavailable in homeassistant when I power cycle it (I switch it of when we sleep or are away). So I need to restart home assistant everytime to get it available again. Didn't have this issue with the previous versions. Any ideas on how to fix this? Discovery doesn't seem to pick up my hub so I have it configured by ip in the configuration file.

HA v 0.85

When I restart Homeassistant everything works, however after a while (last time it was an hour) the hub becomes unavailable and I got the following error:

Exception trying to establish web socket connection for hub 1034689: Cannot connect to host 192.168.1.107:8088 ssl:None [Connect call failed ('192.168.1.107', 8088)]

When I restart Homeassistant everything works, however after a while (last time it was an hour) the hub becomes unavailable and I got the following error:

Exception trying to establish web socket connection for hub 1034689: Cannot connect to host 192.168.1.107:8088 ssl:None [Connect call failed ('192.168.1.107', 8088)]

Same issue happens to mine. Works well for a while but in some moment it breaks and I need to restart HA for it to work again. Last time it broke right after executing an order.

Same here, altho the device is online, and can be pinged, it appears HA does not reach it..

My hub becomes unavailable in homeassistant when I power cycle it (I switch it of when we sleep or are away). So I need to restart home assistant everytime to get it available again. Didn't have this issue with the previous versions. Any ideas on how to fix this? Discovery doesn't seem to pick up my hub so I have it configured by ip in the configuration file.

HA v 0.85

Have you opened a bug report for this? I do have the same issue when restarting the hub.
If you did not open a bug for this, i'd be happy to do so

@speedmann This _is_ that bug...unless I'm misunderstanding you?

@bachya this one sounds like when you have two harmony hubs connected, one does not work (most of the times).
I am not sure if this are two different things of if this is just me understanding this wrong.
If it is me, ignore me and i will watch this issue if i can add any usefull information

I have the same problem, although I only have one hub.

I have also the same problem and I have two hubs.

Same problem here, i have only one hub, can i help by uploading some logs? if so let me know. got it running in venv and last version it worked on 0.84.5 i went straight to 0.85.1 and stopped working. Hub is online, pingable and harmony remote itself works as aspected, just ha stopped working with it.

CC: @ehendrix23

It seems that depending on which platform HA runs on the websocket connection might get reset.

If the issue is that upon start of HA it is working but after certain amount of time it stops, and solution is then to restart HA and then it works again; that issue is fixed and part of 0.86. Upon disconnect it would only try to reconnect once and then nothing.
With the change coming with 0.86 it will keep on trying to reconnect every 10 seconds.

@ehendrix23 would be nice if the reconnect interval can be set. For my use case every minute or every five minutes would also be fine.

@wmn79, currently no plans to do so. Figuring that trying to reconnect is pretty light-weight. Future small change will be so that no errors will be logged on reconnects.

Future small change will be so that no errors will be logged on reconnects.

Following the recommendations it would look like 1 warning on first failure, debug on subsequent (below the logging threshold for most people), and then info on reconnect success. This could end up spamming the logs if it fails and has to reconnect every 10 sec, but that seems like something else is broken then.

@andrewsayre , right now in the updated code (not yet available in HA) I have it as follows:

Upon initial connect log error when unable to connect. Thus when HA starts and for some reason unable to connect then error will be logged. This will happen each time HASS then tries to start the platform again for that Harmony HUB.

Upon reconnect, log error when trying to reconnect the 1st time. After that no errors will be logged again.

Upon successful connect again nothing is logged (only core HA is allowed to log info).

What I'll change further is when no error is logged (on continued reconnects) that I will then provide a DEBUG message instead.

Do you think that would achieve it?

Thanks for the input!

Do you have a PR or commit I can look at? Might be better place to move this conversation to. :)

I'm having the same issue. I have three hubs, one is consistently going to an "unavailable" status after some time; the other two are rock solid. All three are on the 206 firmware.

@KenCote, what version of HA are you on? Version 0.86 fixed the reconnect if connection is lost.

@ehendrix23 I updated to 0.86 a couple days back and it's been solid. Thanks.

I'm having similar problems where one or more of my hubs fails to connect, sometimes is marked unavailable etc.. This started in a later release of 0.85.x or 0.86. I am currently on 0.86.3 (Hassio) and getting this behavior.

my config:

remote:
  - platform: harmony
    name: Sean Room
    host: 192.168.1.4
    activity: TV

  - platform: harmony
    name: Living Room
    host: 192.168.1.170

  - platform: harmony
    name: Bedroom Hub
    host: 192.168.1.231

error:

Log Details (ERROR)
Mon Jan 28 2019 16:17:18 GMT-0500 (Eastern Standard Time)

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 225, in coro
    res = yield from await_meth()
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/remote/harmony.py", line 262, in got_connected
    await self.new_config()
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/remote/harmony.py", line 255, in new_config
    await self.hass.async_add_executor_job(self.write_config_file)
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/remote/harmony.py", line 418, in write_config_file
    json.dump(self._client.json_config, file_out,
  File "/usr/local/lib/python3.6/site-packages/aioharmony/harmonyapi.py", line 93, in json_config
    for activity in config.get('activity'):
TypeError: 'NoneType' object is not iterable

I notice that after I restart HA lately, my harmony_sean_room_hub.conf becomes a blank 0kb file. And it makes my remote unusable through HA. I try to resync it under Services -> remote.harmony_sync and sometimes it works, but not lately.

2019-01-28 16:15:52 ERROR (MainThread) [homeassistant.components.remote] Setup of platform harmony is taking longer than 60 seconds. Startup will proceed without waiting any longer.
2019-01-28 16:15:59 ERROR (MainThread) [aioharmony.harmonyclient] 192.168.1.4: Timeout trying to retrieve current activity.
2019-01-28 16:15:59 ERROR (MainThread) [aioharmony.harmonyclient] 192.168.1.4: Timeout trying to retrieve current activity.


2019-01-28 17:34:24 ERROR (MainThread) [homeassistant.components.remote.harmony] Sean Room: Syncing hub with Harmony cloud timed-out
2019-01-28 17:37:50 ERROR (MainThread) [homeassistant.components.remote.harmony] Sean Room: Syncing hub with Harmony cloud timed-out
2019-01-28 17:39:22 ERROR (MainThread) [homeassistant.components.remote.harmony] Sean Room: Syncing hub with Harmony cloud timed-out
2019-01-28 17:43:03 ERROR (MainThread) [homeassistant.components.remote.harmony] Sean Room: Syncing hub with Harmony cloud timed-out
2019-01-28 17:49:40 ERROR (MainThread) [homeassistant.components.remote.harmony] Sean Room: Syncing hub with Harmony cloud timed-out

Not quite sure what's going on.

It seems that it is having issues connecting to that specific HUB. Can you make sure that HUB is running latest firmware as well. Harmony also has an app, can you see if you can control/connect from it.

Further, can you add the following for debug:

logger:
  default: warning
  logs:
    aioharmony.hubconnector: debug

That enables debugging on the connection portion.

Thx.

I've added the logging info and rebooted but not sure if I should share the logs publicly here since it has my email address and perhaps even more sensitive information? I'm Sean#2149 on the Discord.

I'm on Hub software 4.15.206 which should be the latest. So far I've noticed the following behavior:

1) It never gets added and remote is grayed out "Unavailable" . This has only happened once or twice.

2) It gets half added where the remote shows up in HA but there's a 0kb blank/empty "harmony_sean_room.conf" file and any time I attempt a command through HA it'd do nothing except have a "Device Unavailable" message in the logs (or something similar). I assume that it was finding my remote but timing out before it could download the JSON data or something?

3) It gets added under my hubs OLD name ("Sean's Room" rather than "Sean Room"). This changes the entity_id from "remote.sean_room" to "remote.sean_s_room" which breaks the references in all my scripts/automations making them unusable.

It's basically a dice roll every time I restart HA. Sometimes it works properly and other times I get 2 or 3 on the list above.

The Harmony iOS app says "Sean Room" at the top and on the hub select screen. My config says "Sean Room" too. The debug log information even says 'friendlyName': 'Sean Room', and 'host_name': 'Sean Room', yet in HA it's showing up differently as "Sean's Room" (older name).

I'm not sure why it's using the older name of my hub, seemingly at random. Perhaps it's an issue with the discovery feature or some old hidden reference / cache somewhere?

During these connectivity issues with HA, I could always use the physical remote (a Harmony Ultimate One) perfectly fine and the iOS app perfectly fine. I was successfully able to ping the hub IP every time too. Really weird and confusing.

I think #21213 addressed this; going to close.

Was this page helpful?
0 / 5 - 0 ratings