What Is the Nest Cloud Protocol?
The Nest thermostat uses a custom HTTP-based long-poll protocol to communicate with cloud servers. Rather than WebSockets or REST, the device maintains a persistent HTTP connection where the server holds the response open and streams updates to the device using chunked transfer encoding. This protocol was reverse-engineered and documented by Chris Serio (cjserio / @SirHeroic) as the Nest Cloud Protocol Reference. The NoLongerEvil self-hosted server is a Python implementation of this protocol.The documentation in this section is drawn from revision 2.9 of the Nest Cloud Protocol Reference by Chris Serio. All credit for the underlying protocol research belongs to the original author.
Key Concepts
Protocol Characteristics
Two Communication Patterns
The protocol has two distinct flows: Subscribe (server → device):- Device POSTs its current bucket state (revisions + timestamps)
- Server immediately sends
Transfer-Encoding: chunkedheaders — device offloads connection to WiFi hardware and sleeps - Server holds the connection; when state changes, sends a JSON chunk — device wakes via WoWLAN
- Server closes connection after sending; device resubscribes
- Device POSTs state changes (user dial adjustment, sensor readings)
- Server stores the data, increments revision
- Server returns
200 OKwith{object_revision, object_timestamp, object_key}— novaluefield
NoLongerEvil Implementation
The NLE self-hosted server implements this protocol on port 8000 (the Device Protocol API). Thermostats connect here automatically after being configured to point at the server. Key implementation differences from Google’s Nest cloud:- 3-tier pairing using 7-character entry codes instead of OAuth/JWT
- SQLite persistence instead of distributed cloud storage
- No credential provisioning — the server accepts all credentials and identifies devices by serial from Basic Auth
- Single default structure per device
Navigation
Connection Architecture
Full device lifecycle diagram
Authentication
HTTP Basic Auth and entry key pairing
Transport Mechanism
Subscribe, push, PUT in depth
Bucket System
How device state is organized