Novant

Documentation

Sign in

Explorer

Explorer methods discover sources and point lists for devices behind an edge node. Use them to find available equipment to speed onboarding data into projects.

Discovery runs in two steps: a scan finds sources on the network, and a learn reads the point list from a source you found. Both run on the edge node and take minutes rather than seconds, so both are asynchronous — you queue the operation, then poll for its status.

The methods split along that line:

Method Description
explorerScan Queue a discovery operation on an edge node
explorerLearn Queue a learn to read a source’s point list
explorerOps Check the status of queued and recent operations
explorerSources List all discovered sources in the project
explorerPoints List the points advertised by a discovered source

Discovery Workflow

Queue a scan, then poll explorerOps() until the operation reaches a terminal state (ok or error). Wait at least 30 seconds between polls:

import { setTimeout as sleep } from "node:timers/promises";

const done = (op) => !op || op.state === "ok" || op.state === "error";

// queue a scan and note the returned op id
const { op_id } = await client.explorerScan("bacnet-scan");

// poll until done
let op;
do {
  await sleep(30_000);
  const { ops } = await client.explorerOps();
  op = ops.find((o) => o.id === op_id);
} while (!done(op));

console.log(op?.state, op?.summary);   // "ok" "Found 12 sources"

An op that no longer appears in the list completed more than 24 hours ago, so treat a missing op as done rather than as an error.

Once the scan completes, read the results from explorerSources(). Sources accumulate across scans, so compare last_scan to identify what the most recent scan found:

const { sources } = await client.explorerSources();
for (const s of sources) {
  console.log(s.id, s.name, s.vendor, s.model, s.last_scan);
}

To read a source’s points, pass its discovery id to explorerLearn(). A single explorerOps() call covers every outstanding operation, so queue all the learns you need and poll once:

const targets = sources.filter((s) => s.model === "VAV-HX1");
const opIds = new Set();
for (const s of targets) {
  const { op_id } = await client.explorerLearn(s.id);
  opIds.add(op_id);
}

let pending;
do {
  await sleep(30_000);
  const { ops } = await client.explorerOps();
  pending = ops.filter((o) => opIds.has(o.id) && !done(o));
} while (pending.length > 0);

for (const s of targets) {
  const res = await client.explorerPoints(s.id);
  console.log(res.source.name, res.source.point_count);
  for (const p of res.points) {
    console.log(" ", p.addr, p.name, p.unit);
  }
}

The source’s point_count and last_learn fields are populated at the same time, so explorerSources() alone is enough to see which sources have been learned.

Scan

Queues a discovery operation on an edge node. Returns once the operation is queued — poll explorerOps to track it, then read results from explorerSources.

explorerScan(op, { node_id, ...params })

Arguments

Argument Default Description
op — Discovery operation to run (required), e.g. "bacnet-scan"
node_id — Serial number of the edge node to run on; defaults to the first node in the project
...params — Operation specific parameters, see Operations

Array values are joined with commas and booleans are sent as true / false, so ip_addrs: ["10.0.1.1", "10.0.1.2"] and tls: true are both accepted. Any parameter left unspecified falls back to its default.

Operations

Each op accepts its own parameters. Credentials are referenced by name, not ID — the same name shown in Project Settings.

bacnet-scan — broadcasts across a range of device instance ids:

Parameter Default Description
port 47808 UDP port to scan
range_low 0 Lowest device instance id to scan (0-4194303)
range_high 4194303 Highest device instance id to scan (0-4194303)

bacnet-find — probes an explicit list of addresses. Use this when broadcast traffic does not reach the devices, across subnets for example:

Parameter Default Description
ip_addrs — Array of IP addresses to probe (required)
port 47808 UDP port to probe
max_time 5min Maximum time to spend searching (1min-15min)

jasper-scan — scans a Niagara instance for Jasper sources:

Parameter Default Description
ip_addr — IP address of the Niagara instance (required)
credential — Name of credential used to connect (required)
port 443 TCP port for the Niagara WebService
tls — Use TLS as a boolean

When tls is not specified it is enabled automatically for ports ending in 443 (i.e.: 443, 8443, 9443) and disabled otherwise.

influx-scan — scans an InfluxDB server for device sources:

Parameter Default Description
ip_addr — IP address of the InfluxDB server (required)
credential — Name of token credential used to connect (required)
port 8086 TCP port for the InfluxDB API
org — Organization name (InfluxDB 2.x); read from each bucket if not specified, required if the credential cannot read the organization
bucket — Bucket to scan; scans all buckets if not specified

kaiterra-find — finds Kaiterra sources by device identifier:

Parameter Default Description
uuids — Array of Kaiterra device UDIDs (required)
credential — Name of credential used to access device data (required)

Returns

An object with the ID of the queued operation:

{ proj_id: 4821, status: "ok", op_id: "0a1b2c3d4e5f6a7b" }

Example

// broadcast scan across the default instance id range
const { op_id } = await client.explorerScan("bacnet-scan");

// narrow the range and target a specific node
await client.explorerScan("bacnet-scan", {
  node_id: "NA00000000V1",
  range_low: 100,
  range_high: 200,
});

// probe explicit addresses across a subnet
await client.explorerScan("bacnet-find", {
  ip_addrs: ["10.0.1.1", "10.0.1.2"],
  max_time: "10min",
});

// scan a Niagara instance using a named credential
await client.explorerScan("jasper-scan", {
  ip_addr: "10.0.0.5",
  credential: "niagara-ro",
  port: 8443,
});

