Skip to main content

Overview

Control the thermostat’s fan independently of heating/cooling. Set the fan to always on, auto (runs with HVAC), or start a timed fan run.

Endpoint

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

Authentication

Required Scopes: write

Request Body

For fan mode:
FieldTypeRequiredDescription
modestringYes"on", "auto", or "off"
For fan timer:
FieldTypeRequiredDescription
durationnumberYesDuration in seconds (max 43200 = 12 hours)

Example: Set Fan Mode

{
  "mode": "on"
}

Example: Start Fan Timer

{
  "duration": 900
}

Response

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

Fan Modes

ModeDescription
onFan runs continuously
autoFan runs only when heating/cooling is active
offFan off (system idle)
Fan timers automatically set the fan to auto mode after the duration expires.

Code Examples

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

Use Cases

Air Circulation

// Run fan for 15 minutes every hour to circulate air
setInterval(async () => {
  await startFanTimer(deviceId, 15 * 60); // 15 minutes
}, 60 * 60 * 1000); // Every hour

Post-Cooking Ventilation

// Run fan after cooking to remove odors
await startFanTimer(deviceId, 30 * 60); // 30 minutes

Next Steps