You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 18 Next »

Basic Message Components

Topic 

The topic is published in the format [Namespace]/[Group ID]/[Message Type]/[Edge Node ID]/[Device ID] where:

  • Namespace
    • This always begins with “spBv1.0” to indicate that the topic is using the Sparkplug B version 1.0 specification. This serves as an identifier for the protocol version being used, as well as the encoding used for the associated payload data
  • Group ID

    • This identifies a logical grouping of Edge nodes and devices. For example, you might use a group ID to represent a particular factory or plant location. It ensures data segregation between different groups, aiding in efficient data management and security.

  • Message Type
    • The message_type component of the topic namespace signals how the MQTT payload should be processed. The following message_type components are defined for the Sparkplug topic namespace:

      NBIRTH: Edge node BIRTH certificate. This is a startup message from an Edge node to announce its presence and share its configurations.

      NDEATH: Notification of an edge node’s disconnection or failure.

      DBIRTH: Device BIRTH certificate. This is a startup message from a device to announce its presence and share its configurations.

      DDEATH: Notification of a device’s disconnection or failure.

      NDATA: Data messages from an edge node which include edge node metric data.

      DDATA: Data messages from a device which include device metrics.

      NCMD: Command to an edge node.

      DCMD: Command to a device.

      STATE: It represents the state of the primary host application. Edge nodes subscribe to it to get the online status of the host.

  • Edge Node ID
    • This uniquely identifies a specific edge node within in a group. Edge nodes are responsible for reporting data on behalf of devices they control or are connected to. The Edge Node ID helps in directing commands to the correct node and segregating data from various nodes.
  • Device ID (Optional)
    • If the message relates to a specific device controlled by the edge node, the device ID uniquely identifies that device.

Payload

The payload contains the following :

  • timestamp
    • The time stamp the payload was created
  • metrics
    • An array containing data specific to the message type being published
    • Each object in the array will include:
      • name
      • timestamp
      • dataType array
      • value
    • Optional parameters included in the object include:
      • alias
        • Included in BIRTH and DATA messages
        • Tied to name on BIRTH and included in all later DATA messages  
      • isHistorical
        • Included in BIRTH and DATA messages
        • Flag denoting the metric represents a historical value
      • isTransient
        • Included in BIRTH and DATA messages
        • Flag denoting the metric is a transient value
        • Set to null 
      • isNull
        • Included in BIRTH and DATA messages
        • Flag denoting the metric has a null value
      • metaData
        • Included in BIRTH messages
        • Includes Tooltip and Documentation if they have been changed from the Ignition default. See the Ignition Tag Properties reference for all available properties.
      • properties
        • The Quality property
          • May be included in BIRTH and DATA messages
          • If the Quality property is not included, the quality of the tag data is considered Good. See the Ignition Tag Quality Code Reference for the Data Quality value reference
        • Additional property values
          • Only included in BIRTH messages
          • Included if they have been changed from the Ignition default or if they are custom properties. See the Ignition Tag Properties reference for all available properties.
  • seq
    • The message sequence number used to ensure that messages are processed in the correct order
  • uuid
    • Set to null
  • body
    • Set to null


Examples

NBIRTH

Sparkplug Topic

spBv1.0/TestGroup/NBIRTH/TestEdge

Sparkplug Payload

