core: New (0.84.5) harmony component fails with "websockets.exceptions.InvalidStatusCode" on 3 of 4 Harmony Hubs

Home Assistant release with the issue: 0.84.5

Last working Home Assistant release (if known): N/A - issue was triggered by changes made in latest Harmony firmware

Operating environment (Hass.io/Docker/Windows/etc.): Standard Home Assistant install in a Python venv on Ubuntu 18.04 LTS. Details:

(homeassistant) homeassistant@hass:~/.homeassistant$ hass --version
0.84.5
(homeassistant) homeassistant@hass:~/.homeassistant$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.1 LTS"
(homeassistant) homeassistant@hass:~/.homeassistant$ python3 --version
Python 3.6.7

4 x Harmony Hubs running new 206 firmware.

Component/platform: remote.harmony

Description of problem:

  1. From inside the venv installed websockets via: pip3 install websockets
  2. Start Home Assistant using previous configuration w/ 4 Harmony Hubs defined (see below for configuration.yaml
  3. Three hubs report error similar to the following:
Dec 19 11:54:10 hass hass[17432]: 2018-12-19 11:54:10 ERROR (MainThread) [homeassistant.helpers.entity] Update for remote.living_room fails
Dec 19 11:54:10 hass hass[17432]: Traceback (most recent call last):
Dec 19 11:54:10 hass hass[17432]:   File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 221, in async_update_ha_state
Dec 19 11:54:10 hass hass[17432]:     await self.async_device_update()
Dec 19 11:54:10 hass hass[17432]:   File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 347, in async_device_update
Dec 19 11:54:10 hass hass[17432]:     await self.async_update()
Dec 19 11:54:10 hass hass[17432]:   File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/remote/harmony.py", line 203, in async_update
Dec 19 11:54:10 hass hass[17432]:     await self._client.get_config()
Dec 19 11:54:10 hass hass[17432]:   File "/srv/homeassistant/lib/python3.6/site-packages/pyharmony/client.py", line 205, in get_config
Dec 19 11:54:10 hass hass[17432]:     'vnd.logitech.harmony/vnd.logitech.harmony.engine?config'
Dec 19 11:54:10 hass hass[17432]:   File "/srv/homeassistant/lib/python3.6/site-packages/pyharmony/client.py", line 158, in _send_request
Dec 19 11:54:10 hass hass[17432]:     await self._perform_connect()
Dec 19 11:54:10 hass hass[17432]:   File "/srv/homeassistant/lib/python3.6/site-packages/pyharmony/client.py", line 129, in _perform_connect
Dec 19 11:54:10 hass hass[17432]:     self._ip_address, DEFAULT_HUB_PORT, self._remote_id
Dec 19 11:54:10 hass hass[17432]:   File "/srv/homeassistant/lib/python3.6/site-packages/websockets/py35/client.py", line 20, in __await_impl__
Dec 19 11:54:10 hass hass[17432]:     extra_headers=protocol.extra_headers,
Dec 19 11:54:10 hass hass[17432]:   File "/srv/homeassistant/lib/python3.6/site-packages/websockets/client.py", line 286, in handshake
Dec 19 11:54:10 hass hass[17432]:     raise InvalidStatusCode(status_code)
Dec 19 11:54:10 hass hass[17432]: websockets.exceptions.InvalidStatusCode: Status code not 101: 401
  1. Errors repeat approximately every 6 seconds.
  2. The fourth hub (“Garden Bedroom”) initializes on Hass start and works as expected.

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

remote:
  - platform: harmony
    host: 10.0.100.6
    name: Bedroom
    activity: Watch Roku
  - platform: harmony
    host: 10.0.100.146
    name: Lauras Bedroom
    activity: Watch Lauras Desktop
  - platform: harmony
    host: 10.0.100.9
    name: Garden Bedroom
    activity: Roku
  - platform: harmony
    host: 10.0.100.8
    name: Living Room
    activity: Roku

Traceback (if applicable):

Dec 19 11:54:10 hass hass[17432]: 2018-12-19 11:54:10 ERROR (MainThread) [homeassistant.helpers.entity] Update for remote.living_room fails
Dec 19 11:54:10 hass hass[17432]: Traceback (most recent call last):
Dec 19 11:54:10 hass hass[17432]:   File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 221, in async_update_ha_state
Dec 19 11:54:10 hass hass[17432]:     await self.async_device_update()
Dec 19 11:54:10 hass hass[17432]:   File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 347, in async_device_update
Dec 19 11:54:10 hass hass[17432]:     await self.async_update()
Dec 19 11:54:10 hass hass[17432]:   File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/remote/harmony.py", line 203, in async_update
Dec 19 11:54:10 hass hass[17432]:     await self._client.get_config()
Dec 19 11:54:10 hass hass[17432]:   File "/srv/homeassistant/lib/python3.6/site-packages/pyharmony/client.py", line 205, in get_config
Dec 19 11:54:10 hass hass[17432]:     'vnd.logitech.harmony/vnd.logitech.harmony.engine?config'
Dec 19 11:54:10 hass hass[17432]:   File "/srv/homeassistant/lib/python3.6/site-packages/pyharmony/client.py", line 158, in _send_request
Dec 19 11:54:10 hass hass[17432]:     await self._perform_connect()
Dec 19 11:54:10 hass hass[17432]:   File "/srv/homeassistant/lib/python3.6/site-packages/pyharmony/client.py", line 129, in _perform_connect
Dec 19 11:54:10 hass hass[17432]:     self._ip_address, DEFAULT_HUB_PORT, self._remote_id
Dec 19 11:54:10 hass hass[17432]:   File "/srv/homeassistant/lib/python3.6/site-packages/websockets/py35/client.py", line 20, in __await_impl__
Dec 19 11:54:10 hass hass[17432]:     extra_headers=protocol.extra_headers,
Dec 19 11:54:10 hass hass[17432]:   File "/srv/homeassistant/lib/python3.6/site-packages/websockets/client.py", line 286, in handshake
Dec 19 11:54:10 hass hass[17432]:     raise InvalidStatusCode(status_code)
Dec 19 11:54:10 hass hass[17432]: websockets.exceptions.InvalidStatusCode: Status code not 101: 401

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 22 (11 by maintainers)

Most upvoted comments

For anyone else, my plan is to get this into HASS itself with the next release as I do not believe too many would be impacted by this and for anyone who is there is a temporary solution available.

OK,

I created what hopefully is a fix for this. Here is what you need to do:

  1. In your HASS config folder create folder custom_components/remote
  2. Change to that folder
  3. Download updated harmony component (only change here is just for requirement so that it points to my fork instead): curl https://raw.githubusercontent.com/ehendrix23/home-assistant/harmony_fixes/homeassistant/components/remote/harmony.py -o harmony.py

Now restart HASS. In the logs it should show a warning about custom component.

Check if this works. 😃