Harmony Hub Volume level

Hello All,

Im looking to see if anyone has figured out a way to control Harmony Hub volume increase/decrease by more than a single level.

I have a IFTTT responding to Google Assistant command with a Maker request back into Home-Assistant.
It uses the following URL and JSON

URL
https://MyDomain.com/api/services/remote/send_command?api_password=MyApiPass

JSON
{ “entity_id”: “remote.harmony_lr”, “device”: “40435603”, “command”: “VolumeUp” }

This works, but it only increases by a single level and is obviously not that useful.
Has anyone done any work to say increase by 5 or 10 levels with a single command input?

If that itself is possible, the end result I would like to accomplish is using a number variable in the Google Assistant command at IFFF to send the number variable increase back to HASS via Maker.

1 Like

Ok so I came across a post by Marcus_Brannon showing how he repeated the volume command with a script sequence.

I used it in two ways with the scripts listed below. The first method seems to send the repeated commands a tiny bit faster than the second, but both are dirt slow in comparison to using the physical harmony remote. Is there any way to increase the speed that these commands are sent to the hub?

The next problem is that I cant seem to get it to work over the Maker channel in IFTTT.
I currently have the second method listed below in use and this is what I have set in the maker settings. Can someone spot what Im doing wrong?

Google Assistant trigger: turn $ the tv volume by #

Maker URL: https://mydomain.com/api/services/script/tv{{TextField}}{{NumberField}}?api_password=MYHASSPASS

Maker JSON: { “script”: “tv{{TextField}}{{NumberField}}” }

PS - If I run this from Services Tool in HASS it works as expected. So I know the scripts work.
Domain - script
Service - tvup3
Json - { “script”: “tvup3” }

1 The first is a simple always increase/decrease by 5 levels script.

script:
  tvup1:
    sequence:
      - service: remote.send_command
        data_template:
          device: 40358144
          command: volumeup
    sequence:
      - service: remote.send_command
        data_template:
          device: 40358144
          command: volumeup
    sequence:
      - service: remote.send_command
        data_template:
          device: 40358144
          command: volumeup
    sequence:
      - service: remote.send_command
        data_template:
          device: 40358144
          command: volumeup
    sequence:
      - service: remote.send_command
        data_template:
          device: 40358144
          command: volumeup

2 The second method is a variable based increase. There are two vars, one to determine increase or decrease and the second to determine the level.

script:
  tvup1:
    sequence:
      - service: remote.send_command
        data_template:
          device: 40435603
          command: volumeup
          entity_id: remote.harmony_lr
  tvup2:
    sequence:
      - service: remote.send_command
        data_template:
          device: 40435603
          command: volumeup
          entity_id: remote.harmony_lr
      - service: script.turn_on
        data:
          entity_id: script.tvup1
  tvup3:
    sequence:
      - service: remote.send_command
        data_template:
          device: 40435603
          command: volumeup
          entity_id: remote.harmony_lr
      - service: script.turn_on
        data:
          entity_id: script.tvup2
  tvup4:
    sequence:
      - service: remote.send_command
        data_template:
          device: 40435603
          command: volumeup
          entity_id: remote.harmony_lr
      - service: script.turn_on
        data:
          entity_id: script.tvup3
  tvup5:
    sequence:
      - service: remote.send_command
        data_template:
          device: 40435603
          command: volumeup
          entity_id: remote.harmony_lr
      - service: script.turn_on
        data:
          entity_id: script.tvup4
  tvup6:
    sequence:
      - service: remote.send_command
        data_template:
          device: 40435603
          command: volumeup
          entity_id: remote.harmony_lr
      - service: script.turn_on
        data:
          entity_id: script.tvup5
  tvup7:
    sequence:
      - service: remote.send_command
        data_template:
          device: 40435603
          command: volumeup
          entity_id: remote.harmony_lr
      - service: script.turn_on
        data:
          entity_id: script.tvup6
  tvup8:
    sequence:
      - service: remote.send_command
        data_template:
          device: 40435603
          command: volumeup
          entity_id: remote.harmony_lr
      - service: script.turn_on
        data:
          entity_id: script.tvup7
  tvup9:
    sequence:
      - service: remote.send_command
        data_template:
          device: 40435603
          command: volumeup
          entity_id: remote.harmony_lr
      - service: script.turn_on
        data:
          entity_id: script.tvup8
  tvup10:
    sequence:
      - service: remote.send_command
        data_template:
          device: 40435603
          command: volumeup
          entity_id: remote.harmony_lr
      - service: script.turn_on
        data:
          entity_id: script.tvup9
  tvdown1:
    sequence:
      - service: remote.send_command
        data_template:
          device: 40435603
          command: volumedown
          entity_id: remote.harmony_lr
  tvdown2:
    sequence:
      - service: remote.send_command
        data_template:
          device: 40435603
          command: volumedown
          entity_id: remote.harmony_lr
      - service: script.turn_on
        data:
          entity_id: script.tvdown1
  tvdown3:
    sequence:
      - service: remote.send_command
        data_template:
          device: 40435603
          command: volumedown
          entity_id: remote.harmony_lr
      - service: script.turn_on
        data:
          entity_id: script.tvdown2
  tvdown4:
    sequence:
      - service: remote.send_command
        data_template:
          device: 40435603
          command: volumedown
          entity_id: remote.harmony_lr
      - service: script.turn_on
        data:
          entity_id: script.tvdown3
  tvdown5:
    sequence:
      - service: remote.send_command
        data_template:
          device: 40435603
          command: volumedown
          entity_id: remote.harmony_lr
      - service: script.turn_on
        data:
          entity_id: script.tvdown4
  tvdown6:
    sequence:
      - service: remote.send_command
        data_template:
          device: 40435603
          command: volumedown
          entity_id: remote.harmony_lr
      - service: script.turn_on
        data:
          entity_id: script.tvdown5
  tvdown7:
    sequence:
      - service: remote.send_command
        data_template:
          device: 40435603
          command: volumedown
          entity_id: remote.harmony_lr
      - service: script.turn_on
        data:
          entity_id: script.tvdown6
  tvdown8:
    sequence:
      - service: remote.send_command
        data_template:
          device: 40435603
          command: volumedown
          entity_id: remote.harmony_lr
      - service: script.turn_on
        data:
          entity_id: script.tvdown7
  tvdown9:
    sequence:
      - service: remote.send_command
        data_template:
          device: 40435603
          command: volumedown
          entity_id: remote.harmony_lr
      - service: script.turn_on
        data:
          entity_id: script.tvdown8
  tvdown10:
    sequence:
      - service: remote.send_command
        data_template:
          device: 40435603
          command: volumedown
          entity_id: remote.harmony_lr
      - service: script.turn_on
        data:
          entity_id: script.tvdown9

