MQTT Publisher item naming
- Last UpdatedSep 04, 2025
- 3 minute read
The publisher in the MQTT Communication Driver publishes its data in:
-
JSON-VTQ1
-
JSON-VTQ2
-
Sparkplug
JSON-VTQ1
In this format, a single item is published under its own MQTT topic.
The name of the MQTT topic is:
Group/ItemName
The format of the JSON string in each topic is:
{“d”: value, “dt”: datatype, “ts”: timestamp, “q”: quality }
where,
-
Group: optional prefix as defined in the publisher Group ID field:
-
If Group is blank, the / character is omitted and the ItemName is used as the topic name.
-
If Group is not blank, the / character is added automatically to the topic name between the Group Name and the Item Name.
-
Must not contain the slash / character.
-
-
ItemName: attribute name defined in the publisher.
-
value: data value of item (in JSON convention).
-
datatype: ordinal value of Microsoft’s VARENUM Variant data type. For example: 2 is VT_I2, 3 is VT_I4, 8 is VT_BSTR, 11 is VT_BOOL
-
timestamp: timestamp of the data point in UTC expressed in ISO 8601 format. For example: 2021-06-17T22:46:07Z = June 17 2021, 10:46:07 pm UTC. The ISO 8601 timestamp string ends with Z.
-
quality: OPC DA quality of the data point. For example: 192 = good; 0 = bad, 4 = Configuration error, 24 = Communication failure.
JSON-VTQ2
In this format, multiple items are published under a single topic (up to 1000 items per topic).
Each item in the JSON payload corresponds to a selected attribute from the data source in the System Platform. Multiple values of the same item can be published in the same MQTT payload message if they are changed within a second or when the publisher is disconnected from the broker with store-and-forward mode enabled.
For items in the Edge Gateway (EON), the topic is: Group/EON
For items in the Device, the topic is: Group/EON/Device
The format of the JSON string in each topic is an array of JSON string is:
{
"timestamp": timestamp_sent, "values": [
{ "id": itemName, "v": value, "dt": dataType, "t": timestamp_ds, "q": quality },
{ "id": itemName, "v": value, "dt": dataType, "t": timestamp_ds, "q": quality },
…
{ "id": itemName, "v": value, "dt": dataType, "t": timestamp_ds, "q": quality },
{ "id": itemName, "v": value, "dt": dataType, "t": timestamp_ds, "q": quality }
]
}
where,
-
Group: optional prefix as defined in the publisher in MQTT Publisher configuration. If this value is not blank, the / character is added automatically to the publishing MQTT topic between the Group name and EON name.
-
EON: Edge Gateway (EON) name published by the MQTT publisher.
-
Device: Device name published by the MQTT publisher.
-
timestamp_sent: timestamp when the message was sent from the MQTT publisher to the MQTT broker. The value is expressed in the number of milliseconds since Jan 1, 1970, UTC (Unix format).
-
itemName: attribute name defined in the publisher of Gateway Communication Driver.
-
value: data value of item (in JSON convention).
-
dataType: ordinal value of Microsoft’s VARENUM Variant data type. For example: 2 is VT_I2, 3 is VT_I4, 8 is VT_BSTR, 11 is VT_BOOL
-
timestamp_ds: timestamp of data value at the data source expressed in the number of milliseconds since Jan 1, 1970, UTC (Unix format).
-
quality: OPC DA quality of the data point. For example: 192 = good; 0 = bad, 4 = Configuration error, 24 = Communication failure.
Sparkplug
The format of the MQTT item reference published in Sparkplug is:
-
For items in an Edge Gateway (EON), the item reference syntax is:
spvB1.0/Group/EON.(Metric).value
-
For items in the Device, the item reference syntax is:
spvB1.0/Group/EON/Device.(Metric).value
where,
-
Group: Group name defined in the MQTT publisher
-
EON: Edge Gateway (EON) name published by the MQTT publisher
-
Device: Device name published by the MQTT publisher
-
Metric: Item name of the attribute published by the MQTT publisher