Learn

Queues a learn operation to read the point list from a discovered source. Returns once the operation is queued — poll explorerOps to track it, then read results from explorerPoints.

explorerLearn(source_id, { node_id })

Arguments

Argument Default Description
source_id — Discovery ID of the source to learn (required)
node_id — Serial number of the edge node to run on; defaults to the node that discovered the source

Everything else is derived from the source itself — its protocol, address, device id, and any credential used to discover it. Learning a source that has already been learned replaces its previous results.

Returns

An object with the ID of the queued operation:

{ proj_id: 4821, status: "ok", op_id: "0a1b2c3d4e5f6a7b" }

Example

const res = await client.explorerLearn("c1578fe370e4");
console.log(res.op_id);

Ops

Returns the status of explorer operations in this project: those queued, those running, and those completed in the last 24 hours.

explorerOps()

Returns

ExplorerOpList with the following fields:

Field Type Description
proj_id number Project ID
ops ExplorerOp[] Operations in the response

Each ExplorerOp has:

Field Type Description
id string Op ID, as returned by explorerScan or explorerLearn
op string Operation that was requested, e.g. bacnet-scan
state string queued, active, ok, or error
node_id string Serial number of the node running the operation
source_id string Source being read; learn operations only
started string ISO 8601 timestamp, set once the operation begins
finished string ISO 8601 timestamp, set once the operation is done
summary string Human-readable result, e.g. "Found 12 sources"
err_code string Set only when state is error

States progress queued → active → ok or error.

Example

const { ops } = await client.explorerOps();

// every queued, active, and recently completed operation
for (const op of ops) {
  console.log(op.id, op.op, op.state, op.summary);
}

// check one operation
const op = ops.find((o) => o.id === "0a1b2c3d4e5f6a7b");
if (op?.state === "error") console.log("failed:", op.err_code);

// which learns are still outstanding
const running = ["queued", "active"];
const pending = ops
  .filter((o) => o.op.endsWith("-learn") && running.includes(o.state))
  .map((o) => o.source_id);

Sources

Returns the sources discovered in this project, with any device metadata the source reported.

explorerSources()

Returns

ExplorerSourceList with the following fields:

Field Type Description
proj_id number Project ID
sources ExplorerSource[] Discovered sources in the response

Each ExplorerSource has:

Field Type Description
id string Discovery ID, e.g. "c1578fe370e4"
name string Source name
type string Protocol type, e.g. bacnet
addr string Source address
device_id number Device ID if reported
path string Source path if reported
vendor string Vendor name if reported
model string Model name if reported
version string Version if reported
firmware string Firmware revision if reported
desc string Description if reported
last_scan string ISO 8601 timestamp of the most recent scan
last_learn string ISO 8601 timestamp of the most recent learn, or null
point_count number Number of points discovered, or null until learned

The device metadata fields are populated from data reported by the source and are null when the source does not advertise them.

Example

const { sources } = await client.explorerSources();

// everything discovered so far
for (const s of sources) {
  console.log(s.id, s.name, s.type, s.addr);
}

// which sources have been learned
const learned = sources.filter((s) => s.last_learn != null);
console.log(learned.length, "of", sources.length, "learned");

// lookup by discovery ID
const s = sources.find((s) => s.id === "c1578fe370e4");
console.log(s.vendor, s.model, s.firmware);

Points

Returns a discovered source together with the points it advertises. Use this to inspect a source’s point list before mapping it into the project.

explorerPoints(source_id)

Arguments

Argument Default Description
source_id — Discovery ID of the source (required)

Returns

ExplorerPointList with the following fields:

Field Type Description
proj_id number Project ID
source ExplorerSource The source metadata
points ExplorerPoint[] Points advertised by the source

Each ExplorerPoint has:

Field Type Description
name string Point name
addr string Protocol address, e.g. "ai.1"
type string Point type
unit string Engineering unit if reported
enum string Enum type name if applicable
desc string Description if reported
sample any Sample value if reported

Explorer points are not project points: they have no point ID and are identified by their protocol addr. The list reflects the source’s last learn, so it is empty until source.last_learn is set.

Example

const res = await client.explorerPoints("23a769452950");

// source metadata comes back with the point list
console.log(res.source.name, res.source.last_learn);

for (const p of res.points) {
  console.log(p.addr, p.name, p.unit);
}

// lookup by protocol address
const p = res.points.find((p) => p.addr === "ai.1");
console.log(p.name, p.unit);   // "Discharge Air Temperature" "°F"

Notes

Poll no faster than every 30 seconds. Discovery operations run on physical equipment and take minutes, not seconds. A single explorerOps() call returns every outstanding operation, so queueing several learns and polling once is both faster and cheaper than tracking each one separately. Every request counts against your monthly data usage — see Rate Limits.

Queue depth is limited. If the project already has the maximum number of operations outstanding, explorerScan and explorerLearn throw a NovantError with status 429. Wait for queued work to finish and retry. See Error Handling.

Discovery IDs are not project IDs. Explorer sources use an opaque discovery ID (i.e.: "c1578fe370e4"). A source only receives an s.<n> ID once it has been bound into the project, after which it appears in sources().

Scans do not bind anything. Discovery is read-only with respect to your project — it tells you what is reachable from the edge node. Binding sources into the project is a separate step, done with importSources and importSourceMap.

Operations require an Edit or Control API key. explorerScan and explorerLearn throw a NovantError with status 403 for Read keys. Reading ops, sources, and points works with any key.