Skip to content
MaestroHub
Menu
Free trialdownload and run it todayStart the pilot

Integrations

OPC UA to Sparkplug B, without a script.

Read the OPC UA nodes with MaestroHub and publish them as Sparkplug B metrics, with MaestroHub acting as the Edge Node: birth and death certificates, Protocol Buffers payloads and sequence numbers are handled for you.

The flow

One value, from the machine to Sparkplug B. Illustrative.

OPC UAindustrial protocolns=2;s=Line2.State
MaestroHub

Line 2 state · Running · Good

  • named, unit, quality
  • origin stamped
  • buffered on disk
Sparkplug BMQTT specificationspBv1.0/Plant1/DDATA/Edge1/Line2

Why do it with MaestroHub

More than a pipe from OPC UA to Sparkplug B.

01

Sparkplug done right

Birth, death and sequence handling are built in, so SCADA sees a well-behaved edge node.

02

Any source, not only OPC UA

S7, Modbus and Allen-Bradley values can be published as Sparkplug metrics the same way.

03

Context before it leaves

Values carry names and units from the namespace before they become metrics.

What lands in Sparkplug B

An example. You choose the fields in the pipeline.

metricvaluedatatypetimestamp
Line2/StateRunningString2026-10-03T06:00:01Z

Set it up in three steps

  1. 1

    Connect OPC UA

    Add the OPC UA server, browse its address space and pick the nodes, or add hundreds at once with bulk creation.

  2. 2

    Give the values meaning

    Map each value to a topic in the namespace with its name, unit and schema. Quality and origin are stamped on every value.

  3. 3

    Deliver to Sparkplug B

    Add a Sparkplug B publish output; MaestroHub acts as the Edge Node and handles birth, death and sequence numbers.

Before you start

What each side needs, from the connector documentation.

OPC UA

  • The server address, built as opc.tcp://host:port/path. The standard OPC UA port is 4840.
  • For any Security Policy other than None, a client certificate: paste your own (RSA keys only) or let MaestroHub generate a self-signed one.
  • If you use the auto-generated certificate, the OPC UA server administrator must trust it on the server.
  • A username and password when the server does not allow Anonymous access.

Example settings

Server Hostname
opcua.example.com
Port
4840
Security Policy
Basic256Sha256
Security Mode
SignAndEncrypt
Certificate Mode
Auto-generate (self-signed)
Authentication Type
UsernamePassword
OPC UA connector documentation

Sparkplug B

  • An MQTT broker hostname and port (1883 by default), with scheme tcp, ssl, ws or wss.
  • A Group ID and an Edge Node ID that is unique within the group. Together they identify this MaestroHub instance.
  • Broker username and password if the broker requires them.

Example settings

Broker
broker.example.com
Port
1883
Scheme
tcp
Group ID
factory-floor
Edge Node ID
edge-node-01
Device ID (Publish Device Data)
sensor-01
Sparkplug B connector documentation

Things to know

Pitfalls and limits the documentation calls out, so they don't surprise you on site.

OPC UA

  • Security Policy and Security Mode must agree. Policy None requires Mode None. Any other policy requires Sign or SignAndEncrypt.
  • Node identifiers need a namespace index and a type prefix (i=, s=, g=, b=). Namespace 0 is typically standard nodes, 2 and up custom nodes. Browse a small scope first to find the exact IDs.
  • On Monitor functions, set the sampling interval equal to or faster than the publishing interval, or changes can be missed. Subscriptions are recreated automatically after a lost connection or a session timeout.

Limits

  • Manual client certificates support RSA keys only. Auto-generated certificates are RSA 2048-bit and valid for 365 days.
  • Monitor functions cannot be created through Quick Add. Use the full Function Builder.

Sparkplug B

  • Numbers saved in the function's metrics are published as Double, whatever integer type the editor shows. Integer types are published only when the value arrives as an integer at run time, for example through a parameter.
  • SparkPlug B connections need exclusive scaling, because birth and death certificates and sequence numbers must be managed by one instance.
  • NDEATH is set as the Last Will automatically, and a DBIRTH is sent on the first data message for each device. On the trigger, NDEATH and DDEATH frames always carry quality bad.

Limits

  • The Subscribe function is a passive listener, not a Host Application. It does not publish STATE messages, request rebirths or send NCMD or DCMD commands.
  • Only one Discover session can run on a connection at a time.

What teams use it for

Feeding Sparkplug SCADA

Ignition or other Sparkplug-aware systems receive clean metrics.

Report by exception

Only changes are sent, with state awareness on reconnect.

Edge to cloud bridges

Sparkplug brokers carrying plant data to central systems.

Ways to connect OPC UA to Sparkplug B

In general terms. Check any specific product for its own details.

Compare a custom script, a flow tool, a cloud vendor's edge service and MaestroHub

Swipe sideways to see every column

A custom scriptA flow toolA cloud vendor's edge serviceMaestroHub
Talks OPC UAA library you chooseCommunity plug-insDepends on the vendorBuilt in, one of 90+ connectors
Names, units and schemaYou write itYou build itPartly, in the vendor's modelOne governed namespace
Quality on every valueYou write itYou build itDepends on the vendorBuilt in, carried through calculations
Where each value came fromYou write itYou build itDepends on the vendorStamped on every value
Survives a network outageYou build itYou build itUsually, to that vendor's cloudOn disk, per destination, in order
Several destinations at onceOne script eachYes, flow by flowMostly that vendor's cloudAny mix, each with its own buffer
Permissions and auditYou build itYou build itCloud account permissionsRoles, single sign-on, audit trail
AI agents can use the dataYou build itYou build itDepends on the vendorThrough the MCP server

Questions

How do I publish OPC UA data as Sparkplug B?

Read the OPC UA nodes with MaestroHub and publish them as Sparkplug B metrics, with MaestroHub acting as the Edge Node: birth and death certificates, Protocol Buffers payloads and sequence numbers are handled for you.

Do I need to write code to connect OPC UA to Sparkplug B?

No. You configure the OPC UA connection and the Sparkplug B output in MaestroHub and join them with a pipeline. Transformations can be added where you need them.

Where does MaestroHub run for this?

On your own infrastructure next to the machines: an edge box, a virtual machine or Kubernetes. Nothing has to leave your network.

Why not just write a script for OPC UA to Sparkplug B?

A script works on day one. The cost comes later: decoding and naming values, handling bad quality, buffering through outages, keeping credentials safe, and doing it again for the next machine and the next destination. MaestroHub does those once, for every connector.

What else can OPC UA data go to?

More than 90 connectors are included in every edition, among them historians, databases, cloud warehouses, message brokers and business systems, so the same values can feed several destinations at once.

Try OPC UA to Sparkplug B yourself.

The free trial includes every connector. No factory to hand? The Digital Factory Simulator serves OPC UA, Modbus, MQTT and more on your laptop.

Cookie preferences

Choose which categories of cookies you allow. Strictly necessary cookies are always on because the site cannot function without them.