Skip to main content

Overview

Change the HVAC operating mode between heat, cool, heat-cool (auto), or off.

Endpoint

POST https://nolongerevil.com/api/v1/thermostat/{deviceId}/mode

Authentication

Required Scopes: write

Request Body

FieldTypeRequiredDescription
modestringYes"heat", "cool", "heat-cool", or "off"
{
  "mode": "heat-cool"
}

Response

Success (200 OK):
{
  "success": true,
  "message": "Command handled",
  "device": "02AA01AB01234567",
  "object": "shared.02AA01AB01234567",
  "revision": 155,
  "timestamp": 1764026377395
}

HVAC Modes

ModeDescription
heatHeating only - maintains minimum temperature
coolCooling only - maintains maximum temperature
heat-coolAuto mode - maintains temperature range
offSystem off - no heating or cooling
When switching to heat-cool mode, use the Set Temperature Range endpoint to configure the temperature range.

Code Examples

curl -X POST https://nolongerevil.com/api/v1/thermostat/dev_abc123xyz/mode \
  -H "Authorization: Bearer nle_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"mode": "heat-cool"}'

Use Cases

Seasonal Mode Switching

// Switch to cooling for summer
if (month >= 5 && month <= 9) {
  await setMode(deviceId, 'cool');
} else {
  await setMode(deviceId, 'heat');
}

Energy Saving

// Turn off HVAC when nobody's home
if (awayMode) {
  await setMode(deviceId, 'off');
}

Next Steps