Using AVR mute state as trigger in an automation

Hi,

I have an AVR (Marantz SR8012) integrated with Home Assistant and I’m trying to figure out how to trigger an automation action when the AVR is unmuted).

For my trigger I have:

platform: state
entity_id: media_player.living_room_avr
attribute: is_volume_muted
to: 'false'

and my action:

type: turn_on
device_id: 8757637c4c9728cba2c6cde937982ebf
entity_id: light.centralite_systems_4200_c_de3d6efe_on_off
domain: light

Unmuting my AVR should turn this light on but it doesn’t.

Thanks,
-g.

No one is using the “is volume muted” state as a trigger?

I’m able to use other states (source) as triggers so I know my AVR is integrated correctly.

Remove the quotes wrapping false.

With the quotes the word false is handled as a string value.
Without the quotes it’s handled asa boolean value.

I believe is_volume_muted contains a boolean value and so the State Trigger fails to find a match if it’s comparing it to a string value.

2 Likes

I’m not adding the quotes. HA is. I tried editing with the UI’s yaml editor but it just puts the quotes back in.

That’s one of several deficiencies of the Automation Editor.

I suggest using a text editor.

Just edit the automation.yaml file direct/over the network you mean? What prevents the UI from adding the quotes again?

Nothing but before we cross that bridge, try what I suggested to confirm it resolves the problem you reported.

Edit automations.yaml with a text editor and save the changes. Then execute Configuration > Server Controls > Check Configuration to confirm you didn’t accidentally introduce any errors.

If it passes, execute Configuration > Server Controls > Reload Automations. (If you skip this last step, the manual changes you made won’t be loaded into Home Assistant.)

Ok so all that worked with my test automation. Are we now at that bridge?

Glad to hear it fixed the problem. Now all that’s left is to prevent the Automation Editor from touching that particular automation and putting the quotes back.

One way to do that is to separate the automations created/modified via the Automation Editor and the automations created/modified via a text editor. There’s an example of how to do that at the end of the documentation section for Splitting up the configuration. Take a look at it and let me know if you encounter problems implementing it. The goal is to store automations created with a text editor in a separate file located in a separate directory.

Is there a reason why we include a whole directory (instead of just a file) when splitting up automations? And what do I put in that directory? One yaml per manual automation or?

The sub-directory can contain one or more files.

You can store all of your manually created automations in one file or in several files (each file containing automations serving a common purpose).

For now, I suggest creating a single file within the directory, containing this one automation.

Got split config working. Thanks for the help.