Values & Trends
Values
Returns current values for all points on a source, asset, or space.
One of source_id, source_ids,
asset_id, or space_id is required. If multiple
are specified, precedence is source_id, then
source_ids, then asset_id, then
space_id.
values({ source_id, source_ids, asset_id, space_id, point_ids, point_types })Options
| Option | Default | Description |
|---|---|---|
source_id |
— | Parent source ID |
source_ids |
— | Array of parent source IDs (max 10) |
asset_id |
— | Parent asset ID |
space_id |
— | Parent space ID |
point_ids |
— | Optional array of point IDs to filter |
point_types |
— | Optional array of point types to filter |
Returns
ValueList with the following fields. Which fields are
present depends on the parent used in the request:
| Field | Type | Description |
|---|---|---|
proj_id |
number |
Project ID |
values |
PointValue[] |
Point values in the response |
source_id |
string |
Set when scoped by source_id |
asset_id |
string |
Set when scoped by asset_id |
space_id |
string |
Set when scoped by space_id |
source_ids |
string[] |
Set when scoped by source_ids, asset_id,
or space_id |
Each PointValue has:
| Field | Type | Description |
|---|---|---|
id |
string |
Point ID |
val |
number |
Current value; "na" if not a number, or
null if unknown |
status |
string |
ok, fault, or unknown |
err_code |
string |
Set when status is fault |
effective_level |
number |
Priority level currently driving the point |
levels |
PointLevel[] |
The point’s active priority levels; omitted when empty |
Each PointLevel has level (1–16),
val, who (what set the level, e.g.
api or a schedule ID), and expires (ISO 8601)
when the level auto-releases. See Values for details.
Example
// all values for a source
const { values } = await client.values({ source_id: "s.2" });
for (const v of values) {
console.log(v.id, v.val, v.status);
}
// values across multiple sources (max 10)
await client.values({ source_ids: ["s.2", "s.3"] });
// filter by point type
await client.values({
space_id: "sp.1",
point_types: ["zone_air_temp_sensor"],
});
// lookup a single point value
const v = values.find((v) => v.id === "s.2.4");
console.log(v.val);Trends
Returns historical trend data for a list of points. Either
date or start_date + end_date is
required.
trends({ point_ids, date, start_date, end_date, tz, interval, aggregate })Options
| Option | Default | Description |
|---|---|---|
point_ids |
— | Array of point IDs (required) |
date |
— | Single date as YYYY-MM-DD (takes precedence over
start/end) |
start_date |
— | Start date as YYYY-MM-DD |
end_date |
— | End date as YYYY-MM-DD, inclusive |
tz |
— | Timezone for results (defaults to project timezone) |
interval |
auto |
Resample interval: auto 5min
15min 30min 1hr 1day
1mo raw |
aggregate |
auto |
Aggregation function: auto mean
sum min max
diff |
Returns
TrendData with the following fields:
| Field | Type | Description |
|---|---|---|
proj_id |
number |
Project ID |
start |
string |
Start timestamp |
end |
string |
End timestamp |
tz |
string |
Timezone of results |
interval |
string |
Interval used |
aggregate |
string |
Aggregation function used |
point_ids |
string[] |
Point IDs in the response |
trends |
TrendRow[] |
One row per interval |
Each TrendRow has a ts timestamp plus one
field per point ID. Values are numbers, "na" if not a
number, or null if unavailable.
Example
// single day
const res = await client.trends({
point_ids: ["s.2.4", "s.2.5"],
date: "2026-03-09",
});
for (const row of res.trends) {
console.log(row.ts, row["s.2.4"], row["s.2.5"]);
}
// date range with hourly interval
const hourly = await client.trends({
point_ids: ["s.2.4"],
start_date: "2026-03-01",
end_date: "2026-03-09",
interval: "1hr",
aggregate: "mean",
});
console.log(hourly.interval); // "1hr"
console.log(hourly.aggregate); // "mean"