I was trying to lower the Sonos player volume when I speak to the assistant just like Alexa does
Can you pause the Sonos instead? That’s a useful workaround.
One observation here
It isn’t a problem with the voice PE but with your automation to lower the volume.
Alexa doesn’t need any automation to do this, as long as the player is in the same area it lowers the volume automatically I think this should be embedded as a capability
That would be very hard to do reliably given the heterogeneity of HA setups.
Why not make a blueprint and share it with the community?
I do not agree, media_player is a standard API, as long as a media_player is in the same zone volume could be lowered, this would work in all setups.
I could share something if i could make it work, i can’t manage to change the volume and create a snapshot when voice goes out of “idle”, also its annoying that it needs to be done for every voice receiver.
It takes a lot more than that. Imagine a room in an advanced installation with 6 different media providers and 5 different players. (I literally have 12 media players in my master bedroom…)
You nedd to come up with a way differentiate what player to use for what.
I use the music assistant llm script and carefully edited my players so that only one music assistant player exists in any given room. (otherwise MA barfs all over the call) That works for play music. I’ll have to replicate it for video… Different set of players, usually a TV or monitor. And one for announcements in a room. Different players that’s the TTS or Voice assistant tied to a room. Change volume… Different players. This time universal that represents the AVR stack for a room because for some reason the player that can successfully start playing a Playlist barfs if targeted with pause…
Even with carefully crafted universal media players designed to ease the controls for humans. I still have to have custom scripts to help the targeting. It’s far from easy. Because of this J can’t just spam an area with a volume or the balance for a stack gets messed up. Could it be made easier - yeah by designated default players for media type. But you can simulate that with labels.
I am not talking about using the players just lowering the volume while talking to the assistant just like Alexa does. I don’t see the problem not even if you have 100. You just need to:
- Understand in which area the voice has been triggered
- Store a snapshot of all media_players status in that area (actually just the volume)
- Lower the volume on all
- Restore when voice is finished
Alexa does this with zero configuration, as long as the player (Sonos or TV) is in the same room volume will be lowered when voice detection is triggered on the device and restored when conversation is complete. So when i talk to my Echo device all my Sonos devices in the same room are lowered so i can actually hear what Echo is saying.
And because volume leveling and balancing and capabilities of players. That exact function causes volume balancing issues and a number of errors because of player capabilities.
Yes I’d love to just spam every media player in an area with store x, reduce vol by 10%, loop through and restore vol. But I’m telling you it’s not that simple. (that exact script in my setup errors on 6 of the players and causes a volume balance issue because of double reduction on two players that one pumps through the other) Instead you have to I’d the right player and mute that. This the convoluted setup I just described.
I didn’t fall into it because I wanted to. It was because I started trying to solve this exact issue like you described and it got more and more complicated as you peel back the layers. My solution is label the one you need and hit that.
If Alexa does this it means that it’s ok for 99% of users, for the remaining 1% it would be enough to just paise the player instead of changing volume.
Point is that I would expect this to be part of the official voice API, there should be an option in home assistant voice settings to decide what action to take when a satellite detects voice, either set volume to X, pause or just leave players in the same zone as they are. From a technical perspective is trivial APIs are already there.
I can tell you if you’re playing audio through the VPE media player entity itself, there is some mechanism internally on the VPE esp32 code that does exactly this. Found that little gem Saturday trying to figure out why it was muting audio on certain players.
Cast Spotify to the VPE in my office. It muted. Cast Spotify to the Default player in my office. (pc running Hass.agent) no mute. And it’s a nice intentional one too. Fades the music down as the chime for the voice pops…
Both play through the same soundbar and the audio balance was good enough that it took me an hour to figure out they were actually different player targets before I made the connection that voice playback on the device DID mute the music side of whatever is going on in the DAC but I didn’t see it in any of the external entities for the VPE great if the VPE is your only player but… If that were the case we wouldn’t even be having this discussion
Seconded. I have SIX media player in the living room. Only ONE is to be muted whee assistant listens.
Ppl think we’re kidding about heterogeneity. We’re absolutely not.