微算力 · API 导航与自营网关
API 接入 EN
未登录登录
🏠

本地优先的 Nest 全屋智控中枢

starling-home-hub · vv1.0.2
效率 安全 A 级 作者 michaeljmoody 公开目录收录
1k 下载 361 安装 2.9k 收藏 6.5k 浏览

简介

基于 Starling Home Hub 本地 REST API 的 Nest/Google Home 设备控制方案,支持温控器、摄像头、门锁等全屋智能管理,数据完全本地处理保障隐私安全。

原始描述

Controls Nest and Google Home smart home devices via the Starling Home Hub's local REST API. Supports thermostats, cameras, Nest Protects, Nest × Yale locks, temperature sensors, home/away control, and Nest weather service. Use this skill when managing Nest/Google Home devices through Starling Home Hub — reading device status, setting temperatures, getting camera snapshots, locking/unlocking doors, checking smoke/CO alerts, and toggling home/away mode.

通过你的 Agent 添加

安装目录:starling-home-hub/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/starling-home-hub/
Codex CLI~/.codex/skills/starling-home-hub/
DeepSeek Harness~/.agents/skills/starling-home-hub/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

中文使用说明 来自收录源

核心用法

starling-home-hub 是一个通过 Starling Home Hub 的 Developer Connect (SDC) 本地 REST API 控制 Nest 和 Google Home 智能设备的命令行工具。用户需配置 STARLING_HUB_IP 和 STARLING_API_KEY 两个环境变量,通过 scripts/starling.sh 脚本执行设备管理操作。核心功能包括:读取设备状态(status、、devices、、get)、设置设备属性(set)、获取摄像头快照(snapshot)以及 WebRTC 视频流管理(stream-start、、stream-extend、、stream-stop)。支持的设备类型涵盖温控器、摄像头、Nest Protect 烟雾/CO 报警器、Nest × Yale 智能门锁、温度传感器及 home/away 模式切换。

显著优点

本地优先架构:所有通信均在本地网络完成,无云端数据传输,从根本上避免隐私泄露风险。完善的输入验证:validate_id 函数严格限制 ID 和属性名字符集,有效防御注入攻击。健壮的工程实践:采用 set -euo pipefail 实现 Bash 错误处理,curl 配置超时控制防止请求挂起。安全文档详尽:SKILL.md 包含完整的安全指南,涵盖 API key 管理、最小权限原则、TLS 证书验证、网络隔离等关键主题。灵活的 TLS 策略:默认 HTTPS 加密,同时提供 --cacert 选项支持证书固定,平衡易用性与安全性。零外部依赖:仅依赖系统标准工具 curl 和 jq,供应链攻击面极小。

潜在缺点与局限性

API 设计限制:Starling Developer Connect API 强制要求 API key 作为 URL 查询参数传递,可能出现在访问日志中(虽因本地网络限制风险可控)。自签名证书妥协:默认使用 curl -k 跳过证书验证以适应 Starling Home Hub 的自签名证书,虽提供 --cacert 替代方案,但默认配置存在 MITM 风险。硬件门槛:必须购买 Starling Home Hub 硬件(约 $100+)并升级至固件 8.0+,且需启用 Developer Connect API。速率限制约束:Nest 云端对 POST 操作限制为每秒一次、摄像头快照每 10 秒一次,高频自动化场景受限。非官方性质:明确标注为社区 skill,与 Starling LLC、Google、Nest 无关联,未来 API 变更可能带来兼容风险。

适合的目标群体

智能家居重度用户:已投资 Nest/Google Home 生态,希望突破官方 App 限制实现高级自动化。隐私敏感型用户:拒绝将家庭设备数据上传云端,坚持本地控制的极客群体。开发者与系统集成商:需要将 Nest 设备集成到 Home Assistant、Node-RED 等开源平台的工程师。家庭自动化爱好者:熟悉命令行操作,具备 Bash 脚本编写能力,愿意配置环境变量和调试网络的技术用户。

使用风险

网络配置风险:若错误地将 3080/3443 端口转发至公网,API key 和设备将完全暴露。密钥管理风险:通过 --key 参数传递 API key 会在进程列表中可见,违反最小暴露原则。证书验证风险:默认跳过 TLS 证书验证,在不可信网络环境中易受中间人攻击。固件依赖风险:功能依赖 Starling Home Hub 固件版本,升级可能引入破坏性变更。操作不可逆风险:stream-start 等非幂等操作重复执行会产生副作用,需确保自动化逻辑正确。

技能正文


name: starling-home-hub description: Controls Nest and Google Home smart home devices via the Starling Home Hub's local REST API. Supports thermostats, cameras, Nest Protects, Nest × Yale locks, temperature sensors, home/away control, and Nest weather service. Use this skill when managing Nest/Google Home devices through Starling Home Hub — reading device status, setting temperatures, getting camera snapshots, locking/unlocking doors, checking smoke/CO alerts, and toggling home/away mode. homepage: https://starlinghome.io env:

  • name: STARLING_HUB_IP required: true secret: false description: Local IP address of your Starling Home Hub (e.g. 192.168.1.151)
  • name: STARLING_API_KEY required: true secret: true description: API key from the Starling Home Hub app (Developer Connect section)

