Overview
The transport layer is the core of the Nest protocol. The device maintains a persistent HTTP connection (the “subscribe” connection) and receives server-pushed state updates as chunked responses. Separately, the device sends state changes to the server via PUT requests.Subscribe Connection
Request
value field with object_revision: 0 and object_timestamp: 0:
Response Headers
The server immediately sends headers before any body:
After sending headers, the device offloads the TCP socket to WiFi hardware and sleeps. The server holds the connection open.
Response Body (Push)
When the server has data to send, it writes a JSON chunk:Push Example
When No Data Is Available
If the server has nothing to push, it holds the connection open silently — no body, no empty JSON, no{}. When the hold time expires (290s), send the final chunk terminator:
Synchronization Logic
The server compares timestamps (not revisions) to decide what to push:
Timestamp is the sole authority for sync decisions. Revision is used only for conditional writes (see shared bucket).
PUT (Device → Server)
The device sends state changes via PUT requests.Request
value object).
Response
Timing Reference
Defer Window Headers
The defer window controls how quickly the device sends local changes (e.g., dial turns) to the server.X-nl-defer-device-window: N — device delays sending local changes for up to N seconds. Batches rapid dial adjustments into a single PUT.
X-nl-disable-defer-window: N — temporarily disables the defer delay for N seconds. Use this when you push a temperature change so the device’s acknowledgment arrives promptly.
Batching Multiple Pushes
If multiple changes arrive quickly (user clicking +/- repeatedly), the server can batch them on a single subscribe connection instead of closing after each chunk:- Send the first chunk immediately
- Hold the connection open for ≤3 seconds
- Send additional chunks as more data arrives
- Close after the batch window expires
{"objects": [...]} JSON document. The device’s 5-second closing timer resets on each chunk received.