Restricting max volume

Hi

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'
trigger:
  platform: template
  value_template: '{{ states.media_player.YOURS.attributes.volume_level > 0.2 }}'
action:
  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
    switches:
      fan:
        friendly_name: "Fan"
        value_template: "{{ is_state('switch.switch1_switch','on')}}"
        turn_on:
          service: switch.turn_on
          data_template:
            entity_id: >
              {% if is_state('sensor.office_window', 'Open') %}
                switch.switch1_switch
              {% else %}
                switch.null
              {% endif %}
        turn_off:
          service: switch.turn_off
          data:
            entity_id: switch.switch1_switch