Step-by-step guide to connect the Gekko package to Google Home.
Project: GekkoRidge
Project ID: gekkoridge-488709
Project already exists: GekkoRidge (gekkoridge-488709)
https://console.cloud.google.com/home/dashboard?project=gekkoridge-488709
In APIs & Services → Library, enable:
http://localhost:9400/oauth/callbackhttps://yourdomain/oauth/callbackconfig.yamlhttps://www.googleapis.com/auth/homegraphhttps://www.googleapis.com/auth/sdm.serviceDevice state change notifications are delivered via Pub/Sub.
# Create topic and subscription
gcloud pubsub topics create axion-home-events --project gekkoridge-488709
gcloud pubsub subscriptions create axion-home-events-sub \
--topic axion-home-events \
--project gekkoridge-488709 \
--ack-deadline 60
Update config.yaml:
pubsub_subscription: projects/gekkoridge-488709/subscriptions/axion-home-events-sub
Run the following to open the Google consent page and get a refresh token:
python -c "
from google_auth_oauthlib.flow import InstalledAppFlow
SCOPES = [
'https://www.googleapis.com/auth/homegraph',
'https://www.googleapis.com/auth/sdm.service',
]
flow = InstalledAppFlow.from_client_secrets_file(
'local.documents/gekko/client_secrets.json', SCOPES
)
creds = flow.run_local_server(port=9400)
import json
with open('local.documents/gekko/google_home_token.json', 'w') as f:
json.dump({
'access_token': creds.token,
'refresh_token': creds.refresh_token,
'expiry': creds.expiry.isoformat() if creds.expiry else '',
}, f, indent=2)
print('Token saved.')
"
Save the downloaded client_secrets.json to local.documents/gekko/.
This folder is git-ignored.
# Sync devices and confirm they appear
python factory.service/package.gekko/ObjServiceGoogleHome.py list-devices
# Check def_google_home_devices in the database
python ServeGoogleHome.py serve
Add to resource.config/requirements.txt if not already present:
google-auth
google-auth-oauthlib
google-auth-httplib2
google-api-python-client
google-cloud-pubsub