Novant

Documentation

Sign in

Import

Import methods allow bulk loading of project data from CSV. All methods accept CSV content as a string or Uint8Array and return an object with the result status. Imports require an Edit API key, except scenes and schedules which require a Control key.

Zones

importZones(csv)

Spaces

importSpaces(csv)

Assets

importAssets(csv)

Sources

importSources(csv)

Source Map

importSourceMap(csv)

Adds or updates a single source map. See Import Source Map for the CSV format.

Scene

importScene(csv)

Adds or updates a single scene. The first data row is the scene itself, and each following row is a point in that scene, with one column per mode. Leave the scene id blank to create a new scene. See Import Scene for the CSV format.

Requires a Control API key: a scene used by a schedule writes its values to equipment, so changing those values is a write to the building.

const csv = `name,id,Occupied,Unoccupied,Curtail
Lobby HVAC,sn.5,,,
,s.5.9,72,55,78
,s.5.12,1,0,0
`;
await client.importScene(csv);

Schedules

importSchedules(csv)

Adds or updates schedules. Rows without an id add a new schedule; rows with one update it, changing only the columns present. See Import Schedules for the CSV format.

Requires a Control API key: a schedule applies its scene modes to equipment, so changing a schedule is a write to the building.

// add a new schedule
const csv = `name,schedule,active,inactive
Office,weekdays 8:00-17:00,"sn.1.1, sn.2.1","sn.1.2, sn.2.2"
`;
await client.importSchedules(csv);

// update just the times of an existing schedule
await client.importSchedules("id,schedule\nsch.2,weekdays 7:00-18:00\n");
importTrends(csv, { mode })

Options

Option Default Description
mode merge Import mode: merge, append, or prepend

The CSV must have ts as the first column (ISO 8601 timestamps), followed by one column per point ID. See Import Trends for limits per request.

Example

import { readFile } from "node:fs/promises";

// import assets from a CSV string
const csv = "id,name,type\na.1,AHU-1,ahu\na.2,AHU-2,ahu\n";
const res = await client.importAssets(csv);
console.log(res.status);   // "ok"

// import zones from a file
await client.importZones(await readFile("zones.csv"));

// import trend data
await client.importTrends(
  "ts,s.2.4,s.2.5\n2026-03-09T00:00:00,72.1,68.4\n",
  { mode: "append" },
);

See the API Reference for full CSV format details per endpoint.