Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

MQTT Engine Custom Namespaces are used to provide support for generic, non Sparkplug compliant MQTT messages with string based payloads. If a custom namespace is configured MQTT Engine will convert all messages received to tags where the topic of each message will translate directly to the tag's path and the payload will be the tag's value.

The data type of Ignition tag created is determined by the incoming JSON value - for example a value of 70 will result in a tag with an Integer data type and a value of 70.25 will result in a tag with a Double data type.

Tip

From release 4.0.28, MQTT Engine supports the option to treat all numbers as decimals numbers when creating custom namespace tags

For null payload values:

  • If a tag already exists, null payload values are supported.
  • If the tag does not already exist, no tag will be created as the data type is indeterminate.


Anchor
customnamenotes
customnamenotes

...

Let say we have a publish received on the topic "test/data/point" with value "12345".  If no Tag Name is configured, and a message is received, MQTT Engine will create a two folders "test" and "data" and a tag "point" with the value of "12345".Image Added

Image Removed


Tag Name Configured

If a Tag Name is configured, lets call it "payload", then MQTT Engine will convert each token in the topic to a folder and create a tag called "payload" with the value "12345"Image RemovedImage Added

In most cases it is useful to specify a Tag Name in order to prevent cases when a publish on a topic can overwrite a previously created tag, changing it into a folder.  Consider the case where you have the following two publishes:

...

Let say we have a publish received on the topic "test/data/json" with value '{ "stringTag" : "12345", "folderTag" : { "intTag" : 1, "boolTag" : true } }'. MQTT Engine will create a two three folders "test", "data" and "json" followed by a tag/folder structure representing the JSON value of the payload. Image Added

Image Removed


Common Use Cases

Managing Ignition timestamps for MQTT data when using custom namespaces

...

How do I managing MQTT messages with changing payload JSON structure at MQTT Engine

Writing back to an Edge device from a custom namespace tag


Additional Resources

...