Google Home Scripts?

I see that you can have HA scripts for google home. Has anyone done this yet?
I’m not sure how to start to have google home recognize a script. What I would like to do is say “Good bye House” to one of my google home’s and have HA unlock my front door for me to leave and then once I’m gone lock the door and arm the alarm.
Would I be asking to much from google home or HA for this?

1 Like

yes, you can run scripts from google home.

read about setting up the google assistant component here: https://home-assistant.io/components/google_assistant/. (for good order, you can also accomplish this with dialogflow, but the voice commands you have to use are arguably less natural.)

once google assistant is set up and some/all of your scripts are exposed, you can run them by saying things like “hey google, turn on good bye house.” (i think “activate” also works, but i can’t check right now.)

if you truly just want to say “hey google, good bye house,” there’s a good chance you can create a shortcut in the google assistant app on your phone that maps the command “good bye house” to “turn on good bye house.” i say good chance because some have said the shortcut feature is locale dependent (it works in the US at least).

good luck

Not sure if its what you’re wanting, but I’m currently doing this with IFTTT using a WebHook. The script turns off all the lights, locks the doors, and responds via tts.

Yes thats what I’m looking for. What would your script look like?

Here is a similar script that I use. You could add another delay and then lock the door and set the alarm

goodbye:
  alias: "Goodbye"
  sequence:
    - service: light.turn_off
      entity_id:
        - light.kitchen
        - light.cabinet
    - service: remote.turn_off
      entity_id: remote.living_room
    - service: lock.unlock
      entity_id: lock.front_door
    - service: light.turn_on
      data:
        entity_id: light.living_room
        brightness: 200
        color_temp: 200
    - service: light.turn_on
      data:
        entity_id: light.foyer
        brightness: 200
    - delay:
        seconds: 30
    - service: light.turn_off
      entity_id: light.living_room
    - service: light.turn_off
      entity_id: light.foyer
1 Like
sequence:
- service: lock.lock
  entity_id: lock.frontdoorlock_locked
- service: light.turn_on
- service: media_player.volume_set
  entity_id: media_player.all_speakers
  data_template:
    volume_level: 0.5
- service: tts.google_say
  entity_id: media_player.all_speakers
  data:
    message: 'Ive locked the front door and turned off all the lights.  Goodnight.'  
    cache: false

Here’s mine. We trigger it from a GH mini in the bedroom. Oh and one more thing. In the IFTTT field that says “What do you want the Assistant to say in response?” I use a non-printing character like “▄” to mute the Assistant response since I’m using the media player to respond.