https://github.com/anonrig/thermostat-wars
My wife always changes the thermostat to 75F, and now I respond
https://github.com/anonrig/thermostat-wars
Last synced: 9 months ago
JSON representation
My wife always changes the thermostat to 75F, and now I respond
- Host: GitHub
- URL: https://github.com/anonrig/thermostat-wars
- Owner: anonrig
- Created: 2025-06-11T22:55:30.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-11T22:56:44.000Z (about 1 year ago)
- Last Synced: 2025-10-02T15:43:47.364Z (9 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 9
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Nest Thermostat Auto-Controller
A Cloudflare Worker that automatically sets your Google Nest thermostat to 73°F whenever it detects temperature changes.
## Setup
### 1. Google Nest API Setup
1. Register for the [Device Access Program](https://developers.google.com/nest/device-access/registration) ($5 fee)
2. Create a project in the [Device Access Console](https://console.nest.google.com/device-access/)
3. Set up OAuth credentials in [Google Cloud Console](https://console.cloud.google.com/)
4. Enable the Smart Device Management API
### 2. Environment Variables
Set these secrets using `wrangler secret put`:
```bash
wrangler secret put NEST_ACCESS_TOKEN
wrangler secret put NEST_PROJECT_ID
wrangler secret put NEST_REFRESH_TOKEN
wrangler secret put NEST_CLIENT_ID
wrangler secret put NEST_CLIENT_SECRET
```
### 3. Deploy
```bash
npm install
wrangler deploy
```
## Features
- Automatically sets thermostat to 73°F when changes detected
- Handles Google Pub/Sub webhooks
- Automatic OAuth token refresh
- Scheduled checks every 30 minutes
- Compatible with Cloudflare Workers
## API Endpoints
- `POST /` - Webhook endpoint for thermostat events
- Scheduled runs every 30 minutes for periodic checks
## How It Works
1. Receives webhook notifications from Google Nest when thermostat changes
2. Checks current temperature setting
3. If not 73°F, automatically adjusts it
4. Includes fallback scheduled checks every 30 minutes
---
🤖 Generated with [Claude Code](https://claude.ai/code)