Restricting max volume


I need a way to restrict the maximum volume that HAS can set my yamaha AVR

several times now users have upped the volume on my wall mounted tablet sending my AVR into full volume and almost damaging my speakers

id like to limit HAS to something like -15db as its maximum it can set

is this possible?

If nothing else you can create an automation that turns the volume down to your defined max if it goes above it.

Thanks heaps, done some research that appears to be a way to do it!

Any idea on how to get it running?

I assume you’ve taken the time to read the documentation already?

Basically, find the volume that is the maximum you’re happy with. Then write an automation that turns it down above that, something like:

alias: 'Volume manage'
  platform: template
  value_template: '{{ states.media_player.YOURS.attributes.volume_level > 0.2 }}'
  service: media_player.volume_set
  entity_id: media_player.YOURS
  volume_level: 0.2

Obviously, replace YOURS with the actual entity, and 0.2 with your chosen level.

I wanted to do something similar with a fan in a closed window. I didn’t want it to bounce on and then off but prevent the turn on similar to what you would want.
I’m sure you could adapt this for your volume up/down issue. The trick is returning a null entity when you want to prevent something from happening.

- platform: template
        friendly_name: "Fan"
        value_template: "{{ is_state('switch.switch1_switch','on')}}"
          service: switch.turn_on
            entity_id: >
              {% if is_state('sensor.office_window', 'Open') %}
              {% else %}
              {% endif %}
          service: switch.turn_off
            entity_id: switch.switch1_switch