Can I set a volume level for automations on my AVR receiver (media_player.mrx_1120)

I have the Anthem MRX 1120. I would like to set a volume control in my automations.

For instance I generally listen to TV at -40db, music at -35db and movies at -32db to -30db.

The receivers’ own setup gui allows a volume memory for each zone but, not for each source.

I might be nitpicking but, the volume level does not display on the tv when using the bluesound node 2i or apple tv and the receiver is in a hideaway cabinet so changing the volume becomes guesswork especially since sometimes it changes in -1db increments and others in -2db increments.

What are my options?

Use the media_player.volume_set service.

Thank you. It still doesn’t work but at least now I know I’m in the right direction.

I used the developer tools call service to figure out the levels. The volume changes when I call it. 0.655 is -32db which is exactly what I wanted. When I add it to the automation as an action nothing happens. The lights dim and the rest of automation executes except for the volume set. There is nothing in my logs.

Post your automaton.

I will preface this by saying I did not write any of this code. I used the lovelace front end to create the automation and this is simply copy and pasted from what appears in the yaml.

- id: '1594336164256'
  alias: Bluray start
  description: ''
  trigger:
  - platform: template
    value_template: '{{ is_state_attr("media_player.mrx_1120", "source", "BLURAY")
      }}'
  condition:
  - condition: device
    device_id: 139bfd61046b4d60ae5e7dc2401a3e87
    domain: light
    entity_id: light.hue_white_downlight_1_2
    type: is_on
  - condition: device
    device_id: 6f04c46dc64046809301f831d7efe6b9
    domain: light
    entity_id: light.hue_white_downlight_2_2
    type: is_on
  - condition: device
    device_id: ce1eabddab904a42b490b18717f0e9b7
    domain: light
    entity_id: light.hue_white_downlight_3_2
    type: is_off
  - condition: device
    device_id: d8c13d91adc74aaaae4a609815af3ff2
    domain: switch
    entity_id: switch.family_room_lamp
    type: is_on
  - condition: and
    conditions:
    - after: sunset
      condition: sun
  action:
  - data:
      volume_level: 0.65
    entity_id: media_player.mrx_1120
    service: media_player.volume_set
  - brightness_pct: 50
    device_id: 139bfd61046b4d60ae5e7dc2401a3e87
    domain: light
    entity_id: light.hue_white_downlight_1_2
    type: turn_on
  - brightness_pct: 50
    device_id: 6f04c46dc64046809301f831d7efe6b9
    domain: light
    entity_id: light.hue_white_downlight_2_2
    type: turn_on
  - brightness_pct: 50
    device_id: ce1eabddab904a42b490b18717f0e9b7
    domain: light
    entity_id: light.hue_white_downlight_3_2
    type: turn_on
  - device_id: d8c13d91adc74aaaae4a609815af3ff2
    domain: switch
    entity_id: switch.family_room_lamp
    type: turn_off
  - delay: 00:00:15
  - device_id: 139bfd61046b4d60ae5e7dc2401a3e87
    domain: light
    entity_id: light.hue_white_downlight_1_2
    type: turn_off
  - device_id: 6f04c46dc64046809301f831d7efe6b9
    domain: light
    entity_id: light.hue_white_downlight_2_2
    type: turn_off
  - device_id: ce1eabddab904a42b490b18717f0e9b7
    domain: light
    entity_id: light.hue_white_downlight_3_2
    type: turn_off
  mode: single

Please format your code. see 11 here How to help us help you - or How to ask a good question


image

Please read my post and then the post I linked to.

Please read my post history and you will 1. understand that I have no idea what I’m doing or what you mean by formatting and 2. see that people are generally nice and helpful and regardless of what the rules state about people not helping out they actually do and they in some cases take it step by step for someone who has never seen a command prompt before 3 months ago.

If you want me to change how I operate just to suit your preference despite the larger HA community welcoming me with open arms then you didn’t have to reply. I am sorry for inconveniencing you and I apologize for taking up your time.

Please read point 11 in the post he linked to. It explains what and how to format code. Unfortunately, it’s near impossible to help when the format is incorrect.

How can the format be incorrect if I did not write it. All I did was select options from the drop down in the gui. This is what appears in the yaml but I have no idea how to write or format.

You clearly aren’t reading the post. The formatting is for us to help you on the forum.

For example, this post is near impossible to read properly. The code formatting is all over the place. This is what you need to correct.

Nevermind, I edited for you. Please in the future take time to learn how to use the forums when asking for help. Being unwilling to follow the forum rules pushes helpers away from solving your issues.

If you’re interested, take a look at the post I edited. Formatting simply involved adding 3 ``` before and after the code in question. This is all spelled out in the posting guidelines.

1 Like

I will test this out. But do you have an idea why it was formatted wrong? Do I have to click the drop down option in the gui a certain way?

read what he said. 3 back ticks. Not a picture.

Now original question: does the automation work when manually triggered?

The formatting for the post on the forums was wrong. Not your automation in your system. We just wanted you to format your POST on the forum.

It worked manually before adding the 3 back ticks. It didn’t after. But I got it to work! Just adding a delay in between the volume set and the light trigger made it work.

It worked manually and automatically before adding the volume set.

After adding the volume set the automation triggered manually and automatically except for the volume set.

After formatting the automation did not trigger at all.

A suggestion on reddit was to add a delay. I added a delay and removed the suggested 3 back ticks and it worked :slight_smile:

Apparently some receivers can’t accept commands without a delay:

You don’t put the three back ticks in home assistant. You use them on the forum to mark your code so it renders properly.

Glad you got it working.

1 Like

Thank you.