MQTT BIRTH - Setting Ignition Tag Properties

Just wondering if anyone knows how to set the Tag Properties in Ignition from the NBIRTH or DBIRTH message_type elements (or other method)? I have an EoN device that is not Ignition (NodeRed - using Sparkplug node), but would like to send up some information to Ignition to provide more Meta data about the Tag. Example might be to add some description to the Documentation property of the Tag or Units of Measure (Engineering Units).

image

I’m not totally sure how easy the NodeRed implementation makes it, but the basic idea is to include a PropertySet on each metric in the NBIRTH/DBIRTH message, and use the “JSON/Scripting Name” from the Ignition tag properties documentation as the keys.

Some are filtered out by MQTT Engine by default, but things like engUnit/engLow/engHigh/documentation are definitely allowed through. The values to set each property to also mostly follow that document, but there are a few exceptions.

Thanks @jbrzozoski , so “loosely” the syntax would be something like:

{
    "timestamp" : 1465577611580
    "metrics" : [
        {
            "name" : "my_int",
            "value" : 456,
            "type" : "int32",
           *"documentation" : "my documentation"*  <--- new property to add
        }
    ]
}

or is there a special key word that I might be missing? Like:

{
“timestamp” : 1465577611580
“metrics” : [
{
“name” : “my_int”,
“value” : 456,
“type” : “int32”,
“PropertySet” : {
“documentation” : “my documentation”,

}
}
]
}

There’s a special layer that your missing. It would be more like this:

{
“timestamp” : 1465577611580
“metrics” : [
        { 
        “name” : “my_int”, 
        “value” : 456, 
        “datatype” : 3, 
        “properties” : {"keys" : ["documentation"], "values": [{"type":12, "string_value":"my documentation"}]},
        }
    ]
}

Within the properties there is an array named keys which is all the property names, then a second array named values which contains a bunch mini-metric-like things with a type and value for each. It’s a lot of overhead if you’re only doing one property, but it’s designed to support large sets of properties. :man_shrugging:

Ok thanks. I will give this a try.

If it is helpful there is also an example in Python here with the Engineering Units: tahu/example.py at develop · eclipse/tahu · GitHub. Structurally it would be the same as Justin described.

Thanks everyone. With some “tweeking” it all works. Thanks for the link and guidance everyone.

What gave me the correct syntax was this reference on Github: tahu/emulated-device.js at develop · eclipse/tahu · GitHub

Starting at Line 34 helped.

Neat. I never looked at the Node/JS payload format before. It rearranges a few things to an easier to read manner, instead of the raw protobuf manner. :+1:

I can’t seem to get the properties to come through in Ignition 8.1.2. I am using https://github.com/SeppPenner/SparkplugNet client.

Is there a specific logger I can look at in Ignition to eliminate formatting/parsing issues?
Should I expect a ‘properties’ leaf to show up for each Ignition Tag in Tag Browser?

mqtt.fx decoded NBIRTH

