Harmony Hub setup help

Hello all, I’m on day one of my Home Assistant setup on a Raspberry Pi 3. I barely know what I’m doing, and hitting a snag with setting up my Harmony Hub. HA found the device automatically and created the file harmony_harmony_hub.conf, but all I’m getting is a single on off switch on my overview page. I had an activity on when I first started messing with it on HA, and I flipped the switch and it turned off the activity. Flipping the switch again does nothing and I have no way of selecting any of the activities.

What do I need to do at this point? I can’t find any documnentation that clearly explains what I need to do.

Thank you!

Hello and welcome to HA, so the harmony hub is one of the more complicated things to setup. Once you understand HA you’ll see why. What you’ll need to do is familiarize yourself with groups, input_booleans, switches, automations, and template sensors first before delving into Harmony because you’ll need all of those to do anything useful. I’m not at my computer now but I’ll come back and post an example for you. In the meantime, if you’re really anxious, there is a Harmony thread here with some examples that work and some that don’t :wink:

Thanks much! I tried reading through that, but I don’t really understand most of it because I’m so new to this. I don’t have much programming background. Really all I want to do is to have my harmony run a single specified activity when one of my sonos devices starts to play. Maybe that’s less difficult than getting the entire harmony hub set up in my home assistant? I don’t really have any desire to be able to completely control my harmony hub from HA, I really just want to automate this one thing. Appreciate your help!

Here is a script I use. This just turns my samsung tv on and off. You can specify activities too if you want, you will see the diffenrece on the documentation page. just goto your HA directory…probbaly /home/homeassistant/.homeassistant and do 'cat harmony_****" is will be called something like living room remote. you can see by using ‘ls’

watch_tv_bed:
  alias: "bed tv"
  sequence:
    - service: remote.send_command
      data_template:
        device: '48362289'
        command: 'PowerToggle'
        entity_id: remote.bedroom_remote

You get the device from that .conf file. Look for what device, in my case samsung tv. grab that id and whatever command you want under it. like I have another one that changes inputs.

da@ha:/home/homeassistant/.homeassistant$ ls
automations.yaml                     google_calendars.yaml            input_boolean.yaml  scene.yaml
basementhue.conf                     groups.yaml                      input_number.yaml   script.yaml
binary_sensor.yaml                   harmony_basement_remote.conf     input_select.yaml   secrets.yaml
configuration.yaml                   harmony_bedroom_hub.conf         intent_script.yaml  sensor.yaml
custom_components                    harmony_bedroom_remote.conf      known_devices.yaml  ssl
customize.yaml                       harmony_harmony_hub_3.conf       mainhue.conf        tts
deps                                 harmony_living_room_hub.conf     media_player.yaml   upsmychoice_cookies.pickle
ecobee.conf                          harmony_living_room_remote.conf  plex.conf
fedexdeliverymanager_cookies.pickle  home-assistant.log               python_scripts
da@ha:/home/homeassistant/.homeassistant$ 
da@ha:/home/homeassistant/.homeassistant$ 
da@ha:/home/homeassistant/.homeassistant$ 
da@ha:/home/homeassistant/.homeassistant$ 
da@ha:/home/homeassistant/.homeassistant$ cat harmony_bedroom_remote.conf 
Activities
  28976104 - Watch TV 2
  -1 - PowerOff

Device Commands
  46599683 - Bathroom
    Mute
    VolumeDown
    VolumeUp
    Play
    Pause
    SkipBackward
    SkipForward
    Repeat
    Shuffle
    Crossfade
    Line-In
    Off
  48362289 - Samsung TV
    PowerOff
    PowerOn
    PowerToggle
    Hyphen
    Number0
    Number1





basementatv:
  alias: "basement atv"
  sequence:
    - service: remote.send_command
      data_template:
        device: '49879452'
        command: 'InputHdmi2'
        entity_id: remote.basement_remote

Thanks for the reply. I understand where to find the device number, but the rest… I’m afraid I don’t really know what you mean. What documentation page? What is my HA directory? I don’t recognize that address you gave. Not sure what ‘cat harmony_***’, or what using ‘is’ means.

Sorry, I’m very new to this. Thanks for your help.

I think you might have installed HASS.IO. I believe that has more of a graphical interface to install and setup things. I havent used it, I was assuming you were using hassbian.

I think it woud be helpful to read up on some linux commands, just a couple basics will get you going and youll learn quick once playing around. if you can ssh to your home assistant install then do:

if you have the device number then just use that script in your script.yaml file

So what you’d want to do is use an automation and your Sonos as a trigger. Keep in mind I haven’t tested this piece so there may be errors and I’m typing from my phone. But give it a try…

automation:
  - id: "2345566435"
    alias: "start harmony activity with Sonos"
    initial_state: on
    trigger: 
      - platform: state
        entity_id: media_player.YOURSONOSHERE
        to: "playing"
    action: 
      - service: remote.turn_on
        entity_id: remote.YOURHARMONYHUB
        data:
          activity: "YOURACTIVITYNUM"

Brilliant, that worked! Thank you so much. However when I added this, it seems that the other automations I had set up in the Hass.io interface have now dissapeared. Any reason why that might have happened?

