Component to send commands to Google Assistant

Tags: #<Tag:0x00007f739295d230> #<Tag:0x00007f739295d0c8>

I found this in GitHub. Seems to work quite well, any chance we can have it as an add-on for Hassio?

Or even better make it an official component?

Basically this will allow you to send commands to Google Assistant.

If a native component can be created it would make it so much better.

With the templating and some creativity you can basically achieve anything that Google Assistant can do BUT from HomeAssistant.

Examples:

-Play whatever music you want from Google Play Music/Spotify in a device
-Play a TV show/Netflix from Netflix on a device
-Play a video from YouTube in a device
-Control devices that are only supported in Google Assistant
-Add notes and reminders to your Google Account
-Set Alarms in an specific Google Home

For example you could do it with templating and a few components, let me give you an example.

Having a:
-Input Select (Netflix, YouTube as the options)
-Input Select (Bedroom TV, Living Room TV)
-Input textbox
-One button

Then on the input text I can write “Friends” and I’ll select “bedroom TV” and “Netflix” from the input select.

I click the button and it will trigger a script that will pass the command to Assistant-Relay like:

Play + “Friends” (from the input text) + from + “Netflix” (from the input select) + on + “bedroom TV” (from the input select option).

This could be done for basically anything. With templating you can compose the sentence to pass to Google Assistant.

An add-on will do the trick. We just fill in accounts, OAuth token and we can start using it.

Hopefully it will create a service we can use pass the parameters.
At this point even adding this Assistant-Relay as an add-on and using the web API is is helpful as we can just send the curl command via a script.

1 Like

Awesome, this does exactly what I’m looking for.

Too bad nothing like this exists as an official component or add-on. This gives you so much more to play with and get creative with.

Just tried this a couple of nights ago. Heard a lot of good results from assist relay.

So I’ve been having some issues with this and the Google SDK integration. Basically same issue. Container seems to stop working after getting the code back from Google.

1 Like
5 Likes

Can I use to query a keyword from Google, so I can add it on a shoplist?

Holy crap. Within 10 minutes I set this up and was able to have Home Assistant tell Google Assistant to turn on my car. This is insanely awesome, and terrifying. Thank you!

2 Likes

Still don’t understand the purpose of this component , why do you want to send commands from home assistant to Google to devices, if you can control devices directly from home assistant?

Can someone give me an example so I can understand?

To have Google Assistant do something that doesn’t natively connect to Home Assistant.

Example: https://old.reddit.com/r/homeassistant/comments/e384ok/home_assistant_does_not_support_toyota_for_remote/

Or just to have Google Assistant do something that is natively does and you can’t just do directly from Home Assistant. Like have Google Home speakers “Play News” automatically when you get home.

Ok, clear! Thnx , I understand, all though I don’t know what I can do trigger at the moment :wink: since I can control already everything in Google, coming from HA…

In my case was mainly music, Netflix, etc that cannot be controlled by Hassio.
At least I cannot start my music, playlists or Netflix from Hassio.

interesting, dont use netflix, i use plex :slight_smile: , but thats not possible (offcial) with google assistant or HA , that would be a good usecase for me

1 Like

So I did get this working and big thanks to @Apipa169 I’ve wanted this for so long, since when I was using Hubitat and had problems getting it running.

Buuuuut… It doesn’t do what I want it to do, and it’s Google’s fault.
I want to be able to issue commands to a Google Mini, like play white noise and I can’t.
Light commands and such work but not “play white noise on child’s room speaker”.
Which is weird because it’ll work if I say that to one of the units in my house.

1 Like

@Apipa169 I am trying out your add-on and I can’t ge the user setup to work.

After installing, and running thru setup, in the add new user pages:

Step 2 is where I enter a name and select the client secrets json file. when I select Next, i get almost nothing. Just a new browser tab titled ‘about:blank’ and it has no content (it’s blank).

After I close that tab, I get a Step 3 page where it is asking me for a authorization code for a token. I don’t know what to put there.

I think that the ‘blank’ page should be a user consent page. I think that Google needs to get my consent before giving authorization. I have tried using Chrome and Safari browsers on a Mac, and Chrome on an Android phone. I have enabled popups on all.

1 Like

Also having the same problem, only a blank page on step 2, so no auth code. Any help?

they just fixed it… update the addon

2 Likes

Correct, the issue has been solved!

1 Like

BTW is it possible to use this component with Nabu Casa cloud instead of manual Google stuff setup for getting OAuth etc. requiring https and certificates ?
TIA, Reps

@Apipa169 Is it possible to send commands to a specific Google Home with this add-on? I’m seeing a lot of mention of broadcast, but in my scenario I am trying to target a specific Google Home in my garage without broadcasting on the other four Google Home’s that are inside the house.

Thanks

Unfortunately that’s not possible due to limitations at Google.