The automation seems quite simple, trying to imitate the process, as the speaker does - whenever I say “Hey Google”, if it’s playing something, the volume goes down.
Now, the problem I can’t wrap my head around, is how to communicate with HA when the speaker starts listening. Its status doesn’t change from “Off”, even when it activates after the command: “Hey, Google…”
I have both. Broadlink and WebOs integration. So there’s no problem with the connection between the TV set and HA.
The problem is how to make the HA receive any kind of data saying that the Google Speaker (mini nest 2) is in listening mode, after I said “Hey, Google”.
You can add a boolean that you set to on with google home, then read the state change in the automation in HA.
Just don’t forget to set it to off at the end of the automation
But this requires a link between Google and HA (Nabu casa or the free way of doing it)
I think the initial ‘hey google’ and immediate response are handled entirely locally on the speaker, and as far as I know it doesn’t deliberately signal anything on the network when it’s doing that. It may start sending the processed request out to the assistant servers soon after it starts listening, I’m not sure; but you’d need to catch that request going from the speaker through the router somehow (mitm proxy?). I haven’t heard of anyone’s that has done that, but it’s possible they have.
A different line of attack would be to listen for the ‘hey google’ keyword with a different device’s (e.g. raspberry pi) speech recognition system and use that to signal the tv. Timing would be an issue.