Also, there is another thing I want to do which is to set the volume on the receiver. There is no way for harmony to set a specific volume level, it can only tell the receiver to volume up or down. However what I could do is have it send a ton of volume down commands until the volume is all the way down, and then send a specified number of volume up commands to bring it back up to the level I want it at. The thing is, each volume up/down command moves the volume by 0.5, and the lowest volume level is -80, and the max is 12(it’s unit is decibels, I don’t really understand why they did it this way, anyway). I basically never have the volume higher than -10… so I could essentially send the receiver 140 volume down commands, and then bring it back to -20, which is where I generally like it to be… so then I would send the receiver 120 volume up commands. Know of a way this can be done aside from making 140 volume down ‘actions’ and then 120 volume up actions in the automation?

Other automations disappearing is probably due to a change that was brought in a few months ago where any automations without the id should be under automation_old section. This was to introduce the automation editor. So you can either add the id to the other automations or put them under the old section.

As for the volume issue, does your amp have a network connection? If so, look and see if there’s a component for it. Otherwise, there is a repeat option for harmony commands which may help but yeah it will be turn all the way down then up to the volume you require.

Ok, I don’t really understand the automaiton stuff you are explaining. I don’t see an ‘automation_old’ anything anywhere. I have what you wrote in the configuration.yaml file, and then my two other autoamtions that I set up in the editor in the automation.yaml file. I tried moving the automation that you gave me into the automation.yaml file, and everything stopped responding and it took me awhile just get back into my Home Assistant after deleting that from the automation.yaml file and restarting HA.

I looked and did find a component for my receiver, and added it to the configuration.yaml. It showed up and I have full control of the receiver from it, so that’s awesome. What I’m now trying to figure out is how to set the ‘call service’ to turn the receiver on and then set the volume. It seems that the receivers entity ID is the same as my sonos players, so I’m not sure what I’m selecting. Is there a way to change that? And if I can, what do I put in the ‘Service Data’ field to set the volume?

No worries. We will get you going. That’s great that there’s a component. So let’s solve these 1 at a time.

  1. When configuring new components, use entity_namespace. This will turn something like media_player.living_room into media_player.sonos_living_room Here’s how to format it in your configuration.yaml:

    media_player:
      - platform: sonos
        entity_namespace: 'sonos'
    
  1. Automation vs. automation old. There is no section named “automation old” so you’d have to create one in your configuration.yaml. Basically what happened is, a few months ago, a new feature was introduced to create and edit automations within the frontend rather than editing yaml. Many of us who have been here for awhile are used to the manual way and I find it doesn’t always play nice. So here’s what I suggest for now. Create 2 files, one called automation.yaml and the other called automation_old.yaml and put them in the same directory as your configuration.yaml file. Next, cut all the automations that were created using the editor and place them in the automation.yaml file. Then cut and paste the new one we did in the automation_old.yaml file. Finally you’ll have to point the configuration.yaml to those two new files by having this:

    automation: !include automation.yaml
    automation old: !include automation_old.yaml
    

What we are doing here is just keeping the editor stuff separate so we don’t mess anything up when you cut and paste stuff from the forum.

  1. Finally, let’s try this for your receiver. Let’s take the existing automation and then just add a few more services to the end. Turn on, maybe a delay to ensure it’s on, and then the command to set the volume

    automation:
      - id: "2345566435"
        alias: "start harmony activity with Sonos"
        initial_state: on
        trigger: 
          - platform: state
            entity_id: media_player.YOURSONOSHERE
            to: "playing"
        action: 
          - service: remote.turn_on
            entity_id: remote.YOURHARMONYHUB
            data:
              activity: "YOURACTIVITYNUM"
          - service: media_player.turn_on
            entity_id: media_player.YOURRECEIVER
          - delay:
             seconds: 5
          - service: media_player.volume_set
            entity_id: media_player.YOURRECEIVER
            volume_level: DESIREDVOLUME
    

You can read more about what you can do with media player components here:

Thanks for all your help man!

  1. I think I understand. So for my currenty entry:

media_player:

  • platform: pioneer
    host: 192.168.0.10

I would make it look like this?

media_player:

  • platform: pioneer
    entity_namespace: ‘receiver’
    host: 192.168.0.10

Which would make it ‘media_player.receiver’?

  1. Since the editor seems to have full control over all the functions of my receiver, it seems I should be able to set up the automation in the editor, which I would prefer. The only thing I don’t know what to do with is the service data. Would I choose media_player.receiver/volume_set for the service call, and would I just put ‘volume_level: -20’ ?

I would try this myself right now, but I’m not at home.

Thanks again for all your help!

edit: I can’t figure out how to make the grey blocks around code. I’m sure you understand what I’m writing up there.

For the “grey blocks” use the </> button in the toolbar.

For entity_namespace, you’re mostly correct, it will appear as media_player.receiver_RECEIVERNAME. The namespace just let’s you separate if you have multiple devices named the same thing, it puts the text in between the component type (media_player) and the name (eg. living_room). But you can always look up all of your entities in the developer tools under <>

Using the editor is something I have almost no experience with since I’ve been doing the old way for awhile now and just prefer it since I have way more control but I think that sounds about right.