#How to route Voice Assistant TTS responses to a different media_player?

1 messages ยท Page 1 of 1 (latest)

maiden mortar
#

What the title says. How do you tell Piper a list of media_player devices as outputs?

maiden mortar
#

How to designate a media_player as a Piper output?

maiden mortar
brave sparrow
#

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

maiden mortar
#

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.

brave sparrow
#

what satellite(s) are you using?

maiden mortar
#

Something funny just happened by the way ๐Ÿ˜…

maiden mortar
# brave sparrow what satellite(s) are you using?

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.

brave sparrow
#

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

maiden mortar
#

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?

maiden mortar
brave sparrow
#

are you using LLM-based conversation agents?

maiden mortar
#

Something like the sample interaction outlined above might be easier with fixed sentence patterns, though, no?

brave sparrow
#

no, not really

brave sparrow
#

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

grand peak
#

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).

maiden mortar
maiden mortar
grand peak
#

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)

brave sparrow
#

#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

maiden mortar
# brave sparrow https://www.home-assistant.io/integrations/tts/#action-speak

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?

brave sparrow
#

๐Ÿคทโ€โ™‚๏ธ 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

maiden mortar
#

This is all the media_players, if it matters.

brave sparrow
#

What version of HA is that? tts.speak is missing several inputs i was expecting

maiden mortar
brave sparrow
#

Pick tts.piper as the target entity and tell me if anything changes

maiden mortar
brave sparrow
#

You haven't got the right action description either ๐Ÿค”๐Ÿค”๐Ÿค”

brave sparrow
#

I mean the service call is correct, but the media player doesn't seem to support it. Can you try another one?

maiden mortar
#

I can, but they're all pretty much exact clones of one another. Just the names differ.

#

Yeah, same result for kitchen or workshop.

brave sparrow
maiden mortar
#

Okay, thank you for your patience! I learned a lot already!