I'm evaluating an MQTT solution for data collection on a certain machine. The data comes in an odd way. I'm not really getting individual tags like I would expect, but a series of values in an array.
I'm wondering if I can make the data more usable and transform this data where the name
is an actual tag instead of an item in the metrics array. Any ideas?
It seems like unnecessary overhead to be required to parse the payload and write the values to tags every time seq
increments.
{
"metrics": [
{
"alias": 2,
"datatype": 12,
"name": "Disturbancetime",
"timestamp": 1724348040000,
"value": "396:30:42"
},
{
"alias": 6,
"datatype": 12,
"name": "Maintenancetime",
"timestamp": 1724348040000,
"value": "00:00:00"
},
{
"alias": 11,
"datatype": 12,
"name": "Operationtime",
"timestamp": 1724348040000,
"value": "736:55:12"
},
{
"alias": 16,
"datatype": 12,
"name": "Setuptime",
"timestamp": 1724348040000,
"value": "242:43:27"
},
{
"alias": 18,
"datatype": 12,
"name": "Standstilltime",
"timestamp": 1724348040000,
"value": "1691:27:31"
},
{
"alias": 20,
"datatype": 10,
"name": "Totaloperationtime",
"timestamp": 1724348040000,
"value": 3
},
{
"alias": 22,
"datatype": 3,
"name": "Velocity",
"timestamp": 1724348040000,
"value": 10312
}
],
"seq": 230,
"timestamp": 1724348040008
}