Room aware Google routine that triggers different HA script

Hi

I currently have an automation in Google home that’s using a home assistant script in its actions to turn on devices in my living room when I say ‘turn on tv’ or ‘lets watch tv’, this works fine but is there a way that I can have the script called specific to the room I’ve asked it in?

I’d like to be able to say ‘turn on tv’ or ‘lets watch tv’ in my bedroom and have Google run a different script in its actions specifically for the bedroom, currently it just runs the same script regardless of which room I’m in.

Does anybody know of a solution for this?

2 Likes

As far as I know google does not expose what assistant device sent or received the request, so in simple terms no.

You could try playing with some logic in HA depending on your household setup and what other sensors you have available to you.

You could for a really simple example have the automation or script decide to activate a particular tv based on what room with a google assistant last or currently has motion etc

2 Likes

Thanks for the suggestion, I’ve not currently got any motion sensors but will look to pick up a few Aqara p2s in the future, so this could be a possible solution if there isn’t a simple fix

1 Like

I think I’m working on something that can help with this. I track how many people are in a room so you could link it together (let me know if I’m missing the point) I have more info at roomaware.com

Clint: I believe what Daniel-W wants is a way to customize a fixed/static command based on which Google heard the prompt. In theory, Google even knows who’s speaking. In this case, adding sensors to monitor the count or movement of bodies isn’t a solution.

There is a way, however:

  1. Create a unique select template with friendly name myTV for each different Google room.
  2. Create Google automations via app (or now web-based). As the action, use set myTV to choice where choice is one of the options defined in the template.
  3. HA will call your template action with choice. You can then do anything you want. If you call a common script, you can pass the room based on the particular template along with the choice from Google. Your templates don’t need to track any state. You can just return a static value like ‘Ready’.

I suggested select because it allows unlimited options. You could actually use the same select for multiple devices in the same room. You’d just need to encode the options. I know it seems convoluted, but even in 2025, it’s still the only way. I wish Google would just pass HA the room and phrase. At least for the things I’m doing, I could easily match all variants with a single regular expression. No AI required.

1 Like

Thank you for coming back to me on this