Volume_mute Node-Red Toggles, does not mute On/Off

I had some nodes to mute and unmute a media player (TV) and they never quire worked right. I created these a long time ago.

I have a couple of action nodes with the following data:

{“is_volume_muted”: true}
and
{“is_volume_muted”: false}

After some testing I discovered that these actions merely toggle mute.

If you trigger {“is_volume_muted”: true} multiple times, it toggles mute. Basically, sending this command does not only mute, it can also unmute.

The same is true for {“is_volume_muted”: false}.

Both data work exactly the same.

What am I missing?

Home Assistant provides a Building Block Integration for the media_player, which is not used directly but is used by other integrations to build “real” integrations.

Whilst the HA base integration does include the action “media_player.volume_mute” with the boolean value setting “is_volume_muted”, quite how this is actually implemented (if at all) in each “real” integration is open to interpretation and practicalities.

Your TV, like mine, connects to HA via an integration that is built around the HA Building Block, hence it will offer the volume mute action. However, the TV itself may only have the option to toggle mute on and off, just like a TV remote does. There are not two buttons on my TV remote - “mute on” and “mute off”, just the one “mute” button you press to toggle between the two settings.

Since your TV integration (and mine also) probably mimics the remote to control the TV, and therefore does not provide “set mute on” and “set mute off”, just “toggle mute”, the integration can only issue a ‘toggle mute’ command, which it helpfully does for the called action regardless of setting.

There may well be other integrations where the device attached does have control for “set mute → <on/off>” rather than just “toggle mute”, in which case the two values for the action would indeed offer different outcomes.

1 Like

Ahh okay that makes sense. Thank you so much!

With this knowledge I found a workaround to some issue I was having so it’s all good now.