← 返回
开发者工具 Key

Google Home/Nest

Control Google Nest thermostats, cameras, and doorbells via Google Smart Device Management API using curl and jq commands.
使用 curl 和 jq 命令通过 Google Smart Device Management API 控制 Google Nest 恒温器、摄像头和门铃。
mitchellbernstein
开发者工具 clawhub v1.0.0 1 版本 100000 Key: 需要
★ 2
Stars
📥 3,131
下载
💾 122
安装
1
版本
#latest

概述

Google Home / Nest CLI

Control Google Nest devices via the Smart Device Management (SDM) API using curl + jq.

Setup (Required)

  1. Create a Google Cloud Project
    • Go to https://console.cloud.google.com
    • Create a new project
  1. Enable the SDM API
    • APIs & Services → Library
    • Search "Smart Device Management"
    • Enable it
  1. Create OAuth Credentials
    • APIs & Services → Credentials
    • Create OAuth 2.0 Client ID
    • Download the JSON file
    • Extract client_id and client_secret
  1. Register Your Devices
    • Visit https://nests.google.com/frame/register-user
    • Accept the terms
  1. Get Access Token

```bash

# Replace with your values

curl -s \

-d "client_id=YOUR_CLIENT_ID" \

-d "client_secret=YOUR_CLIENT_SECRET" \

-d "refresh_token=YOUR_REFRESH_TOKEN" \

-d "grant_type=refresh_token" \

https://www.googleapis.com/oauth2/v4/token

```

Quick Start

# List devices
google-home-cli devices

# Get thermostat info
google-home-cli thermostat "Living Room" --info

# Set temperature (heat/cool/auto)
google-home-cli thermostat "Living Room" --temp 72

# Query camera
google-home-cli camera "Front Door" --status

Device Commands

Thermostats

  • google-home-cli thermostat — show current temp/humidity
  • --temp — set target temperature
  • --mode heat|cool|auto — set HVAC mode
  • --fan on|auto — control fan

Cameras & Doorbells

  • google-home-cli camera — get stream/status
  • --snapshot — download current image
  • --stream — start live stream URL

Speakers & Displays

  • google-home-cli speaker — device info
  • --volume 0-100 — set volume
  • --stop — stop playback

Environment Variables

export GOOGLE_HOME_CLIENT_ID="your-client-id"
export GOOGLE_HOME_CLIENT_SECRET="your-client-secret"
export GOOGLE_HOME_ACCESS_TOKEN="your-access-token"

Alternative: Direct API Calls

# List all devices
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" \
  "https://smartdevicemanagement.googleapis.com/v1/enterprises/YOUR_PROJECT_ID/devices"

# Get device traits
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" \
  "https://smartdevicemanagement.googleapis.com/v1/enterprises/YOUR_PROJECT_ID/devices/YOUR_DEVICE_ID"

Helper Script

A nest CLI helper is included at scripts/nest:

# Make it available globally
ln -sf /Users/mitchellbernstein/clawd/skills/google-home/scripts/nest /usr/local/bin/nest

# List devices
nest list

# Get thermostat status
nest status "enterprises/PROJECT_ID/devices/DEVICE_ID"

# Set temperature (Celsius)
nest temp "enterprises/PROJECT_ID/devices/DEVICE_ID" 22

# Set mode
nest mode "enterprises/PROJECT_ID/devices/DEVICE_ID" HEAT

Configuration

Create ~/.config/google-home/config.json:

{
  "project_id": "your-google-cloud-project-id",
  "access_token": "your-oauth-access-token"
}

Notes

  • Tokens expire; refresh them periodically
  • Device names use full path: enterprises/PROJECT_ID/devices/DEVICE_ID
  • Temperature is in Celsius (convert from Fahrenheit if needed)
  • Camera streams require additional permissions

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-28 12:52 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Agent Browser

matrixy
专为AI智能体优化的无头浏览器自动化CLI,支持无障碍树快照和基于引用的元素选择。
★ 425 📥 118,019
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 666 📥 323,786
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 920 📥 185,726