Detecting what Google speaker was used for script - is it possible?

Hello

Apologize if this was answered already (I am unable to find anything related to this topic).

My desired scenario:

  • I have a script in HA which does some checks then provides a feedback through TTS
  • I have a few google nest speakers at home and I would like to get the TTS to the speaker used to give the command

I used other scripts which define the destination speaker using entity_id

Is it possible to recognize what speaker (entity_id) was used to give the command so to send the TTS to it?

Thank you
Stefano

1 Like

Also interested in this. did you ever find an answer?

Got no info… yet…

I still do not know if it is possible.

Also looking for a solution to this. Wife always checks what is temperature outside. I expose the temperature sensor (named outside) to google and when she asks: “hey google, what is the outside temperature”, it will say the temperature in English.

I would wish to simplify this by simply saying: “hey google, activate outside temperature” (script name) and it would read the temperature in Slovenian language (Google TTS) on speaker that called the script.

Has anyone figure out if this is possible?

I’ve been looking into this a bit. But for now, it does not seem possible.
Home Assistant Cloud is generating an event indicating what entities it will be impacting.
That event does only specify “cloud” as its source.

"event_type": "google_assistant_command",
    "data": {
        "request_id": "6771257377434227383",
        "entity_id": [
            "light.ceiling_1",
            "light.ceiling_ambiant"
        ],
        "execution": [
            {
                "command": "action.devices.commands.OnOff",
                "params": {
                    "on": false
                }
            }
        ],
        "source": "cloud"
    },
    "origin": "LOCAL",
    "time_fired": "2021-08-23T10:07:24.699812+00:00",
    "context": {
        "id": "CorrelationUID",
        "parent_id": null,
        "user_id": "UserUID"
    }
1 Like

Is there anything new about this?

If someone has an “actual” solution I would gladly take it as well.

I was looking into it last week and didn’t find any proper solution.
I ended up with a simple workaround:
I created 1 button per Google Nest/Home I have (I only have 3 so the solution was acceptable for me but honestly even if I had 10 it would still be acceptable to me). I named all of them the same but I put them in different rooms.
Each button will call the same script pushing, in a variable, the name of the Google device to trigger.

This way, when I ask google to “activate [my button name]” it will call the button in the room (and not one of the 2 others) which will trigger the whole script in HA and the result is sent to the proper Google Nest/Home.

For anybody who finds this topic, I created a script a while ago which specifically does this (using a trick involving routines and ambient sounds): Script to send actions to the right Google Home (based on voice commands)

2 Likes

I have the problem that sometimes my google speakers don’t do the TTS correctly, they stop/start during the message. So I created an input text field, then as part of my tts script:

service: input_text.set_value
data:
  value: "{{as_timestamp(now())|timestamp_custom('%-I:%M %p') }} - {{ player }} - {{ message }}"
target:
  entity_id: input_text.last_tts

In my case, the {{player}} field will show me which speaker is used.