{
  "timestamp": 1632841416920,
  "metrics": [
    {
      "name": "/AVAILABILITY-agent_avail",
      "dataType": "String",
      "metaData": {
        "contentType": "",
        "size": 0,
        "seq": 0,
        "fileName": "",
        "fileType": "",
        "md5": "",
        "description": ""
      },
      "properties": {
        "nativeUnits": {
          "type": "String",
          "value": "nu1"
        },
        "EngUnit": {
          "type": "String",
          "value": "meow"
        },
        "Units": {
          "type": "String",
          "value": "u1"
        },
        "Documentation": {
          "type": "String",
          "value": "how"
        }
      },
      "value": "AVAILABLE"
    },
   ...

Take a look at the response above from @jbrzozoski . You need to use the ‘keys’ and ‘values’ arrays as he shows. In addition, you must use the keys from the ‘Binding/Scripting Name’ column in this doc: Tag Properties - Ignition User Manual 8.0 - Ignition Documentation

Thanks for the binding name tip. I think it is coming over as key array and value array. The mqtt.fx decoder doesn’t seem to show that but the other online decoder I found looks kinda arrayish. Ignition logs seem to show that the property values have been parsed out.

Capturing the NBIRTH payload stages in https://github.com/SeppPenner/SparkplugNet

  1. Payload class

  2. ProtoBufPayload class

  3. serialized payload

  4. hex payload

08E4BB96EAC22F12770A192F415641494C4142494C4954592D6167656E745F617661696C200C42004A4B0A0B6E6174697665556E6974730A05556E6974730A07656E67556E69740A0D646F63756D656E746174696F6E1204080C42001204080C42001208080C42046D656F771207080C4203686F777A09415641494C41424C45127A0A1A2F4445564943455F41444445442D6465766963655F6164646564200C42004A4B0A0B6E6174697665556E6974730A05556E6974730A07656E67556E69740A0D646F63756D656E746174696F6E1204080C42001204080C42001208080C42046D656F771207080C4203686F777A0B4D38303130344B3136324E12780A1E2F4445564943455F52454D4F5645442D6465766963655F72656D6F766564200C42004A4B0A0B6E6174697665556E6974730A05556E6974730A07656E67556E69740A0D646F63756D656E746174696F6E1204080C42001204080C42001208080C42046D656F771207080C4203686F777A054D617A616B127E0A1E2F4445564943455F4348414E4745442D6465766963655F6368616E676564200C42004A4B0A0B6E6174697665556E6974730A05556E6974730A07656E67556E69740A0D646F63756D656E746174696F6E1204080C42001204080C42001208080C42046D656F771207080C4203686F777A0B4D38303130344B3136324E128B010A2B2F41535345545F4348414E4745442D6167656E745F3263646534383030313132325F61737365745F636867200C42004A4B0A0B6E6174697665556E6974730A05556E6974730A07656E67556E69740A0D646F63756D656E746174696F6E1204080C42001204080C42001208080C42046D656F771207080C4203686F777A0B554E415641494C41424C45128B010A2B2F41535345545F52454D4F5645442D6167656E745F3263646534383030313132325F61737365745F72656D200C42004A4B0A0B6E6174697665556E6974730A05556E6974730A07656E67556E69740A0D646F63756D656E746174696F6E1204080C42001204080C42001208080C42046D656F771207080C4203686F777A0B554E415641494C41424C4512B8010A5A2F41646170746572732D5F5F61646170746572735F5F2F416461707465722D5F343134656639373230382F434F4E4E454354494F4E5F5354415455532D5F343134656639373230385F636F6E6E656374696F6E5F737461747573200C42004A4B0A0B6E6174697665556E6974730A05556E6974730A07656E67556E69740A0D646F63756D656E746174696F6E1204080C42001204080C42001208080C42046D656F771207080C4203686F777A094C495354454E494E4712DE010A662F41646170746572732D5F5F61646170746572735F5F2F416461707465722D5F343134656639373230382F4F42534552564154494F4E5F5550444154455F524154452D5F343134656639373230385F6F62736572766174696F6E5F7570646174655F72617465200C42004A630A0B6E6174697665556E6974730A05556E6974730A07656E67556E69740A0D646F63756D656E746174696F6E1210080C420C434F554E542F5345434F4E441210080C420C434F554E542F5345434F4E441208080C42046D656F771207080C4203686F777A0B554E415641494C41424C4512D2010A5A2F41646170746572732D5F5F61646170746572735F5F2F416461707465722D5F343134656639373230382F41535345545F5550444154455F524154452D5F343134656639373230385F61737365745F7570646174655F72617465200C42004A630A0B6E6174697665556E6974730A05556E6974730A07656E67556E69740A0D646F63756D656E746174696F6E1210080C420C434F554E542F5345434F4E441210080C420C434F554E542F5345434F4E441208080C42046D656F771207080C4203686F777A0B554E415641494C41424C4512C4010A682F41646170746572732D5F5F61646170746572735F5F2F416461707465722D5F343134656639373230382F414441505445525F534F4654574152455F56455253494F4E2D5F343134656639373230385F616461707465725F736F6674776172655F76657273696F6E200C42004A4B0A0B6E6174697665556E6974730A05556E6974730A07656E67556E69740A0D646F63756D656E746174696F6E1204080C42001204080C42001208080C42046D656F771207080C4203686F777A07312E372E302E3012B2010A5A2F41646170746572732D5F5F61646170746572735F5F2F416461707465722D5F343134656639373230382F4D54434F4E4E4543545F56455253494F4E2D5F343134656639373230385F6D74636F6E6E6563745F76657273696F6E200C42004A4B0A0B6E6174697665556E6974730A05556E6974730A07656E67556E69740A0D646F63756D656E746174696F6E1204080C42001204080C42001208080C42046D656F771207080C4203686F777A03312E37120F0A054244534551200442004A005800
  1. decoded at https://protogen.marcgravell.com/decode

  2. decoded at mqtt.fx

  3. Ignition logs

  4. I seem to have broken something. The metrics are not coming across in Ignition at all now. I didn’t modify my code.

There is a leading slash in your metric name that shouldn’t be there.

Ok removed that. Seems that it still ‘failed to handle tagPath’.

There still seems to be something wrong with your payload formatting. The ‘Failed to parse the NBIRTH payload’ message denotes it is not properly formatted. I would recommend looking at the Tahu examples for more details.

K, thanks Wes. I’ll dig into that and will start a new thread that is on topic.