Is there a way to identify the google assistant that is calling a home assistant script?

I have the following script which has a google assistant speaker announce the time remaining on a timer. I use a google assistant routine to fire off the script.


timer_remaining:
  sequence:
    - condition:
      condition: state
      entity_id: 'timer.frontdoor'
      state: 'active'
    - service: timer.pause
      entity_id: timer.frontdoor
    - service: tts.google_say
      data_template:
        entity_id: 'media_player.entryway_speaker'
        message: "{{state_attr('timer.frontdoor', 'remaining')}}"
    - service: timer.start
      entity_id: timer.frontdoor

However, I have many google minis. I’d like to be able to have the tts respond to the google assistant that called the script. How can I tell which google started things off?

I’ve recently done this. It is not graceful at all, and I can’t guarantee 100% accuracy (although so far so good here). I do it in NodeRED and it is somewhat specific to my setup, so I’m just going to describe it here and hopefully it gives you a general idea as to how it could be done.

1, On my home router/firewall (running pfSense) install darkstat and monitor only traffic going to/from the google minis.

  1. NodeRED (NR) constantly polls the darkstat UI every 5 seconds and compares how much traffic has happened for each of the minis compared to the previous poll.

  2. Eliminate anything where IN traffic was less than 10k or OUT traffic was less 100k. (these numbers were based on some very informal testing).

  3. For whatever minis are left, the one that had the highest IN traffic is likely the one you were speaking to.

Apparently this is impossible, because Google (and Alexa) doesn’t expose any information about the request.