Alright so I have removed the JSON entry in the Maker, as it seems I dont need it.
However there is something weird happening with Google Assistant Variables.

Google Assistant trigger phrase: OK Google, turn $ the tv by # (Ok Google, turn down the tv by 3)

Maker URL:Maker URL: https://mydomain.com/api/services/script/tv{{TextField}}{{NumberField}}?api_password=MYHASSPASS

Here is what I get in the logs.
Unable to find service script/tvdown the3

It seems that the word variable in Google Assistant is acting crazy and grabbing not just the first word (up/down) but the word that directly follows (the) it as well, and passes it along to the vars in the URL.
Has anyone run into this?

Did you ever find a way to speed up sending commands to harmony? I’m trying to change channels, and it’s horrifically slow.

In Home Assitant v0.45 dev as of a few days ago baloob has added parameters to the remote.send-command to allow repeated commands to be sent as well as a delay between sends. Just successfully turned up and down the volume on my receiver with Amazon Echo using the following simple srcipt:

volume_up:
alias: Volume Up
sequence:
- service: remote.send_command
data:
entity_id: remote.harmony_hub
command: VolumeUp
device: 41849703
num_repeats: 5
delay_secs: 0.25
volume_down:
alias: Volume Down
sequence:
- service: remote.send_command
data:
entity_id: remote.harmony_hub
command: VolumeDown
device: 41849703
num_repeats: 5
delay_secs: 0.25

I’m guessing one could also stick a template in there to support parameterized volume adjustment amount but 5 seems like a useful amount for my system.

Hello braddo, i tried your method on my scrip configuration, however it says invalid config. care to lend a hand? thanks.

Why don’t you post your config? What I pasted I did too quickly so the spaces were all stripped. Make sure your indentation is right. What version of HA are you using?

Hi, i am had the same issue. Im trying to reduce the delay between several commands.

This is what im currently using:

{
“command”: “FanSpeedUp”,
“device”: “37767707”,
“entity_id”: “remote.living_room”,
"delay_secs: “0.25”,
“num_repeats”: “5”
}
This works fine :slight_smile:

However, same problem as before… hass.io will not run the script several times in short succession as it says Script is already running. Need to find a work around.

Hi @AlmostSerious. Sorry for raising this old topic. But I’m facing exactly this issue. The script causes errors when using i.e. arrow down or arrow up in short succession. Did you find a solution meanwhile?

1 Like

My Solution was to move to a device with direct integration to Hassio.
So no, unfortunately i do not have a working way for this.