Media Player Volume Level Incrementing

I’m trying to set the volume of my TV in a script to a specific level but whatever value I set volume_level to, for example, 0.2 or 0.4, it doesn’t actually set the volume to that level it simply just increments the current volume by one.

I’ve tried it in Developer Tools > Services and it’s the same. I thought the volume_level key set the volume to the level in the value, or am I wrong?

entity_id: media_player.sony_bravia_living_room
volume_level: 0.2

Can you set the volume through the UI,meaning can you control the volume of this device at all or only turn it on/off? Did you use the media_player.volume_set service? I just tested it and it works fine.

1 Like

An easy way to tell if set works is if you can get the state of your media player volume or if you have a slider when you look at the media player in your UI. If either of those is ‘no, doesn’t exist’ then you can’t use the set service because your hardware is limiting that.

1 Like

I have a slider (below image). But when I use the slider, regardless of where I move it to it only increments by 1. So, for example, if it’s where it is in the image below and I move it all the way to the right it only increases by a value of 1.

I’ve just tried it on all my TV’s and Sky Q box and they all do the same.

Then your TV doesn’t support set.

Is there anything I can add to my set up that will allow me to set the volume?

Not if your hardware doesn’t support it.

1 Like

Ok thanks. It’s a bit odd that it can retrieve the volume level and increment it but not set it to a specific level.

I’m wondering if something like a Broadlink Mini may work but I don’t know enough about them yet.

Can you take a screenshot of the media_player entity in the dev tools → states page?

Possibly, but I’m pretty sure they work off RF and that will give you less control.

According to the source, the platform accepts VOLUME_SET, VOLUME_MUTE and VOLUME_STEP https://github.com/home-assistant/core/blob/899431235b281a306d1ad66c45b1f324c2351895/homeassistant/components/braviatv/media_player.py

Of course that may not apply to all Bravia TVs.

I am not sure what VOLUME_STEP does?

1 Like

Here is a screenshot:

Well, @nickrout it is correct and your supported_features attribute supports volume set. That means that this is specific to your tv. Nothing in the home assistant code looks like it purposely does this including the code that talks directly to the hardware. That means that the API on the hardware side is performing the change. I’d start googling your model number and this issue.

1 Like

Thanks Petro and Nick. I’ve realised what the issue is here though after some messing about.

The TV plays audio via a HDMI connected speaker and when I disconnect the speaker the TV volume level can be set in HA.

So what I need to figure out now is if I can set the volume on the speaker. It’s a Bluetooth speaker connected via HDMI ARC so isn’t picked up by HA apart from theHDMI ARC port being listed as a source in the TV. Not even sure if it’s possible to set the volume but if anyone more knowledgeable knows I’d be grateful for some assistance.

If the TV and speaker supports HDMI CEC, then enable that and it should work.

It can also be called HDMI link or HDMI smart link. The name can be different, don’t know what Sony calls it.

Thanks Hellis but it’s already set up. On Bravia it’s called Bravia Sync and it is set up between the TV and speaker already as they are both Sony brand.

In that case the TVs volume should control the speaker.
Perhaps the cable is not supporting it?

If I use my TVs remote the receivers volume is changed.

Same here. The speaker ( Sony Soundstage) is connected via HDMI ARC to the TV and I can control the volume using the TV remote, speaker remote and Sky box remote.

I think I need to look deeper into this.

I’m not giving up :grin:

Sounds strange that it works through the remote but not via API.
Perhaps you can try it with the sky box?

Already tried it. In fact I tried it with the Sky box first and I thought that was why it wasn’t working so then tried the TV, with no luck again.