Testers Needed - Harmony Hub Support Implemented in Python

have you tried setting up the link as a third device? I only have the hubs so I dont know if it would work or not.

Well i did all that and i still cant boot HA.
Is it possible that because my password for harmony contains special charachters such as ! or @ it fails somewhere?

Edit: that was it the whole time i used " " and it worked

Something has changed… 6 minutes stuck at:

16-11-21 07:08:02 INFO (Thread-5) [homeassistant.components.remote.harmony] Loading Harmony component: Family Room

Could it be something to do with the work on the async core? Weird thing is yesterday it started fine a few times even with the latest hass.

can you set logging to debug for the remote component?

@iandday Would you be able to clarify the proper formatting on sending a device command for me?

Activities are pretty straight forward. I’m able to trigger an activity with:

   - service: remote.turn_on
      entity_id: remote.living_room_tv
      data:
        activity: "15508274" 

However I’m not sure how I’d trigger a Volume down command. According to the conf file, the receiver is ’ 30557844 - Onkyo AV Receiver’ and the command is ‘VolumeDown’ but I do now know how I’d format this data.

1 Like

I just used the below data to Mute my sound bar

{“entity_id”:“remote.family_room”,“device”:“35128149”,“command”:“Mute”}

So for your case it should be

   - service: remote.send_command
      entity_id: remote.living_room_tv
      data:
        device: "30557844"
        command: "VolumeDown"
1 Like

That did the trick. Thanks @iandday!

Now if only I could find a way to make it look a little cleaner than:

You could set a input select component to hold the actions you want, then a script “call action”.

The script would lookup what select option is currently selected, then send that to the Remote Component.

That’s the only suggestion I could think off the top of my head.

See https://home-assistant.io/cookbook/perform_actions_based_on_input_select/

That’s what I did for the Activity select and it worked well. I’m just looking for something to control the volume more cleanly now.

more of a rube goldberg implementation, but what about a Input slider? Min of 1, max of ten, and an initial value of 5. An automation can trigger the appropriate script depending if the value is less or greater than 5, then you can reset the slider to 5 once the volume change script is executed. Might not be great for rapid adjustment of the volume with the delays.

Everything’s working flawlessly over here with version 1.0.11. Thanks for the fix and the constant improvements. This component has come a long way since 0.2.0.

2 Likes

Now I think I may try that just to see if I can do it.

Mine also works this morning after updating, thanks so much @iandday for continued hard work!

Out of interest, why do you need the authentication?
I am sure you may have seen harmonyhubjs-client, which seems to interact locally only?
Link: https://github.com/swissmanu/harmonyhubjs-client

I’m running https://github.com/maddox/harmony-api in docker and all I need is a config to connect to my mosquito. No auth for Harmony. It seems to update my input select and issue commands much faster than this component, but I’ll keep testing.

Yes, I have tried as third hub, but it causes HASS to stall and not make it to user interface web page.

great to hear, and you arent kidding!

can you enable debugging for the remote component to see where it’s stalling at?

it’s going to be faster, it’s keeping an open link and receiving push notifications instead of pulling. I’m not quite sure how to implement that in python yet, my java skills arent good enough to understand the code fully

Troubleshooting my Harmony Link (my Hamony Hubs are working!)
set the following in configuration.yaml for testing:

logger:
  default: debug
  logs:
    homeassistant.components.remote: debug

frontend:

discovery:

remote:
  platform: harmony
  name: Rec Room
  username: [email protected]
  password: 123456
  host: 192.168.1.17
  port: 5222
  activity: Deck iTunes
 
history:

logbook:

Not seeing much in home-assistant.log:

16-11-23 14:25:53 homeassistant.loader: Loaded remote.harmony from homeassistant.components.remote.harmony
16-11-23 14:25:53 homeassistant.bootstrap: Setting up remote
16-11-23 14:25:53 homeassistant.components.remote: Setting up remote.harmony
16-11-23 14:25:53 homeassistant.components.remote.harmony: Loading Harmony component: Rec Room

Ok managed to get more info in the home-assistant.log

