#How to route Voice Assistant TTS responses to a different media_player?
1 messages ยท Page 1 of 1 (latest)
How to designate a media_player as a Piper output?
Thanks, I've read over that a dozen times by now. I understand the YAML, but I don't know where to put it so that all Voice Assistant output gets captured by it.
it might help to describe what you want to do a little bit better. that action can be run anywhere an action can be run: in scripts, automations, in the developer tools
...but it has nothing to do with Assist. it just outputs TTS to a media_player
Ah, I see.
So, whenever Voice Assistant wants to say something, I'd like for that to come out of a specific list of speakers.
Let's say I say "Marvin, what's the temperature in the living room?", I want the response to come out of all those media_players specified.
what satellite(s) are you using?
Something funny just happened by the way ๐
For microphones, I'm using wyoming-satellite on the various PCs/laptops. But for speakers, I'm wanting to use Snapcast clients. Each room has a pretty beefy set of speakers connected to a Raspberry Pi running Snapcast. Homeassistant is already aware of these; they're available as media_player entities.
understood. by default, HA returns the TTS output to the assist_satellite which you used to query the system. in your case, that's the wyoming-satellite instances. on those systems (i.e. on the RPis), you will need to implement something which routes output audio to the Snapcast clients. That's not related to HA at all and it is above my pay grade
maybe there's someone who can help you achieve it, though
Oh. That's quite sad.
Thank you for the honest answer, though!
I'll leave this open and perhaps edit the title once more.
How to route Voice Assistant TTS responses to a different media_player?
Perhaps something simpler as an intermediary step first. Can I create an automation or a script to make the following possible?
"Marvin, please tell my wife dinner is ready. She's in the bedroom."
"Sure. I'll let her know." (response out the same satellite)
"Dinner is ready in the kitchen!" (response out the bedroom media_player entity)
are you using LLM-based conversation agents?
Yes, but with fallback enabled. My current model is llama3.2, that's what produced the funny response above.
Something like the sample interaction outlined above might be easier with fixed sentence patterns, though, no?
no, not really
in theory, with a large enough model, that sentence should work out of the box, with no particular intervention from you. however, you might have to teach it what "tell" is supposed to mean, e.g. "When I ask you to tell someone something in an area, play some TTS over the media_player in that particular area, if there is one." via the system prompt.
alternatively, you can create a script such as this and expose it to Assist
alias: Announce message in area
description: >-
Plays a text-to-speech message (provided in the `message` input field) in the
media players in an area (provided in the `area` input field). It can be used
when Home Assistant needs to "tell" something to a person.
fields:
message:
selector:
text: null
name: Message
description: The message that needs to be announced over TTS.
required: true
area:
selector:
area: {}
name: Area
description: The area_id of the area where the announcement should take place
required: true
sequence:
- variables:
target_media_player: >-
{{ states.media_player|selectattr('entity_id', 'in',
area_entities(area_id(area)))|map(attribute='entity_id')|list }}
- repeat:
sequence:
- action: tts.speak
metadata: {}
data:
cache: true
media_player_entity_id: "{{ repeat.item }}"
message: "{{ message }}"
target:
entity_id: tts.piper
for_each: "{{ target_media_player }}"
LLM agents can use scripts with proper descriptions
If you figure out how to get a Wyoming Satellite (voice assist) to send the TTS response to a different media player, please post how to do it here because I'm in the same boat! I'm currently building a home and will be installing dozens of voice satellites in my ceilings in every room of my house but I have a central amps + in-ceiling speakers and I want all voice assistant TTS to send the response to my whole home audio system (HTD Lync12).
Thanks for this, I learned a good number of things from it. Unfortunately, my LLM and I are having a disagreement about it. Marvin insists the speakers need to be unpaused. There's no such need, but I can't convince him otherwise.
Good to know I'm not alone ๐ . Not so sure if making the satellite responsible for this is the best idea, but I believe tetele when he says that's how this would work. Are you planning on having an RPi Zero 2 W in each ceiling? Sounds a little expensive. I'm still hoping to be able to use ESP32-based satellites for the microphones.
I'm currently testing 2 devices (for in-ceiling) voice assistants. The ReSpeaker Lite and FutureProofHomes SAT1 devices. Honestly, I wouldn't care how we skin the cat but I'd love either the voice assistant or home assistant to send the TTS to a media player of my choosing (if possible)
#1284966915055288530 is full of questions and answers about how to achieve output routing to another media_player for ESPHome satellites. That's actually very easy to achieve
After now having learned how to create a script (top-right corner, three dots, there's a menu item "Edit in YAML" - finally I'm free from that confusing GUI) ... then pasting the code from the TTS docs there and hitting "Run", it complains:
Entity media_player.bedroom_speakers_snapcast_client does not support action media_player.play_media.
Interesting. Is there something missing from the Snapcast Integration perhaps?
๐คทโโ๏ธ obviously, it needs to be able to do that in order to get anything announced. you could simply run tts.speak from the dev tools action console just to test
Do you mean this here? I think we're getting closer to the core issue. There's no area, no device, no entity for me to select. None of the media_players are recognized by tts.speak, it seems ... I must be missing something very, very basic? ๐ฒ
This is all the media_players, if it matters.
What version of HA is that? tts.speak is missing several inputs i was expecting
Pick tts.piper as the target entity and tell me if anything changes
You haven't got the right action description either ๐ค๐ค๐ค
This is ok
I mean the service call is correct, but the media player doesn't seem to support it. Can you try another one?
I can, but they're all pretty much exact clones of one another. Just the names differ.
Yeah, same result for kitchen or workshop.
Can't help. Try #1284966582375813201
Okay, thank you for your patience! I learned a lot already!