I am currently working on a system, that will receive data via MQTT engine in JSON format. Some structures are lists of metrics like the following:
{
"id": "550e8400-e29b-11d4-a716-446655440000",
"machineId": "WM703
"eventType": "machine-data",
"eventTime": "2024-11-09T19:32Z",
"eventCounter": 2,
"data": [
{
"name": "temperature",
"value": 75,
"measurementUnit": "°C",
"dataType": "float",
},
{
"name": "pressure",
"value": 1.5,
"measurementUnit": "bar",
"dataType": "float",
},
{
"name": "operational",
"value": true,
"measurementUnit": "",
"dataType": "boolean",
},
...
]
}
Usually we would want to publish this list with report by exception - meaning only the array fields, that changed will be transmitted.
I think when using SparkplugB Ignition can handle if the length of the data-Array changes. With JSON however it messes up the Tags in MQTT engine, because array fields will just get replaced and not properly updated. If for example an update would set the "operational" value to false, the structure in the MQTT engine would just replace the temperature and look like this:
{
"id": "550e8400-e29b-11d4-a716-446655440000",
"machineId": "WM703
"eventType": "machine-data",
"eventTime": "2024-11-09T19:32Z",
"eventCounter": 2,
"data": [
{
"name": "operational",
"value": 0,
"measurementUnit": "",
"dataType": "boolean",
},
{
"name": "pressure",
"value": 1.5,
"measurementUnit": "bar",
"dataType": "float",
},
{
"name": "operational",
"value": true,
"measurementUnit": "",
"dataType": "boolean",
},
...
]
}
Is there any other option, than manually parsing the data into tags?
Are there any plans to extend the functionalities of the MQTT engine?