Harmony Hub Device Control

I’m a bit stuck on controlling individual Harmony Hub devices in HA, the HA harmony documentation doesn’t help as I don’t have the knowledge to decipher what to do with that information yet, I’m missing key info which is a lack of knowledge on my part. I can set up actions with the activities etc but I want to use my Aqara cube switch to increase/decrease volume of an amplifier connected to Harmony. I know there is some script to be written and I know where the info is in the config files but I’m at a loss to work out how to create a script/action/service that I can then call in an automation. Can someone point me towards an idiots guide/sticky on how to do this? I’ve searched the forums for about an hour and can’t find anything. :frowning:

In your config file, look for the Harmony config file. That file will list all of your devices and available commands. You’ll need the device ID and the command you want to use.
In automations, you’ll use the Remote: Send Command Service as the action.
Example using my receiver and setting the surround mode:

service: remote.send_command
data:
  device: "65890902"
  command: ModeDirect
target:
  entity_id: remote.harmony_hub

1 Like

That’s great, thanks. I’m filling in the gaps now. I’m certain I can write a service that can be called by the automation but I’m missing where I can get that “Remote: Send Command” element from, is this something I need to create somewhere as I’m not seeing a option in the triggers or actions list. Thanks for the reply.

Right, thanks for the clue @Rich37804, manage to get a couple of tests done after working out how to do it in “Scripts” in Settings->Automations->Scripts. After working out that the device ID was at the end of the command list and not the beginning :anguished: I got it sorted:

image

Thanks for the steer

Can you give a bit more of a hint as to how you formatted your script to be able to be called by a button. When I go to create a new script, at the beginning it wants

alias: New Script
sequence: []

And using Rich’s advice I want to call this button from harmony to turn my amp on. Where do I add it to make the script work so I can call it on a dashboard button?

service: remote.send.command
data:
  device: "71697856"
  command: PowerOn
target:
  entity_id: remote.cinema

I ended up getting it working on a button on a dashboard. Turns out you can select call a service from the UI and it prompts you for the other info. After looking at the code it looks something like this

  - show_name: true
    show_icon: true
    type: button
    tap_action:
      action: call-service
      service: remote.send_command
      target:
        entity_id: remote.cinema
      data:
        num_repeats: 1
        delay_secs: 0.4
        hold_secs: 0
        device: '71697856'
        command: PowerOn
    icon: mdi:power-standby
    name: Power On Amp

Sorry, missed the post - it’s not often I’m on. Glad you figured it out.