Add volume_step data parameter to media_player.volume_up / volume_down service calls #891
-
Hi all! I opened home-assistant/core#90283 to add a volume_step parameter to the media_player.volume_up / media_player.volume_down service calls. Any feedback or discussion appreciated. Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 10 replies
-
There are muiltiple integrations that communicate with devices that offer a "volume-step-up/down" command. Those commands are mostly that, just step up/down without a way to indicate stepsize. Allowing to pass in arbitrary values through the service call makes it impossible to use those native step commands. By providing arbitrary values basically all you can do is take current volume and add or subtract the step value. Which is also how some integrations implement the VOLUME_STEP feature. I think the real question is: shouldn't integrations that indicate support for volume step implement a proper stepsize? Question then of course becomes what a proper stepsize is. Which in turn depends on what the intended use of the VOLUME_STEP feature is. I don't know what the original background of the VOLUME_STEP feature is, but I would expect to be able to control the volume like I would with a TV remote control or the volume up/down buttons on my PC keyboard. These are typically small steps to make the sound a bit louder/less loud. Maybe lets look at some examples of devices that offer volume step up/down functionality (just picked some I have easy access to):
Maybe the default stepsize should just be smaller than 10% instead of making it variable? That would give more steps for all integrations using the default implementation (a very quick search seems to indicate ~70 integrations support VOLUME_STEP feature and about 50 integrations have an implementation for (on a sidenote, it looks like the media_player group also does the 10% steps and not call the volume up/down of its members, that might also need updating) I am sorry I don't ahve a direct solution and it got a bit longer than expected when I started writing, but I kept finding new stuff. I hope this is of some help. |
Beta Was this translation helpful? Give feedback.
-
Nobody has commented on this so I'm just gonna close. Can re open if there is interest. |
Beta Was this translation helpful? Give feedback.
-
I'll re-open this as the topic is still valid to take a decision upon. |
Beta Was this translation helpful? Give feedback.
-
Closing but I can't close the other PR I opened so someone else is gonna have to do that lol. |
Beta Was this translation helpful? Give feedback.
-
I discussed this with @balloob, @edenhaus and @MartinHjelmare. The conclusion is that the proposal is fine; the |
Beta Was this translation helpful? Give feedback.
-
Hi all, just arrived at this discussion after looking into changing the default volume_step for a new media player (AVR). The default for the AVR is + or - 0.5 dB (remote or volume knob) while changing the volume with the buttons in HA results in + or - 10 dB. (10% of 100 step range). This is very undesirable behavior. I'd love to see a way to either have this smaller by default (e.g. 1%) or a per device (integration) or global setting for personal preference and tweaking. |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
@glenrobertson I think this is worth implementing. Some integrations have added config options to set an integration default volume step because the default base implementation of 10% is too much. For some use cases, that wouldn't have been necessary if the services had this parameter. As another datapoint, HEOS also has native support for volume up/down with a specified step (default is 5%). So that's another integration that would benefit from this feature. Per @emontnemery comment, this proposal appears to be approved. Do you want to work on the implementation? If not, I'm happy to move it forward. |
Beta Was this translation helpful? Give feedback.
I discussed this with @balloob, @edenhaus and @MartinHjelmare. The conclusion is that the proposal is fine; the
volume_step
service call parameter should just be filtered inservice.yaml
for media players which don't supportmedia_player.volume_set
.