Hey all. I have a project that extends some of the HA Assist functions. I'm trying to set things up so that when MA is playing media and the user issues the wake word that the current MA volume is lowered so that the lyrics of the song playing are not picked up as part of the request. I see the attached options on my squeezelite player. Does this factor into what I am trying to accomplish?
#Volume ducking for HA assist responses
1 messages · Page 1 of 1 (latest)
That's just for tts announcements sent to the device while it is playing
people in the HA discord have written automations and scripts that can do area audio ducking when assist activates
this works for me https://community.home-assistant.io/t/voice-assistant-same-room-media-player-volume-down-on-assist-ducking/821871
Home Assistant Community
I’ve created blueprint automation that while assist is working sets volume to 1/3 on media players in the same area as HA Voice assistant.
Thanks for sharing. Will give it a look for sure. Would you mind if I adapt for my View Assist project?
Does it restore volume after the assist?
What if the command is changing the volume, is the restoration then not done?
Sure use it as you like. It’s published out there
It works like this:
triggered if pointed assist is not idle
Set volume of same area mplayers to 1/3 current value
Wait for assist to finish
Set volume of same area players to 3x current value
And that’s it. I’m not using assist for volume control. I don’t know of a way to store variables in automations. And the things I’ve tried were not working because of strange variable scoping in automation. So if you figure this out feel free to reuse any part of my blueprint. For now, I can imagine a volume limiter of some kind which will prevent this 3x volume action.
I just took a look at the BP. Curious on your thoughts for a different approach. What if you allowed the user to set a default lower volume in the BP and then it would just be a matter of changing to that value and then reverting to the original when done?
My project pulls in a bunch of different satellite types (stream assist, HA satellite, Wyoming/ESPHome) so I would need to modify for the Assist trigger for all types as they are somewhat different than each other. It's a bit of a challenge to try to support all devices but so far so good.
https://github.com/maxi1134/Home-Assistant-Config/blob/master/automations.yaml#L5117-L5228
Here is my code for this, I have a check removing volume raising if the voluime was changed in the meantime
Maybe you want to add that to your blueprint
- condition: template
value_template: '{{ (state_attr(playing_chromecasts.0, ''volume_level'')
| float | round(2, ''floor'') | float) == desired_volume | round(2, ''floor'')
}}'
thanks. I've used some of your filters and modified my blueprint to include volume changes awareness.
But let's not forget we are on MAss discord 😉