Hi there,
I´m exploring Ignition MQTT features, so maybe my doubt here could make no sense for people having good expertise with MQTT and Ignition.
Is there a way to customize the payload as the following:
{
"timestamp": 1755283633612,
"facility": "LEX01",
"zone": "DH1",
"equipment": "PDU_A_1",
"data_points": [
{ "name": "PDU_A_1 - Real Power", "apiPoint": "RealPower", "value": 412.5 },
{ "name": "PDU_A_1 - Voltage AN", "apiPoint": "VoltageAN", "value": 277.1 },
{ "name": "PDU_A_1 - Current A", "apiPoint": "CurrentA", "value": 521.0 }
]
}
In other words, each message states the equipment's identity once at the top (facility, zone, equipment, and a timestamp), then lists the tag readings underneath including various attributes.
Any help and comments will be appreciated.
The location, tag name and machine is normally included in the topic structure not in the payload.
Thanks David,
But what I need to know is if the payload can be customized to fit this user needs as shown previously and what it is needed to be done to get that result.
The native tag publishing mechanisms in Cirrus Link modules for Ignition are all explicitly formatted as Sparkplug compliant messages. What you show is a free-form message that will not be generated automatically.
You can use scripting with the Cirrus Link Engine module to publish free-form MQTT messages, and use custom namespaces to receive such. You are entirely on your own when using non-Sparkplug messages.
You asked for comments from people who use MQTT regularly, thats me.
My comment is that the structure you are suggesting is a poor use of MQTT, given that spark plug already covers your use case with much better efficiency and maintainability.
The vanilla MQTT implementation the entire industry would expect based on your notes above would look like this:
Topic:
LEX01/DH1/PDU_A_1/RealPower
Payload:
{
"timestamp" : 1755283633612 ,
"value": 412.5 ,
"units": "kW" ,
"name": "PDU_A_1 - Real Power"
}
Topic:
LEX01/DH1/PDU_A_1/VoltageAN
Payload:
{
"timestamp" : 1755283633612 ,
"value": 277.1 ,
"units": "V" ,
"name": "PDU_A_1 - Voltage AN"
}
Topic:
LEX01/DH1/PDU_A_1/CurrentA
Payload:
{
"timestamp" : 1755283633612 ,
"value": 521.0 ,
"units": "A" ,
"name": "PDU_A_1 - Current A"
}
Thanks David, It is clear to me now....