How do I "expose" scripts to Google Home

So I’ve created a script that I would like to run with Google Home. Basically, I want to be able to tell google home goodnight, and have it run the script. I know the script will work, but I can’t find anywhere that actually describes how to expose the script to google home. Can someone shed some light on this for me, or point me in the right direction?

1 Like

Scripts are exposed by default. I assume you have the google assistant component installed and working with other things?

Otherwise post your google assistant settings…

I do have my google home working with other things. I did a google_assistant.request_sync, and I still don’t see the script in my home control section of the google home settings.

Do you have expose_by_default: true?
You should also have exposed_domains: and scripts there.

My config yaml looks like this:

# Google Assistant
project_id: !secret ga_project
client_id: !secret ga_client
access_token: !secret ga_access
agent_user_id: !secret agent
api_key: !secret api-ga
exposed_domains:
  - switch
  - light
  - scene
entity_config:
  light.yeelight_white_xxxx:
    expose: false
  light.yeelight_white_xxxx:
    expose: false
  light.office_light_group:
    expose: false

(part of it and I’m using an include file in config so I have the google stuff in it’s own file)
You would want your config to look like this:

# Google Assistant
project_id: !secret ga_project
client_id: !secret ga_client
access_token: !secret ga_access
agent_user_id: !secret agent
api_key: !secret api-ga
expose_by_default: true
exposed_domains:
  - script

If you have expose by default as false then you would need to configure the individual entities you want exposed (or hidden as in my example)

Hope this helps

Thanks a ton for the info. I did NOT have expose_by_default: true. I ended up just placing script in my exposed domains under google assistant in the configure.yaml. Everything is working great now! Really appreciate the help.