Onkyo Receiver Sound Automation

I’ve been struggling for a while with how i can automate a volume level of my Onkyo TX-NR646 receiver.
I have the volume rocker in home assistant under the media player when i click on it, and can change the level there np.
http://i.imgur.com/QjnptIC.png

But how do I automate that.
Like if I want the chromecast to start playing a web radio station, the paticular station source might be a bit low, and I could just say that when that station starts playing the volume gets bumbed up to, lets say 35 out of 80-90 or somehting.
Not sure what max is on it actually ^^
And on top of that I would love to extract the slider to a group so that i could make a card with the radio stations etc. and the volume rocker underneath it.
I hope someone out there is able to help me out. I’m geting the hang of this system, but i still have a long way to go before I can master it :wink:
LOVE home assistant though! keep up the good work ppl!

English is not my 1st language, so there might be spelling errors along the way :wink:
Sry about that.
But I hope i’ve proven my point anyway

You’ll want to use media_player.volume_set

Looks like it takes volume_level as a float (0-1)

- service: media_player.volume_set
  entity_id: media_player.onkyo (or whatever the correct entity_id is)
  data:
    volume_level: .5

use the service dev tool to experiment.

I haven’t figured out how to call services via the dev tools. Have no idea what to write in the box.
I can pick media player, then media_player.volume_set. But what to write I the box beneath it? Could you write an example for me on how to call a volume set for media_player.onkyo?
Because every time I wanna test stuff out, I write scripts instead because I have no idea how the tool works.
But I’m having a hard time getting feedback from my scripts. I do not get a reason why stuff ain’t working. It either works or not!

Thanks for the reply though

For the service JSON in the dev tool.

{"entity_id":"WHATEVER YOUR ID","volume_level":".5"}

Get the correct entity_id from the states dev tool.

Awesome. Thx a lot.
Will try it out later. My wife and son are using the receiver for telly right now, but I will take a look at it.

Thank you very much. Works like a charm!

Is there a way to change the values of the slider values? If it has a travel from 0.0 - 1.0 and it raises with 0.1 for each step i only have 10 steps.
Is there a way that i could change the values, so that i could sync with the value on the actual receiver 0-80 and with a 1 step, so that i have 80 steps to choose from.

There is, but I’m gonna let you read up to figure out the details.

The Alarm Clock thread has some good examples of using input_sliders. Sliders have a step attribute, so you should be able to have 0-80 in the UI, then do the math in your automation.

You’re going to want to look at using templates, replacing “data” in the sample I gave you above with “data_template”. Then do the math there to convert 80ths to percents.

The template dev tool is a good place to work those rules out before saving as an automation.

1 Like

I’ll take a look at it.
Thx a bunch again.
Cheers

Have had the same issue and solved it also using the dev tool.
Here is my config for my Onkyo TX-646. Its a bit difficult in case of calculating, but have a look:

input_slider

wz_onkyo_vol:
  name: Lautstärke
  initial: 15
  min: 0
  max: 50
  step: 1

automation

- alias: wz_onkyo_setvol
  trigger:
    - platform: state
      entity_id: input_slider.wz_onkyo_vol
  condition:
    - condition: state
      entity_id: media_player.onkyo
      state: 'on'
  action:
    - service: media_player.volume_set
      data_template:
      entity_id: media_player.onkyo
      volume_level: '{{ states.input_slider.wz_onkyo_vol.state | float / 80 }}'

What is not included yet, updating the input_slider, if someone changed the volume via onkyo remote.
Have to test a little deeper with that, because it lead me in some loop sometimes.

But I think you can adopt the automation for your needs.