Core: Sending commands through Logitech Harmony Hub remote does not work after update to 0.51

Created on 13 Aug 2017  路  11Comments  路  Source: home-assistant/core

Home Assistant release (hass --version): 0.51.0

Component/platform: Harmony Hub Remote

Python 3.5.2

Description of problem:
Sending command to Harmony Hub does not work after upgrade to version 0.51. Turning on/off activities works fine

Example:
remote -> send_command ->
{
"entity_id": "remote.hub",
"device": "43452620",
"command": "PowerOn"
}

Got error:
Traceback (if applicable):

Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 241, in _step
    result = coro.throw(exc)
  File "/srv/hass/lib/python3.5/site-packages/homeassistant/core.py", line 1025, in _event_to_service_call
    yield from service_handler.func(service_call)
  File "/srv/hass/lib/python3.5/site-packages/homeassistant/components/remote/__init__.py", line 159, in async_handle_remote_service
    num_repeats=num_repeats, delay_secs=delay_secs)
  File "/usr/lib/python3.5/asyncio/futures.py", line 361, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 296, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/hass/lib/python3.5/site-packages/homeassistant/components/remote/harmony.py", line 224, in send_command
    self._token, self.host, self._port, device, command, **kwargs)
TypeError: ha_send_commands() got an unexpected keyword argument 'num_repeats'

Additional info:

Most helpful comment

To change the call to pyharmony.ha_send_commands to not make it error. I'll make a PR.

All 11 comments

@marekobi : I am experiencing the same behaviour. It is possible to switch between activities. It is not possible to send a command to the Harmony hub.

My error code:

Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/tasks.py", line 233, in _step
    result = coro.throw(exc)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/core.py", line 1025, in _event_to_service_call
    yield from service_handler.func(service_call)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/remote/__init__.py", line 159, in async_handle_remote_service
    num_repeats=num_repeats, delay_secs=delay_secs)
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/remote/harmony.py", line 224, in send_command
    self._token, self.host, self._port, device, command, **kwargs)
TypeError: ha_send_commands() got an unexpected keyword argument 'num_repeats'

I managed to mess up in my clean up of remote component. It's an easy fix.

@MartinHjelmare: I am sorry, but I don't understand you. What exactly is an easy fix?

To change the call to pyharmony.ha_send_commands to not make it error. I'll make a PR.

@MartinHjelmare: thanks a lot! It works like a charm now.

Temporary fix till the new version of Home Assistant is ready to be installed:
Change the "harmony.py" file on the location "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/remote" (this is the location of the file for the Home Assistant all-in-one installer) according to the changes described here: https://github.com/home-assistant/home-assistant/pull/8956/files

Thanks, working again :)

According to the log my file should be here in hass.io...

/usr/lib/python3.6/site-packages/homeassistant/components/remote/harmony.py

...but /homeassistant isn't inside /site-packages, any ideas?

I am sorry, I only have experience with the all-in-one installer. Strange that the location in the log doesn't match with the location on your device. Maybe someone else has a suggestion?

Hass.io is based on Docker, you can't change what is in a Docker container.

However, as with all components, you can make a copy and put it in <config dir>/custom_components to have Home Assistant use that version instead of the built-in one. In this case create the file <config dir>/custom_components/remote/harmony.py

Nice one, many thanks.

Spoke a bit too soon, now get loads of errors about missing files from the custom_components/remote folder so looks like it needs the whole component copied across.

Update: working a treat now, thanks both.

Was this page helpful?
0 / 5 - 0 ratings