[timestamp=1713266473578, metrics=[ Metric [name=Node Control/Next Server, alias=null, timestamp=1713266473578, dataType=MetricDataType [type=Boolean, intValue=11, clazz=class java.lang.Boolean], isHistorical=null, isTransient=null, metaData=null, properties=null, value=false, isNull=false], Metric [ name=Motor, alias=null, timestamp=1713266473578, dataType=MetricDataType [type=Template, intValue=19, clazz=class org.eclipse.tahu.message.model.Template], isHistorical=null, isTransient=null, metaData=MetaData [isMultiPart=false, contentType=, size=0, seq=0, fileName=, fileType=, md5=03081691ee14510415e1036a4d1f416d, description=], properties=PropertySet [propertyMap={}], value=Template [version=, templateRef=, isDefinition=true, metrics=[Metric [name=T1, alias=null, timestamp=1713266473578, dataType=MetricDataType [type=Int32, intValue=3, clazz=class java.lang.Integer], isHistorical=null, isTransient=null, metaData=MetaData [isMultiPart=false, contentType=, size=0, seq=0, fileName=, fileType=, md5=, description=], properties=PropertySet [propertyMap={}], value=null, isNull=true]], parameters=[]], isNull=false], Metric [name=E_T1, alias=null, timestamp=1713266473578, dataType=MetricDataType [type=String, intValue=12, clazz=class java.lang.String], isHistorical=null, isTransient=null, metaData=MetaData [isMultiPart=false, contentType=application/json, size=0, seq=0, fileName=, fileType=, md5=, description=], properties=PropertySet [propertyMap={engLow=PropertyValue [type=PropertyDataType [type=Double, intValue=10, clazz=class java.lang.Double], value=1.0, isNull=false], Quality=PropertyValue [type=PropertyDataType [type=Int32, intValue=3, clazz=class java.lang.Integer], value=-2147483133, isNull=false], enabled=PropertyValue [type=PropertyDataType [type=Boolean, intValue=11, clazz=class java.lang.Boolean], value=false, isNull=false]}], value=null, isNull=true], Metric [name=Node Info/Transmission Version, alias=null, timestamp=1713266473578, dataType=MetricDataType [type=String, intValue=12, clazz=class java.lang.String], isHistorical=null, isTransient=null, metaData=null, properties=null, value=4.0.22-SNAPSHOT (b2024041611), isNull=false], Metric [name=bdSeq, alias=null, timestamp=1713266473578, dataType=MetricDataType [type=Int64, intValue=4, clazz=class java.lang.Long], isHistorical=null, isTransient=null, metaData=null, properties=null, value=2, isNull=false], Metric [ name=E_M1, alias=null, timestamp=1713266473578, dataType=MetricDataType [type=Template, intValue=19, clazz=class org.eclipse.tahu.message.model.Template], isHistorical=null, isTransient=null, metaData=MetaData [isMultiPart=false, contentType=, size=0, seq=0, fileName=, fileType=, md5=, description=], properties=PropertySet [propertyMap={enabled=PropertyValue [type=PropertyDataType [type=Boolean, intValue=11, clazz=class java.lang.Boolean], value=false, isNull=false]}], value=Template [version=, templateRef=Motor, isDefinition=false, metrics=[Metric [name=T1, alias=null, timestamp=1713266473578, dataType=MetricDataType [type=Int32, intValue=3, clazz=class java.lang.Integer], isHistorical=false, isTransient=false, metaData=MetaData [isMultiPart=false, contentType=, size=0, seq=0, fileName=, fileType=, md5=, description=], properties=PropertySet [propertyMap={engUnit=PropertyValue [type=PropertyDataType [type=String, intValue=12, clazz=class java.lang.String], value=RPM, isNull=false], Quality=PropertyValue [type=PropertyDataType [type=Int32, intValue=3, clazz=class java.lang.Integer], value=-2147483133, isNull=false]}], value=null, isNull=true]], parameters=[]], isNull=false], Metric [name=Node Control/Rebirth, alias=null, timestamp=1713266473578, dataType=MetricDataType [type=Boolean, intValue=11, clazz=class java.lang.Boolean], isHistorical=null, isTransient=null, metaData=null, properties=null, value=false, isNull=false]], seq=0, uuid=null, body=null]

Sparkplug Payload Metrics (Examples)

Metric [name=Node Control/Next Server, alias=null, timestamp=1713266473578, dataType=MetricDataType [type=Boolean, intValue=11, clazz=class java.lang.Boolean], isHistorical=null, isTransient=null, metaData=null, properties=null, value=false, isNull=false]

Metric [name=Node Info/Transmission Version, alias=null, timestamp=1713266473578, dataType=MetricDataType [type=String, intValue=12, clazz=class java.lang.String], isHistorical=null, isTransient=null, metaData=null, properties=null, value=4.0.22-SNAPSHOT (b2024041611), isNull=false]

Metric [name=bdSeq, alias=null, timestamp=1713266473578, dataType=MetricDataType [type=Int64, intValue=4, clazz=class java.lang.Long], isHistorical=null, isTransient=null, metaData=null, properties=null, value=2, isNull=false]

Metric [ name=Motor, alias=null, timestamp=1713266473578, dataType=MetricDataType [type=Template, intValue=19, clazz=class org.eclipse.tahu.message.model.Template], isHistorical=null, isTransient=null, metaData=MetaData [isMultiPart=false, contentType=, size=0, seq=0, fileName=, fileType=, md5=03081691ee14510415e1036a4d1f416d, description=], properties=PropertySet [propertyMap={}], value=Template [version=, templateRef=, isDefinition=true, metrics=[Metric [name=T1, alias=null, timestamp=1713266473578, dataType=MetricDataType [type=Int32, intValue=3, clazz=class java.lang.Integer], isHistorical=null, isTransient=null, metaData=MetaData [isMultiPart=false, contentType=, size=0, seq=0, fileName=, fileType=, md5=, description=], properties=PropertySet [propertyMap={}], value=null, isNull=true]], parameters=[]], isNull=false]

