Install
openclaw skills install nest-sdmControl Nest thermostat, doorbell, and cameras via the Google Smart Device Management (SDM) API.
openclaw skills install nest-sdmControl and monitor Google Nest devices via the Smart Device Management REST API.
https://www.google.com as redirect URIhttps://www.googleapis.com/auth/sdm.service to OAuth consent screenhttps://nestservices.google.com/partnerconnections/<PROJECT_ID>/auth?redirect_uri=https://www.google.com&access_type=offline&prompt=consent&client_id=<CLIENT_ID>&response_type=code&scope=https://www.googleapis.com/auth/sdm.service
code= parameter from the redirect URLcurl -s -X POST https://oauth2.googleapis.com/token \
-d "client_id=<CLIENT_ID>" \
-d "client_secret=<CLIENT_SECRET>" \
-d "code=<AUTH_CODE>" \
-d "grant_type=authorization_code" \
-d "redirect_uri=https://www.google.com"
Create ~/.openclaw/workspace/.nest-sdm-tokens.json:
{
"client_id": "<your-client-id>",
"client_secret": "<your-client-secret>",
"project_id": "<device-access-project-id>",
"refresh_token": "<your-refresh-token>",
"token_type": "Bearer",
"scope": "https://www.googleapis.com/auth/sdm.service"
}
Secure it: chmod 600 ~/.openclaw/workspace/.nest-sdm-tokens.json
# Alias for convenience
alias nest="<skill-dir>/nest-sdm.sh"
nest devices # List all devices (JSON)
nest structures # List structures/rooms
nest thermostat # Current status (temp, humidity, mode, setpoints)
nest set-cool <°F> # Set to COOL mode at temperature
nest set-heat <°F> # Set to HEAT mode at temperature
nest set-range <low°F> <high°F> # Set HEATCOOL range
nest set-mode <MODE> # HEAT | COOL | HEATCOOL | OFF
nest set-eco <MODE> # MANUAL_ECO | OFF
nest fan-on [duration_seconds] # Turn fan on (default: 900s / 15min)
nest fan-off # Turn fan off
nest doorbell # Doorbell info & capabilities
nest display # Kitchen display info
nest camera-stream <DEVICE_ID> # Generate WebRTC live stream (returns SDP answer)
nest camera-image <EVENT_ID> # Get event snapshot URL
nest api GET devices # Raw device list
nest api GET devices/<DEVICE_ID> # Single device
nest api POST devices/<DEVICE_ID>:executeCommand '{"command":"...","params":{...}}'
| Type | Traits | Control |
|---|---|---|
| THERMOSTAT | Temperature, Humidity, Mode, Eco, Fan, HVAC, Setpoint, Connectivity | Full read/write |
| DOORBELL | LiveStream, CameraImage, Person, Motion, Chime, EventImage, ClipPreview | Read + stream |
| DISPLAY | LiveStream, CameraImage, Person, Sound, Motion, EventImage | Read + stream |
| Command | Params |
|---|---|
ThermostatMode.SetMode | {"mode": "HEAT|COOL|HEATCOOL|OFF"} |
ThermostatTemperatureSetpoint.SetHeat | {"heatCelsius": <float>} |
ThermostatTemperatureSetpoint.SetCool | {"coolCelsius": <float>} |
ThermostatTemperatureSetpoint.SetRange | {"heatCelsius": <float>, "coolCelsius": <float>} |
ThermostatEco.SetMode | {"mode": "MANUAL_ECO|OFF"} |
Fan.SetTimer | {"timerMode": "ON", "duration": "<seconds>s"} |
| Command | Params |
|---|---|
CameraLiveStream.GenerateWebRtcStream | {"offerSdp": "<SDP offer>"} |
CameraLiveStream.StopWebRtcStream | {"mediaSessionId": "<id>"} |
CameraLiveStream.ExtendWebRtcStream | {"mediaSessionId": "<id>"} |
CameraEventImage.GenerateImage | {"eventId": "<event-id>"} |
Get instant alerts for doorbell presses, motion, person detection, and device state changes.
nest-eventsnest-events setup-check # Verify Pub/Sub config is ready
nest-events create-topic # Create GCP Pub/Sub topic
nest-events grant-permissions # Grant SDM publisher role
nest-events create-subscription # Create pull subscription
nest-events poll # Pull events once
nest-events listen # Poll continuously (daemon)
pubsub + cloud-platform scopes. Save tokens to .nest-pubsub-tokens.json.nest-events create-topic (creates projects/YOUR_GCP_PROJECT/topics/nest-sdm-events)nest-events grant-permissions (adds sdm-publisher@googlegroups.com)nest-events create-subscriptionnest devices (one-time API call)nest-events listen| Event | Alert |
|---|---|
DoorbellChime.Chime | 🔔 DOORBELL — Someone rang! |
CameraPerson.Person | 👤 Person detected at device |
CameraMotion.Motion | 🏃 Motion at device |
CameraSound.Sound | 🔊 Sound at device |
ThermostatHvac status change | ❄️/🔥 HVAC now COOLING/HEATING |
ThermostatTemperatureSetpoint | 🌡️ Setpoint changed |
Temperature trait | 🌡️ Ambient temperature change |
Environment Variables:
| Variable | Description | Default |
|---|---|---|
NEST_PUBSUB_TOKENS | Path to Pub/Sub OAuth tokens | ~/.openclaw/workspace/.nest-pubsub-tokens.json |
TELEGRAM_BOT_TOKEN | Bot token for alerts | from ~/.zshenv |
TELEGRAM_CHAT_ID | User/chat ID for alerts | from ~/.zshenv |
POLL_INTERVAL | Seconds between polls | 10 |
GCP_PROJECT | GCP project ID | YOUR_GCP_PROJECT |
PUBSUB_TOPIC | Topic name | nest-sdm-events |
PUBSUB_SUBSCRIPTION | Subscription name | nest-sdm-events-sub |
Raw events are logged to data/nest-events/events-YYYY-MM-DD.jsonl.
Same event type won't re-alert within 60 seconds to prevent alert fatigue.
nest-events listen for real-time alerts. Requires Pub/Sub setup (see above).