On connect, configure the MQTT Last Will and Testament as an NDEATH payload on the topic spBv1.0/GROUP_ID/NDEATH/EDGE_NODE_ID with QoS 1 and the retained flag set appropriately per the spec.
Immediately after a successful MQTT CONNECT, publish an NBIRTH message to spBv1.0/GROUP_ID/NBIRTH/EDGE_NODE_ID using QoS 0, containing all metric definitions with full metadata (name, alias, datatype, initial value) and a sequence number starting at 0.
For each connected device, publish a DBIRTH to spBv1.0/GROUP_ID/DBIRTH/EDGE_NODE_ID/DEVICE_ID at QoS 0 with that device's full metric catalog.
Publish operational telemetry as NDATA or DDATA messages at QoS 0, including only changed metrics plus the incremented sequence number (0-255, wrapping).
Use metric aliases (integer handles) in DATA messages instead of full string names to reduce payload size; aliases must be established in the BIRTH message.
The Primary Host Application publishes its STATE messages (online/offline) to spBv1.0/STATE/HOST_APP_ID at QoS 1 — this is the only message type requiring QoS 1 for a host.
Known gotchas
QoS 0 is mandated for ALL Edge Node and Device BIRTH, DEATH, and DATA messages; using QoS 1 for these violates the specification even though the broker may accept it.
QoS 1 is used ONLY for the Primary Host Application STATE message; confusing this with Edge Node messages is a common implementation error.
If the Edge Node reconnects, it must republish NBIRTH and all DBIRTH messages before publishing any DATA, because subscribers rely on the BIRTH to interpret metric aliases.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp