Media_player volume issues

I have two Yamaha receivers, an RX-V681 and a TSR700. Using the native app, or the remote control, volume is set in dB, as opposed to an arbitrary integer scale.

Depending on the specific receiver and zone, the max volume varies. For example, on the 681, zone 1 has a max volume of +16.5dB, and zone 2 has a max volume of +10dB.

However, using HA’s media_player control, the highest I am able to adjust the volume to is 0dB, when the volume slider is at 100.

I have checked the states using the dev tools, and HA sees the volume being reported as 1 when the receiver is at or above 0dB. Below 0dB, HA sees some float between 0 and 1 - and volume adjustments in this range work perfectly.

Has anyone solved or overcome this issue? Some of the speakers I’m controlling from this are outdoor speakers, and it would be nice to drive them a little more - especially since some of my audio sources are quieter than others (Chromecast to RCA inputs, for example, is much more quiet than an FM radio source).

Thanks!

use the compensation integration to transform the volume in the frontend:

compensation:
  yamaha_receiver_volume:
    unique_id: yamaha_receiver_volume
    source: media_player.yamaha_receiver
    attribute: volume_level
    unit_of_measurement: dB
    precision: 1
    data_points:
      - [0.2, -80.0]
      - [1.0, 0.0]
  
  yamaha_receiver_zone_2_volume:
    unique_id: yamaha_receiver_zone_2_volume
    source: media_player.yamaha_receiver_zone_2
    attribute: volume_level
    unit_of_measurement: dB
    precision: 1
    data_points:
      - [0.2, -80.0]
      - [1.0, 0.0]

Also, you can use a custom integration I wrote (It’s in HACS) that combines and throttles multizone receivers.

I added those lines to my config, after adjusting for the names of my sources, but I’m not sure what to do with them from there… Reading the docs for that integration, it looks like it creates a sensor? I’m guessing I then need to use the value reported by that sensor and perform a calculation against the volume slider shown in the media_player control, but I’m pretty new to all this, and not sure exactly what to do with it.

What is the custom integration you mention? I plan to add two more multi-zone receivers to my config, so I’d be interested to check that out and see if there’s a better way to handle this. Right now, I have 2 chromecasts per receiver (one per zone), as well as a pair of RCA cables bridging the two receivers so I can have “party mode”.

Edit: Nevermind about the custom integration, I see it. That block looked like an advertisement at first, so my eyes skipped right over it. LOL

Thanks!

On further review of the documentation for the compensation integration, I do not think this will solve my problem. It appears to me that this integration simply “maps” the values for the floats from .2 - 1 to -80dB - 0dB. Handy for display purposes, to be sure, but not a solution. Unless I’m misunderstanding the docs?

What I am trying to figure out is how to increase the volume on those channels beyond 0dB - which I am unable to do with the media player in it’s default configuration.

If your media player doesn’t produce a state above 1.0 when you physically go above 0.0 db, then there’s nothing you can do.

All of my Yamaha receivers go beyond 1.0 in hass.

I Was afraid that might be the answer on the surface of it. I know some receivers have other types of calls that can be made to modify their settings… Was wondering if perhaps the generic media_player didn’t implement these types of calls for the Yamaha receivers maybe? Surely I can’t be the only one with this problem. :frowning:

look in your yamaha settings, all of mine have API settings you can adjust. Log into it using the IP, the app on your phone, or through the settings with the remote.

Wow, I had no idea there would be a web page listening there. LOL

Ok, so I logged in, and the only stuff I can change is the same stuff I normally would - zone names, network settings, etc. There’s no way that I can see to change the volume output/reporting? Or perhaps I’m not understanding what you’re getting at. Are these API Settings somewhere other than the http page that responds by default on TCP80?

So, I just checked my newer receiver (RX-V6A), and it has an even worse interface than the older RX-V681 does. At least the 681 had a primitive UI, the V6A is all text-driven. No way that I see in there to make changes to API calls? Surely I’m missing something…

It’s possible your device doesn’t support it. There’s a few different yamaha APIs

Did you try http://ip-address/Setup ? Looks like it has a nice UI.

Oooooh! It sure does. Thank you for that, I’m looking into it now!

For anyone that’s interested in trying to make this work, I was able to control the volume using the following shell script:

curl --silent --output /dev/null http://${1}/YamahaRemoteControl/ctrl --data-binary "'<YAMAHA_AV cmd=\"PUT\"><Main_Zone><Volume><Lvl><Val>${2}</Val><Exp>1</Exp><Unit>dB</Unit></Lvl></Volume></Main_Zone></YAMAHA_AV>'"

$1 is the IP address of the receiver, and $2 is the volume you want. It can be positive OR negative, and the system interprets it by adding a decimal point one character from the right. For example, 50 becomes 5.0 -50 becomes -5.0, 100 becomes 10.0, etc. This value is in dB.

I’m still working on how to integrate this with a numerical slider, and I suspect I’ll need to use the compensation integration that was mentioned above in order to accomplish it - otherwise, there will be some creative math done in the script.

I’ve actually got this sorted. I’m going to post it up in the projects section.

EDIT: done.