16-11-23 14:44:30 homeassistant.loader: Loaded remote.harmony from homeassistant.components.remote.harmony
16-11-23 14:44:30 homeassistant.bootstrap: Setting up remote
16-11-23 14:44:30 homeassistant.components.remote: Setting up remote.harmony
16-11-23 14:44:30 homeassistant.components.remote.harmony: Loading Harmony component: Rec Room
16-11-23 14:44:30 homeassistant.components.remote: Error while setting up platform harmony
Traceback (most recent call last):
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\homeassistant\helpers\entity_component.py", line 150, in _async_setup_platform
    entity_platform.add_entities, discovery_info
  File "C:\Program Files (x86)\Python35-32\lib\asyncio\futures.py", line 361, in __iter__
    yield self  # This tells Task to wait for completion.
  File "C:\Program Files (x86)\Python35-32\lib\asyncio\tasks.py", line 296, in _wakeup
    future.result()
  File "C:\Program Files (x86)\Python35-32\lib\asyncio\futures.py", line 274, in result
    raise self._exception
  File "C:\Program Files (x86)\Python35-32\lib\concurrent\futures\thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\homeassistant\components\remote\harmony.py", line 47, in setup_platform
    config.get(CONF_PASSWORD))
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\pyharmony\__main__.py", line 72, in ha_get_token
    token = harmony_auth.login(username, password)
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\pyharmony\auth.py", line 46, in login
    id_token = resp_dict['id_token']
TypeError: 'int' object is not subscriptable
16-11-23 14:44:30 homeassistant.core: Bus:Handling <Event service_registered[L]: service=turn_off, domain=remote>
16-11-23 14:44:30 homeassistant.core: Bus:Handling <Event service_registered[L]: service=turn_on, domain=remote>
16-11-23 14:44:30 homeassistant.core: Bus:Handling <Event service_registered[L]: service=send_command, domain=remote>
16-11-23 14:44:30 homeassistant.core: Bus:Handling <Event service_registered[L]: service=sync, domain=remote>
16-11-23 14:44:30 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=remote>
16-11-23 14:44:30 homeassistant.bootstrap: Setting up http
16-11-23 14:44:30 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=http>
16-11-23 14:44:30 homeassistant.bootstrap: Setting up api
16-11-23 14:44:30 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=api>
16-11-23 14:44:30 homeassistant.bootstrap: Setting up frontend
16-11-23 14:44:30 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=frontend>
16-11-23 14:44:30 homeassistant.bootstrap: Setting up history
16-11-23 14:44:30 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=history>
16-11-23 14:44:30 homeassistant.bootstrap: Setting up discovery
16-11-23 14:44:30 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=discovery>
16-11-23 14:44:30 homeassistant.bootstrap: Setting up logbook
16-11-23 14:44:30 homeassistant.core: Bus:Handling <Event service_registered[L]: service=log, domain=logbook>
16-11-23 14:44:30 homeassistant.core: Bus:Handling <Event component_loaded[L]: component=logbook>
16-11-23 14:44:30 homeassistant.core: Starting Home Assistant core loop
16-11-23 14:44:30 homeassistant.core: Starting Home Assistant
16-11-23 14:44:30 homeassistant.core: Bus:Handling <Event service_registered[L]: service=stop, domain=homeassistant>
16-11-23 14:44:30 homeassistant.core: Bus:Handling <Event service_registered[L]: service=restart, domain=homeassistant>
16-11-23 14:44:30 homeassistant.core: Bus:Handling <Event homeassistant_start[L]>
16-11-23 14:44:30 homeassistant.core: Timer:starting
16-11-23 14:44:30 netdisco.service: Scanning
16-11-23 14:44:30 homeassistant.components.recorder: Ended unfinished session (id=34 from 2016-11-23 19:41:31.110761)
16-11-23 14:44:30 homeassistant.components.recorder: Found unfinished sessions
16-11-23 14:44:33 homeassistant.components.http: Serving / to 192.168.1.19 (auth: True)
16-11-23 14:44:34 homeassistant.components.http: Serving /api/bootstrap to 192.168.1.19 (auth: True)
16-11-23 14:44:35 homeassistant.components.http: Serving /api/stream to 192.168.1.19 (auth: True)