Get measurement history
get_historyReturns the measurements themselves over a window, as buckets of averages with a minimum and a maximum, and a guides block saying what each metric is called, what unit it is in and where this room's good band sits. Everything a chart needs travels with it, so draw it: a question about how something moved over time is answered better by a picture with the good band marked than by a list of numbers, and the reader can see at a glance whether the line sat inside it. Use get_trends instead when the question is why rather than what. Requires a PitCanary account.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"room_id": "<room_id>",
"from": "<from>",
"to": "<to>",
"metrics": "<metrics>"
},
"name": "get_history"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Last day of the window, YYYY-MM-DD, inclusive. Days times metrics may be at most 50 (31 days of one metric, 25 of two, 16 of three, 12 of four); a longer window would be too large to read. | |
| from | Yes | First day of the window, YYYY-MM-DD, inclusive. | |
| metrics | Yes | One to four of: temp (°C), hum (% relative humidity), co2 (ppm), voc (VOC index, 100 is the room's own baseline), nox (NOx index), dba (sound, dBA), lux (light), uv (raw sensor output, not a UV index), daylight (share of the light that is daylight, %), cct (colour temperature, K), blue_light (blue share of the spectrum, %), flicker (%), occ (how busy the room was, %, never a headcount), pressure (hPa), vibration (mg), comfort (room score). The names are the keys each bucket carries. | |
| room_id | Yes | The room id, as returned by list_rooms. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | ||
| from | No | ||
| more | No | ||
| guides | Yes | How to draw each metric present: its label, its unit, how many decimals it deserves, and this room's own good band. A metric whose band the owner switched off has no good range, and must not be drawn with one. | |
| buckets | Yes | One entry per interval, oldest first. Each carries the bucket's start, how many readings it folds, and per metric an avg with a min and a max. Plot avg as the line and min to max as a band around it. | |
| room_id | No | ||
| resolution | No | tenmin, hour or day, chosen from the window asked for. |