I’ve been struggeling quite a bit with running HA scripts from Google Assistant and feel that many posts here describe a Google Home app that has changed its interface. At least, I was confused. Since I got it working now, I’d like to share my learnings.
Pre-requisite: I’ve used the Nabu Casa cloud connection for Google Assistant. This might also work without Nabu Casa.
Test Script: I’ve put together a little test script that uses TTS to say something on a certain media_player:
alias: Hallo
sequence:
- service: tts.azure_say
data:
entity_id: media_player.laptop_work_edge
message: Auch ich grüße dich!
mode: single
You can obviously use any TTS service and any media_player.
Goal: I wanted to say something like
Hey Google, lass uns loslegen
or
Hey Google, aktiviere Hallo
The second example uses the name of the script. The first one a new unique command.
Confusion: After creating the script, I noticed a new entity showing up in the settings of
Configuration → Home Assistant Cloud → Google Assistant → Manage entities
Make sure this is marked in green to be synched to Google Assistant. Also note, that HA presents the script as a scene:
This confused me quite a bit. The Google Home app and Google Assistant don’t show scenes anymore. In the past, it seems that they were presented like other entities and that you could assign them to a home and rooms. This doesn’t seem to be the case anymore. Also, some posts here talk of shortcuts. This doesn’t exist in my Google apps either.
Solution: I assume, you have completed the basic setup of Nabu Case (or alternative) with Google Home already and your lights show up and work well.
To find the scene / script, I first had to sync HA with Google by clicking on “sync entities to Google” in the Home Assistant Cloud settings. Then go over to the Google Home app. In the top right corner there should be your profile pic. Select it and then choose “Assistant Settings”. You find a very long list of settings. Here you select Routines (in German: Abläufe). This presents you with some pre-configured generic routines.
On the top right there is a plus button to create a new routine. First, you have to “add a starter”. Select “voice command” and now you can come up with your new unique command, like in my example “lass uns loslegen”. Note: Google Assistant doesn’t like an exclamation mark or a question mark at the end. I first got stuck here just because of the extra punctuation and Google Assistant kept refusing to execute the command.
Next, you have to add an action. Clicking the button brings up all sorts of generic actions. Select “Control home devices” or (in German: Home-Geräte einstellen). Another list of options comes up and you would like to select “Control scenes” (in German: Ambiente steuern). Make sure to press the tiny arrow on the right to the a list of scenes. And finally, there you are. Here is the list of your HA scripts!
I’ve selected the script “Hallo” and then clicked the confirmation buttons all the way back to complete the setup.
Now you can call the script by saying:
Hey Google, lass uns loslegen
or whatever you typed in as a command. Google Assistant will silently do it. If that’s all too complicated, well the “Hallo” script also works by invoking it directly, saying:
Hey Google, activate Hallo
However, in that case, Google Assistant will respond and tell you that it understood and is now going to activate “Hallo”. I find this rather annoying.
Hope this helps you save some time.