Novant

Documentation

Sign in

Write

Write

Writes a value to a writable point. Pass None as the value to clear a priority hold and release control back to the next level.

write(point_id, value, level=None, expires=None)
Argument Default Description
point_id Point ID string (required)
value Numeric value, or None to clear the priority hold
level 16 Priority level (1–16)
expires None Auto-release duration, e.g. "1hr", "30min", "1day"

Returns

A dict with the result status:

{"status": "ok"}

Example

# Write a value
result = client.write(point_id="s.2.4", value=72.5)
print(result["status"])   # "ok"

# Write at a specific priority level
client.write(point_id="s.2.4", value=70.0, level=8)

# Write that auto-releases after one hour
client.write(point_id="s.2.4", value=70.0, expires="1hr")

# Clear the priority hold
client.write(point_id="s.2.4", value=None)

Write Batch

Writes values to multiple points in a single request. Validation is all-or-nothing: if any entry is invalid the entire request is rejected and no writes are committed. A maximum of 25 writes is allowed per request.

write_batch(writes)
Argument Default Description
writes List of write dicts (required, 1–25 entries)

Each entry in writes is a dict with the following keys:

Key Required Description
point_id yes Point ID string
value yes Numeric value, or None to clear the priority hold
level no Priority level (1–16, defaults to 16)
expires no Auto-release duration, e.g. "1hr", "30min", "1day"

Returns

A dict with the result status:

{"status": "ok"}

Example

result = client.write_batch([
    {"point_id": "s.1.3", "value": 25.0, "level": 8},
    {"point_id": "s.1.4", "value": 20.0, "expires": "1hr"},
])
print(result["status"])   # "ok"