Metric [name=E_T1, alias=null, timestamp=1713266473578, dataType=MetricDataType [type=String, intValue=12, clazz=class java.lang.String], isHistorical=null, isTransient=null, metaData=MetaData [isMultiPart=false, contentType=application/json, size=0, seq=0, fileName=, fileType=, md5=, description=], properties=PropertySet [propertyMap={engLow=PropertyValue [type=PropertyDataType [type=Double, intValue=10, clazz=class java.lang.Double], value=1.0, isNull=false], Quality=PropertyValue [type=PropertyDataType [type=Int32, intValue=3, clazz=class java.lang.Integer], value=-2147483133, isNull=false], enabled=PropertyValue [type=PropertyDataType [type=Boolean, intValue=11, clazz=class java.lang.Boolean], value=false, isNull=false]}], value=null, isNull=true]

Metric [name=T1, alias=null, timestamp=1713266473578, dataType=MetricDataType [type=Int32, intValue=3, clazz=class java.lang.Integer], isHistorical=false, isTransient=false, metaData=MetaData [isMultiPart=false, contentType=, size=0, seq=0, fileName=, fileType=, md5=, description=], properties=PropertySet [propertyMap={engUnit=PropertyValue [type=PropertyDataType [type=String, intValue=12, clazz=class java.lang.String], value=RPM, isNull=false], Quality=PropertyValue [type=PropertyDataType [type=Int32, intValue=3, clazz=class java.lang.Integer], value=-2147483133, isNull=false]}], value=null, isNull=true]], parameters=[]], isNull=false]

DBIRTH

Sparkplug Topic

spBv1.0/TestGroup/NBIRTH/TestEdge/TestDevice

Sparkplug Payload

[timestamp=1713266459127, metrics=[Metric [name=D_T1, alias=null, timestamp=1713266459127, dataType=MetricDataType [type=String, intValue=12, clazz=class java.lang.String], isHistorical=null, isTransient=null, metaData=MetaData [isMultiPart=false, contentType=application/json, size=0, seq=0, fileName=, fileType=, md5=, description=], properties=PropertySet [propertyMap={Quality=PropertyValue [type=PropertyDataType [type=Int32, intValue=3, clazz=class java.lang.Integer], value=192, isNull=false], enabled=PropertyValue [type=PropertyDataType [type=Boolean, intValue=11, clazz=class java.lang.Boolean], value=true, isNull=false], documentation=PropertyValue [type=PropertyDataType [type=String, intValue=12, clazz=class java.lang.String], value=Some helpful docs, isNull=false]}], value={ "Key1": "Value3" }, isNull=false], Metric [name=Device Control/Rebirth, alias=null, timestamp=1713266459127, dataType=MetricDataType [type=Boolean, intValue=11, clazz=class java.lang.Boolean], isHistorical=null, isTransient=null, metaData=null, properties=null, value=false, isNull=false], Metric [name=D_M1, alias=null, timestamp=1713266459127, dataType=MetricDataType [type=Template, intValue=19, clazz=class org.eclipse.tahu.message.model.Template], isHistorical=null, isTransient=null, metaData=MetaData [isMultiPart=false, contentType=, size=0, seq=0, fileName=, fileType=, md5=, description=], properties=PropertySet [propertyMap={enabled=PropertyValue [type=PropertyDataType [type=Boolean, intValue=11, clazz=class java.lang.Boolean], value=true, isNull=false]}], value=Template [version=, templateRef=Motor, isDefinition=false, metrics=[Metric [name=T1, alias=null, timestamp=1713266459127, dataType=MetricDataType [type=Int32, intValue=3, clazz=class java.lang.Integer], isHistorical=false, isTransient=false, metaData=MetaData [isMultiPart=false, contentType=, size=0, seq=0, fileName=, fileType=, md5=, description=], properties=PropertySet [propertyMap={engHigh=PropertyValue [type=PropertyDataType [type=Double, intValue=10, clazz=class java.lang.Double], value=60.0, isNull=false]}], value=12, isNull=false]], parameters=[]], isNull=false]], seq=1, uuid=null, body=null]

Sparkplug Payload Metrics (Examples)

Metric [name=Device Control/Rebirth, alias=null, timestamp=1713266459127, dataType=MetricDataType [type=Boolean, intValue=11, clazz=class java.lang.Boolean], isHistorical=null, isTransient=null, metaData=null, properties=null, value=false, isNull=false]

