Sparkplug B

Sparkplug B node metrics as equipment data right in the chat

Connect Sparkplug B nodes to the AI agent: Ignition, HighByte and Litmus metrics with units from BIRTH. The agent shows history and nodes that went offline.

How the agent works with Sparkplug B

The broker your Sparkplug B nodes publish to usually sits on the site's network, so the gateway reaches it: a program installed on a computer on the same network. The gateway is added on the Gateways tab and assigned to the connection. The connection takes the broker address, a login and password if needed, and the Sparkplug groups; empty means every group on the broker.

The gateway reads Sparkplug B 3.0 as an observing host. NBIRTH and DBIRTH declare metrics with their types and units and assign aliases, NDATA and DDATA arrive by name or alias, NDEATH and DDEATH darken a node's or device's metrics. A tag is named by the metric's name, never its alias. A sequence gap does not stop reading: the gateway drops the node's aliases and asks the broker for its kept BIRTH messages.

The gateway publishes no STATE and sends no NCMD Rebirth, so it cannot be mistaken for the Primary Host, and nodes do not disconnect when it goes away. It writes no messages to the broker at all, and subscribe rights are enough for its account. The agent reads values, history and freshness, but sends no commands to nodes or devices.

If the gateway joins in the middle of a node's session, alias names come from the BIRTH messages kept by a Sparkplug Aware broker or from the node's next BIRTH; metrics sent by name are read at once. The catalog is capped by the Max tags setting (10000 by default). History builds up from the moment of connection.

Integration scenarios

A node's current metrics

The agent finds metrics by group, node, device or name and shows the latest values with units from BIRTH and their freshness.

History for a period

The agent collects a metric's history in intervals: minimum, maximum, average and last value, with gaps where there was no data.

Which nodes went offline

The agent sees metrics darkened by NDEATH or DDEATH and names the nodes and devices that send no data.

Comparing devices

The agent lines up one metric across devices of a group, such as pressure on several pumps, and compares averages and peaks over a period.

A task on a condition

The agent sets up an On event task that starts when a metric's value crosses a threshold and holds there for the time you set.

Gateway connectivity

The agent tells whether the gateway and its broker connection are online, and an On event task learns when the gateway drops and when it is back.

Sparkplug B examples

Sparkplug B
Frozen chats: click a question
Какие узлы сейчас не на связи?

2 узла и одно устройство не присылают данных.

  • Узел Edge-Line2 погашен по NDEATH в 07:52
  • Устройство Filler-03 на узле Edge-Line1 погашено по DDEATH в 08:10

Их метрики не показываю текущими, пока узел не пришлёт новый BIRTH.

How to connect

Before you connect

  • An MQTT 5 or 3.1.1 broker with Sparkplug B 3.0 nodes
  • Subscribe rights to spBv1.0/… and $sparkplug/certificates/… on the broker
  • A computer on the site's network for the gateway program
  • A separate Primary Host if the nodes require one
  • Server admits listed addresses only? Allow connections from 158.160.205.91 and 87.228.27.163.
  1. 1

    Keep the existing Primary Host

    The gateway only observes: it publishes no STATE and sends no NCMD Rebirth. If nodes require a Primary Host, another broker client must provide it.

  2. 2

    Wait for the nodes' BIRTH messages

    Aliases get their names from NBIRTH/DBIRTH. Joining mid-session needs kept BIRTH messages from a Sparkplug Aware broker or the node's next BIRTH.

FAQ

Install the gateway on a computer on the site's network and add it on the Gateways tab. In the Sparkplug B connection enter the broker address, for example mqtt://10.0.12.5:1883, a login and password if the broker requires them, and exact group names separated by commas, or leave the field empty for every group.

The metrics of nodes and devices in the chosen groups as tags with types, units and descriptions from BIRTH, their current values, history from the moment of connection and which nodes and devices are darkened by DEATH.

No. The gateway publishes no STATE, NCMD or DCMD and writes nothing to the broker at all. Subscribe rights are enough for it.

The node sends data by alias, and the gateway missed its BIRTH. The names appear from kept BIRTH messages if the broker is Sparkplug Aware, or from the node's next BIRTH.

Category
Equipment
Connection
API key

Connect Sparkplug B

Connecting takes a couple of minutes, and your data stays in your own systems.

Connect