Skip to main content

Sparkplug B

Clarify supports Sparkplug B which allows compatible clients to create signals with meta-data and transmit timeseries directly to Clarify. This page will focus on how messages are parsed by Clarify, for an in-depth look at the protocol itself, you can check out the full specification.

DDATA / DBIRTH

Example

Topic

spBv1.0/<group_id>/<message_type>/<edge_node_id>/[device_id]

Payload

{
"timestamp": 1486144502122,
"metrics": [
{
"name": "Machine A/Temperature",
"alias": 1,
"timestamp": 1479123452194,
"dataType": "Float",
"value": 23.52,
"properties": {
"keys": ["engineering-unit"],
"values": [{
"type": "String",
"value": "C"
}]
}
},
{
"name": "Machine A/Humidity",
"alias": 1,
"timestamp": 1479123452194,
"dataType": "Float",
"value": 64.12,
"properties": {
"keys": ["engineering-unit"],
"values": [{
"type": "String",
"value": "%"
}]
}
}
],
"seq": 2
}

Given the payload above, two signals would be created in Clarify with information from the topic and the payload combined.

[
{
"name": "Temperature",
"labels": {
"group-id": ["<group_id>"],
"edge-node-id": ["<edge_node_id>"],
"device": ["<device_id>"],
"folder": ["Machine A"],
"property-engineering-unit": ["C"]
}
},
{
"name": "Humidity",
"labels": {
"group-id": ["<group_id>"],
"edge-node-id": ["<edge_node_id>"],
"device": ["<device_id>"],
"folder": ["Machine A"],
"property-engineering-unit": ["%"]
}
}
]

Payload fields

This format supports properly formatted and protobuf encoded Sparkplug B messages. Currently DBIRTH and DDATA messages are used to create signals and insert data. Please see the Sparkplug B specification for details.

Supported message types

  • DDATA
  • DBIRTH

Supported value types

  • UInt32
  • UInt64
  • Float
  • Double
  • Bool