Metric [name=D_T1, alias=null, timestamp=1713266459127, dataType=MetricDataType [type=String, intValue=12, clazz=class java.lang.String], isHistorical=null, isTransient=null, metaData=MetaData [isMultiPart=false, contentType=application/json, size=0, seq=0, fileName=, fileType=, md5=, description=], properties=PropertySet [propertyMap={Quality=PropertyValue [type=PropertyDataType [type=Int32, intValue=3, clazz=class java.lang.Integer], value=192, isNull=false], enabled=PropertyValue [type=PropertyDataType [type=Boolean, intValue=11, clazz=class java.lang.Boolean], value=true, isNull=false], documentation=PropertyValue [type=PropertyDataType [type=String, intValue=12, clazz=class java.lang.String], value=Some helpful docs, isNull=false]}], value={ "Key1": "Value3" }, isNull=false]

Metric [name=D_M1, alias=null, timestamp=1713266459127, dataType=MetricDataType [type=Template, intValue=19, clazz=class org.eclipse.tahu.message.model.Template], isHistorical=null, isTransient=null, metaData=MetaData [isMultiPart=false, contentType=, size=0, seq=0, fileName=, fileType=, md5=, description=], properties=PropertySet [propertyMap={enabled=PropertyValue [type=PropertyDataType [type=Boolean, intValue=11, clazz=class java.lang.Boolean], value=true, isNull=false]}], value=Template [version=, templateRef=Motor, isDefinition=false, metrics=[Metric [name=T1, alias=null, timestamp=1713266459127, dataType=MetricDataType [type=Int32, intValue=3, clazz=class java.lang.Integer], isHistorical=false, isTransient=false, metaData=MetaData [isMultiPart=false, contentType=, size=0, seq=0, fileName=, fileType=, md5=, description=], properties=PropertySet [propertyMap={engHigh=PropertyValue [type=PropertyDataType [type=Double, intValue=10, clazz=class java.lang.Double], value=60.0, isNull=false]}], value=12, isNull=false]], parameters=[]], isNull=false]]

NDATA

Sparkplug Topic

spBv1.0/TestGroup/NDATA/TestEdge

Sparkplug Payload

[timestamp=1713266453938, metrics=[ Metric [name=E_M1, alias=null, timestamp=1713266452937, dataType=MetricDataType [type=Template, intValue=19, clazz=class org.eclipse.tahu.message.model.Template], isHistorical=null, isTransient=null, metaData=null, properties=null, value=Template [version=, templateRef=Motor, isDefinition=false, metrics=[Metric [name=T1, alias=null, timestamp=1713266445706, dataType=MetricDataType [type=Int32, intValue=3, clazz=class java.lang.Integer], isHistorical=null, isTransient=null, metaData=null, properties=null, value=12, isNull=false]], parameters=[]], isNull=false], Metric [name=E_T1, alias=null, timestamp=1713266452939, dataType=MetricDataType [type=String, intValue=12, clazz=class java.lang.String], isHistorical=null, isTransient=null, metaData=MetaData [isMultiPart=false, contentType=application/json, size=0, seq=0, fileName=, fileType=, md5=, description=], properties=PropertySet [propertyMap={}], value={ "Key1": "Value3" }, isNull=false]], seq=6, uuid=null, body=null]

Sparkplug Payload Metrics (Examples)

Metric [name=E_M1, alias=null, timestamp=1713266452937, dataType=MetricDataType [type=Template, intValue=19, clazz=class org.eclipse.tahu.message.model.Template], isHistorical=null, isTransient=null, metaData=null, properties=null, value=Template [version=, templateRef=Motor, isDefinition=false, metrics=[Metric [name=T1, alias=null, timestamp=1713266445706, dataType=MetricDataType [type=Int32, intValue=3, clazz=class java.lang.Integer], isHistorical=null, isTransient=null, metaData=null, properties=null, value=12, isNull=false]], parameters=[]], isNull=false]

Metric [name=E_T1, alias=null, timestamp=1713266452939, dataType=MetricDataType [type=String, intValue=12, clazz=class java.lang.String], isHistorical=null, isTransient=null, metaData=MetaData [isMultiPart=false, contentType=application/json, size=0, seq=0, fileName=, fileType=, md5=, description=], properties=PropertySet [propertyMap={}], value={ "Key1": "Value3" }, isNull=false]]

DDATA

Sparkplug Topic

spBv1.0/TestGroup/DDATA/TestEdge/TestDevice

Sparkplug Payload

