Device protocol

Inspectable MQTT, strict envelopes.

Nivalo devices speak Cloud MQTT v1.1: per-device credentials bound to an exact client ID, bounded topic ownership, byte-limited JSON envelopes, session-epoch presence and at-most-once operations. The immutable protocol files published with this site are authoritative when this overview and a machine-readable contract differ.

Topics

DirectionTopicPurpose
Device → cloudnivalo/v1.1/devices/{deviceId}/telemetryBatched measurements: up to 8 samples and 24 readings per message
Device → cloudnivalo/v1.1/devices/{deviceId}/eventsStructured events with a severity
Device → cloudnivalo/v1.1/devices/{deviceId}/stateReported state observations
Device → cloudnivalo/v1.1/devices/{deviceId}/definitionsCapability catalog deltas (variables and functions)
Device → cloudnivalo/v1.1/devices/{deviceId}/availabilityRetained birth and end, periodic heartbeat
Cloud → devicenivalo/v1.1/devices/{deviceId}/commands/{commandId}Generic command delivery
Cloud → devicenivalo/v1.1/devices/{deviceId}/ota/{commandId}Signed firmware update job
Device → cloud…/commands/{commandId}/ack, …/ota/{commandId}/ackOperation acknowledgements

Envelope

Every message is one UTF-8 JSON object of at most 3072 bytes with a unique message ID, the exact device ID and a UTC timestamp from a synchronised clock. Operation routes carry a correlation ID equal to the route ID; only the availability birth carries the firmware identity.

{
  "schema": "nivalo.iot.v1.1",
  "messageId": "33333333-3333-4333-8333-333333333333",
  "deviceId": "22222222-2222-4222-8222-222222222222",
  "sentAt": "2026-11-24T12:00:05Z",
  "payload": {
    "samples": [
      { "at": "2026-11-24T12:00:00Z", "metrics": [{ "name": "temp", "value": 21.125, "unit": "C" }] },
      { "metrics": [{ "name": "temp", "value": 21.5, "unit": "C" }] }
    ]
  }
}

Presence

Operations

  1. The API creates a command as queued with a per-device sequence number, an issue time and an expiry. A command must name a function the device reports and the product defines with an argument schema.
  2. Before publishing, the platform durably records that the operation may have been sent (published), and it publishes at most one operation per device at a time.
  3. The device journals its claim, reports accepted (and optionally running), runs the effect at most once, and finishes with succeeded or failed.
  4. An operation that ends without a device result after it may have been sent, or whose effect the device cannot confirm, is indeterminate: the outcome is unknown and the device may have acted. It is never retried automatically.

Delivery rules

Authoritative references

This page is an integration overview. CI copies an exact, immutable protocol revision into each public documentation artifact. Those published files are the source of truth for compatibility, exact fields, limits, and machine validation; they do not depend on anonymous access to the private engineering repository.

ReferenceUse it for
Cloud MQTT v1.1Topics, broker identity, envelopes, limits, presence, telemetry, capabilities, operations, OTA, errors and usage units.
Device claim v1One-use claim exchange, proof-of-possession, retry behavior, and password-free responses.
NivaloLink SPI v1ESP32-to-application-MCU framing, CRC, flow control, retries, and payload limits.
JSON SchemasMachine validation for the envelope; the adjacent public protocol/schemas/v1.1/ directory contains telemetry, events, state, availability, capability, command, OTA and acknowledgement schemas.
Open the exact MQTT specificationUse the device librariesCall the customer API