Skip to content

Readings

The readings endpoint accepts sensor data from your thermostat or Home Assistant integration. Push readings every 5 minutes for the optimizer to build an accurate thermal model of your home.

Auth: Required (Bearer JWT)

{
"readings": [
{
"timestamp": "2025-11-18T14:30:00+00:00",
"indoor_temp": 72.5,
"hvac_state": "COOL",
"indoor_humidity": 45.0,
"outdoor_temp": 85.0,
"target_temp": 72.0,
"fan_mode": "auto",
"power_watts": 298.0
}
]
}
FieldTypeRequiredConstraints
timestampstring (ISO 8601)YesUTC recommended
indoor_tempfloatYes30.0–120.0 °F
hvac_statestringYes"HEAT", "COOL", "ECO", "DRY", "OFF", or "FAN". Aliases like "cooling", "eco_cool", "dehumidify", "fan_only", "heat_cool", "auto", "idle" are normalized server-side — pass whatever your thermostat reports. "ECO" and "DRY" count separately from "COOL" so the thermal model can learn per-sub-mode cooling rates.
indoor_humidityfloatNoPercent (0–100)
outdoor_tempfloatNoFahrenheit
target_tempfloatNoCurrent thermostat setpoint
fan_modestringNoe.g. "auto", "low", "high"
power_wattsfloatNoCurrent power draw
Terminal window
curl -X POST https://api.hungrymachines.io/api/v1/readings \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"readings": [
{
"timestamp": "2025-11-18T14:30:00+00:00",
"indoor_temp": 72.5,
"hvac_state": "COOL",
"outdoor_temp": 85.0,
"target_temp": 72.0
}
]
}'
{
"accepted": 1
}

The accepted count reflects how many readings were stored.

StatusDetailCause
400"indoor_temp must be between 30 and 120"Validation failure
401"Not authenticated"Missing or invalid token
429"Rate limit exceeded: max 300 readings per user per day"Over daily limit

Each user may submit up to 300 readings per day. At one reading every 5 minutes, that’s 288 readings — well within the limit. Batching multiple readings in a single request counts each reading individually toward the daily total.

The optimizer uses your readings to:

  1. Build a thermal model of your home (how quickly it heats and cools based on outdoor conditions, HVAC state, and time of day)
  2. Generate optimized schedules that shift energy consumption to cheaper rate periods while maintaining comfort

The thermal model needs at least 72 hourly buckets of data — roughly 3 days of continuous 5-minute readings — before the fitter will produce a model. A daily 06:30 UTC initial-fit job picks up users who have just crossed that threshold, so a brand-new account typically gets its first per-user model 3–4 days after starting to push readings. Until then, the schedule endpoint returns defaults based on your preferences. The weekly refit on Sunday 02:00 UTC then keeps every user’s model current.