Starling Home Hub (Nest/Google Home)

Community skill — not affiliated with or endorsed by Starling LLC, Google, Nest, or Apple. Nest is a trademark of Google LLC. Starling Home Hub is a product of Starling LLC. This skill requires a Starling Home Hub with firmware 8.0+ and the Developer Connect API enabled.

Overview

Control Nest smart home devices through the Starling Home Hub Developer Connect (SDC) local REST API using the starling.sh script.

Required Environment Variables

Variable Required Secret Description
STARLING_HUB_IP Yes No Local IP address of your Starling Home Hub (e.g. 192.168.1.151)
STARLING_API_KEY Yes Yes API key created in the Starling Home Hub app (Developer Connect section)

Setup

Set these environment variables (never hardcode keys in scripts):

export STARLING_HUB_IP="192.168.1.xxx"
export STARLING_API_KEY="your-api-key"     # From Starling Home Hub app

The script is at: scripts/starling.sh

Options: --http (downgrade to HTTP — not recommended), --raw (skip jq formatting)

HTTPS is the default. The script uses port 3443 unless --http is specified.

Security

API Key Management

  • Always use the STARLING_API_KEY env var — never pass keys via --key (visible in ps output)
  • Never store keys in scripts, SKILL.md, or version-controlled files
  • Use a .env file with restricted permissions: chmod 600 .env
  • Consider a secrets manager for production/automated setups

Least Privilege

  • Create API keys with minimum required permissions in the Starling Home Hub app
  • Use read-only keys unless you need to set properties or access camera streams
  • Create separate keys for different automation tasks if possible

TLS Certificate Verification

  • HTTPS is the default, but the script uses curl -k (skip cert verification) because Starling Home Hub uses a self-signed certificate
  • This is acceptable on a trusted local network but increases MITM risk on untrusted networks
  • To pin the hub's certificate instead: starling.sh --cacert /path/to/hub-cert.pem status
  • When --cacert is provided, -k is not used and full certificate verification applies

API Key in URL

  • The Starling Developer Connect API requires the key as a URL query parameter (?key=...) — this is the API's design, not a skill choice
  • URL query parameters can appear in access logs and browser history — this is mitigated by the API being local-only (no intermediary proxies/CDNs)
  • Always use HTTPS to encrypt the key in transit on your local network

Network Security

  • The Starling API is local network only by design — no cloud exposure
  • Never port-forward 3080 or 3443 to the internet
  • Always use HTTPS (default) to prevent local network sniffing of API keys and device data

Snapshot Handling

  • Camera snapshots contain sensitive imagery — don't store in world-readable locations
  • The script sets snapshot files to chmod 600 (owner-only) automatically
  • Clean up temporary snapshot files when no longer needed

Best Practices

Always Check Status First

Before making device calls, verify the hub is ready:

scripts/starling.sh status

Confirm apiReady: true and connectedToNest: true before proceeding.

Respect Rate Limits

These limits are enforced by the Nest cloud:

  • POST (set properties): max once per second per device
  • Snapshot: max once per 10 seconds per camera
  • GET (read properties/device list): no cloud rate limit (local cache)

Idempotent Operations

Safe to retry without side effects:

  • All GET operations (status, devices, device, get, snapshot)
  • SET operations with the same values (setting temp to 22 when already 22)
  • stream-extend (just resets the keepalive timer)

Not idempotent: stream-start (creates a new stream each time)

Error Handling

The script provides actionable error messages:

  • 401: Check API key and permissions — key is never exposed in error output
  • 404: Verify device ID and property name
  • 400: Check parameter values and types

Common Workflows

List All Devices

scripts/starling.sh devices

Read Device Properties

scripts/starling.sh device <id>          # All properties
scripts/starling.sh get <id> <property>  # Single property

Set Device Properties

scripts/starling.sh set <id> key=value [key=value...]

Camera Snapshots

scripts/starling.sh snapshot <id> --output photo.jpg --width 1280

Camera Streaming (WebRTC)

scripts/starling.sh stream-start <id> <base64-sdp-offer>
scripts/starling.sh stream-extend <id> <stream-id>   # Every 60s
scripts/starling.sh stream-stop <id> <stream-id>

Common Tasks

Set thermostat to 22°C:

scripts/starling.sh set <thermostat-id> targetTemperature=22

Set HVAC mode:

scripts/starling.sh set <thermostat-id> hvacMode=heat

Check for motion on camera:

scripts/starling.sh get <camera-id> motionDetected

Lock/unlock a door:

scripts/starling.sh set <lock-id> targetState=locked

Get camera snapshot:

scripts/starling.sh snapshot <camera-id> --output front-door.jpg

Check smoke/CO status:

scripts/starling.sh get <protect-id> smokeDetected
scripts/starling.sh get <protect-id> coDetected

Set home/away:

scripts/starling.sh set <home-away-id> homeState=away

API Reference

See references/api-reference.md for full device property details, writable properties, error codes, and endpoint documentation.

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

iotsmart-homeautomationapiprivacylocal-networkhardware-integration

同类 Skill