Hey there,
one thing I got annoyed by when switching from Google Home to the Voice PE was that while I was talking to it, my TV, music, etc. kept on playing and it was hard for the device to understand my commands.
Google Assistants usually turn down the volume, so I thought why not muting all media players in the room while I’m talking to Assist.
It’s nothing too complicated nor has it many options - but for those who want to add that feature I made a blueprint:
Any suggestions are appreciated
Have a great weekend!
Max
There is just one bug I found: when you spoke a voice command to change the volume of the muted speaker, this blueprint restores the previous unchanged volume.
I’ve checked multiple devices and couldn’t reproduce your issue. Can you describe your usecase a bit further? Are there maybe other scripts running which change the volume?
This blueprint doesn’t really change the volume itself, it just calls the action Medie_Player.volume_mute()
I have a Sonos Roam speaker in my kitchen as well as a Voice PE.
When music is playing at 30% volume and I say “Okay, Nabu. Set the volume to 40 %.” the following happens:
When Voice PE recognises “Okay, Nabu.” the Sonos Speaker is muted.
Voice PE recognises the command and I see that the volume of the muted speaker is changed to 40% (having an eye on the corresponding entities in Home Assistant).
The Sonos speaker is unmuted and the volume goes back to 30%.
I don’t have other automations that could interfere. At least as far as I know.
When the Voice PE in my kitchen is playing media, setting the volume of it via a voice command works. The playing music is not fully muted after "Okay, Nabu.“ is recognised. It is playing on low volume while Voice PE is listening.
The same Sonos speaker is also available as a media player via the Alexa Media Player integration. After deactivating this media player entity (I don’t need it anyways), everything works as expected.
I just want to say it’s people like you which make Home Assistant incredible. Thank you so much for this script. I had the same issue and found it a real pain, almost to the point where it was unusable in my cinema room and causing embarrassment during a high-tech movie night, hehe.
I installed this and initially it did not work. I checked the automation trace log and saw this:
Entity media_player.yoga_smart_tab does not support action media_player.volume_mute
I also have the “Music Assistant” addon installed, and it creates alternate media_players and I got the same problem (mute not supported) on the Airplay version of my Sonos speaker.
I actually didn’t think of media players not having a mute function, but it seems possible.
Therefore I upgraded the script (currently as a separate script) for you to try out. It actually lowers the volume now to a certain threshold you can define. Please tell me if this solves your issue
HowlingCoder!
Thanks for the great blueprint.
I’m using an old land line telephone connected to a GrandStream ht818v2, and then through freepbx to the VoIP integration.
I found your blueprints, and they work like they are supposed to, but the connection from VoIP seems to toggle around between the four states, while the microphone in the landline phone stays active. As soon as the connection is no longer listening (because of the silence) the Blueprint un-mutes the music, causing the connection to transition to listening again.
I added a delay when the phone transitions to idle so that it doesn’t immediately go back to unmuting the music, but that seems to have left the VoIP connection in a bit of a tizzy.
Is there a VoIP assistant state that is separate from the listening / not listening - specifically when the VoIP SIP connection is active, and then when the user hangs up?
Once I figured out how to get the particular extension into the same room as the stereo it should mute, it worked great, with the given caveat above.
Keep up the great work, let me know how I can help if you need more information.
Thank you so much for your kind words.
First things first, I have no real experience when it comes to VoIP but if I get you right, your issue is that the connection gets closed although you’re still on the phone and this causes troubles - right?
Since the integration itself changes the assistant right away after the delay I fear we cannot do anything here:
From what I see in the integration there is no state when the call really ended.
The only idea I would have would be to mute everything but put the volume back every X seconds for some short interval to keep the connection running.
I’ve got a Roku TV, and the mute script works fantastically, with basically minimal configuration on my part. You saved me a lot of time trying to work this out on my own.
Unfortunately, the Lower Volume script doesn’t work because I believe the Roku API doesn’t support the set volume function based on this thread. I plan to work on this eventually, but thought I’d mention it in case anyone else with a Roku came across your blueprint and came away thinking it was broken.
I’m also still using a landline with VoIP but the Fritzbox call monitor integration simply has a talking/dialing/ringing/idle state which works fine to mute the media players.
As long as HA cannot distinguish the real different states from your phone, I guess you will not be able to solve this.
I have seen a custom FreePBX add-ons that can be installed via HACS, maybe that’s an option…