Overview
Enable or disable away mode. When away mode is enabled, the thermostat adjusts to energy-saving temperatures.
Endpoint
POST https://nolongerevil.com/api/v1/thermostat/{deviceId}/away
Authentication
Required Scopes: write
Request Body
| Field | Type | Required | Description |
|---|
away | boolean | Yes | true for away, false for home |
Response
Success (200 OK):
{
"success": true,
"message": "Command handled",
"device": "02AA01AB01234567",
"object": "shared.02AA01AB01234567",
"revision": 156,
"timestamp": 1764026405000
}
Away Mode Effects
When away mode is enabled:
- Temperature adjusted: Lower in winter, higher in summer
- Motion detection paused: Won’t automatically switch to home
- Energy savings: Reduced HVAC usage
- Learning disabled: Thermostat won’t learn new patterns
Away mode can save 10-20% on energy costs when you’re not home.
Code Examples
# Enable away mode
curl -X POST https://nolongerevil.com/api/v1/thermostat/dev_abc123xyz/away \
-H "Authorization: Bearer nle_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"away": true}'
Use Cases
Geofencing Integration
// Automatically enable away mode when you leave home
async function handleGeofence(location) {
const isHome = calculateDistance(location, homeLocation) < 0.5; // Within 0.5 miles
await setAwayMode(deviceId, !isHome);
}
Vacation Mode
// Enable away mode for vacation
async function enableVacationMode(deviceId, startDate, endDate) {
await setAwayMode(deviceId, true);
// Schedule return to home mode
scheduleTask(endDate, async () => {
await setAwayMode(deviceId, false);
});
}
Energy-Aware Automation
// Enable away during peak energy hours
if (hour >= 14 && hour <= 18) { // 2PM-6PM peak hours
await setAwayMode(deviceId, true);
}
Next Steps