Extract data from Google Assistant voice commands

Hello, I’m just getting started with HA and this might be a very advanced topic but it’s part of the features I’d love in the new smart home system I wanna build in the future and that’s why I started diving into HA.

As the title suggests I’m looking for a way to get certain parts of the voice command to use in scripts or as conditionals. The real use scenario for this would be having, for example, a voice trigger “Hey G, relax” to trigger mood lights. Issue is that right now you can build one routine in Google Home that has that command and that operates specific devices, usually limiting that routine to a single room or single devices. What I would like to achieve is having the same voice command while HA figures out in which room that command came from and act accordingly. In this way I can just say “Ok Google, relax” and if I’m in my bedroom, living room or whatever, different scenes get triggered depending on which room the command originated.

This might also allow me not to have to share routines between family members.

Also open to other workarounds if they exist.

Hope this is clear

Thanks

Possible, but no easy. See