[timestamp=1713266761298, metrics=[Metric [name=DT1, alias=null, timestamp=1713266730315, dataType=MetricDataType [type=Int32, intValue=3, clazz=class java.lang.Integer], isHistorical=true, isTransient=null, metaData=null, properties=null, value=5, isNull=false], Metric [name=DT1, alias=null, timestamp=1713266730416, dataType=MetricDataType [type=Int32, intValue=3, clazz=class java.lang.Integer], isHistorical=true, isTransient=null, metaData=null, properties=null, value=6, isNull=false], Metric [name=DT1, alias=null, timestamp=1713266730516, dataType=MetricDataType [type=Int32, intValue=3, clazz=class java.lang.Integer], isHistorical=true, isTransient=null, metaData=null, properties=null, value=7, isNull=false], Metric [name=DT1, alias=null, timestamp=1713266730617, dataType=MetricDataType [type=Int32, intValue=3, clazz=class java.lang.Integer], isHistorical=true, isTransient=null, metaData=null, properties=null, value=8, isNull=false], Metric [name=DT1, alias=null, timestamp=1713266730718, dataType=MetricDataType [type=Int32, intValue=3, clazz=class java.lang.Integer], isHistorical=true, isTransient=null, metaData=null, properties=null, value=9, isNull=false]], seq=15, uuid=null, body=null]

Sparkplug Payload Metrics (Examples)

Metric [name=DT1, alias=null, timestamp=1713266730315, dataType=MetricDataType [type=Int32, intValue=3, clazz=class java.lang.Integer], isHistorical=true, isTransient=null, metaData=null, properties=null, value=5, isNull=false]

Metric [name=DT1, alias=null, timestamp=1713266730416, dataType=MetricDataType [type=Int32, intValue=3, clazz=class java.lang.Integer], isHistorical=true, isTransient=null, metaData=null, properties=null, value=6, isNull=false]

Metric [name=DT1, alias=null, timestamp=1713266730516, dataType=MetricDataType [type=Int32, intValue=3, clazz=class java.lang.Integer], isHistorical=true, isTransient=null, metaData=null, properties=null, value=7, isNull=false]

Sparkplug Payload

[timestamp=1713266453943, metrics=[ Metric [name=D_M1, alias=null, timestamp=1713266452942, dataType=MetricDataType [type=Template, intValue=19, clazz=class org.eclipse.tahu.message.model.Template], isHistorical=null, isTransient=null, metaData=null, properties=null, value=Template [version=, templateRef=Motor, isDefinition=false, metrics=[Metric [name=T1, alias=null, timestamp=1713266445725, dataType=MetricDataType [type=Int32, intValue=3, clazz=class java.lang.Integer], isHistorical=null, isTransient=null, metaData=null, properties=null, value=12, isNull=false]], parameters=[]], isNull=false], Metric [name=D_T1, alias=null, timestamp=1713266452947, dataType=MetricDataType [type=String, intValue=12, clazz=class java.lang.String], isHistorical=null, isTransient=null, metaData=MetaData [isMultiPart=false, contentType=application/json, size=0, seq=0, fileName=, fileType=, md5=, description=], properties=PropertySet [propertyMap={}], value={ "Key1": "Value3" }, isNull=false]], seq=7, uuid=null, body=null]

Sparkplug Payload Metrics (Examples)

Metric [name=D_M1, alias=null, timestamp=1713266452942, dataType=MetricDataType [type=Template, intValue=19, clazz=class org.eclipse.tahu.message.model.Template], isHistorical=null, isTransient=null, metaData=null, properties=null, value=Template [version=, templateRef=Motor, isDefinition=false, metrics=[Metric [name=T1, alias=null, timestamp=1713266445725, dataType=MetricDataType [type=Int32, intValue=3, clazz=class java.lang.Integer], isHistorical=null, isTransient=null, metaData=null, properties=null, value=12, isNull=false]], parameters=[]], isNull=false]

Metric [name=D_T1, alias=null, timestamp=1713266452947, dataType=MetricDataType [type=String, intValue=12, clazz=class java.lang.String], isHistorical=null, isTransient=null, metaData=MetaData [isMultiPart=false, contentType=application/json, size=0, seq=0, fileName=, fileType=, md5=, description=], properties=PropertySet [propertyMap={}], value={ "Key1": "Value3" }, isNull=false]]

NDEATH

Sparkplug Topic


Sparkplug Payload


DDEATH

Sparkplug Topic


Sparkplug Payload


NCMD

Sparkplug Topic


Sparkplug Payload


DCMD

Sparkplug Topic


Sparkplug Payload


STATE

Sparkplug Topic

spBv1.0/STATE/primary_host_id

Sparkplug Payload

{ "online" : true,  "timestamp" : 1668114759262} 

or

{ "online" : true,  "timestamp" : 1668114759452}

  • No labels