Overview
Enable temperature lock to restrict temperature adjustments on the physical thermostat. Requires a 4-digit PIN.Endpoint
Authentication
Required Scopes:write
Request Body
To enable lock:| Field | Type | Required | Description |
|---|---|---|---|
enabled | boolean | Yes | true |
pin_hash | string | Yes | Base64(SHA1(PIN + SERIAL)) |
temp_min | number | Yes | Minimum allowed temperature (°C) |
temp_max | number | Yes | Maximum allowed temperature (°C) |
| Field | Type | Required | Description |
|---|---|---|---|
enabled | boolean | Yes | false |
Example: Enable Lock
The
pin_hash is Base64(SHA1(PIN + SERIAL)). Never send the PIN in plaintext! You must concatenate the PIN with the device serial number before hashing.Example: Disable Lock
Response
Success (200 OK):Generating PIN Hash
The PIN hash algorithm matches the Nest thermostat’s native format: Algorithm:Base64( SHA1( PIN + SERIAL ) )
Code Examples
Use Cases
Child Safety
Commercial Buildings
Security Notes
Important Points
- PIN Format: Must be exactly 4 digits (0000-9999)
- Hashing: Use SHA-1 (not SHA-256) with PIN + serial concatenated
- Encoding: Hash must be Base64-encoded (not hex)
- Serial Required: You must include the device serial number in the hash
- Temperature Units: temp_min and temp_max must be in Celsius
- Device-Specific: Same PIN produces different hashes for different devices
Why SHA-1 + Serial?
This matches the Nest thermostat’s native PIN algorithm:- Device-specific: Same PIN produces different hashes for different thermostats
- Protocol compatibility: Works with the original Nest hardware
- Simple validation: Thermostat can verify the hash locally without server communication
Next Steps
Get Status
Check lock status
Set Temperature
Set temperature