Importing Alarm Configuration for MQTT Engine Tags

Hello,

We are currently publishing data from AWS Greengrass (AWS IoT) and receiving it in Ignition through MQTT Distributor and MQTT Engine (Cirrus Link).

We have configured alarms on MQTT tags in Ignition. Please refer to the attached screenshot for reference.

Our requirement is to import alarm configuration for MQTT tags programmatically.

What We Tried

We used the system.tag.exportTags() function to export the tag configuration.

filePath = "C:\\Users\\Ckotadiya\\Downloads\\mqtttags1.json
tagPaths = "[MQTT Engine]Mimics/iotdata/RTN/W-RTN1-CM1-F-PV-NRTN total feed1/value"

system.tag.exportTags(filePath, tagPaths)

The exported JSON looks like this:

{
"alarms": [
{
"Mobno": "9762475626, 9553062578",
"activePipeline": "Dashboard/SMS_Notification",
"mode": "AboveValue",
"name": "TotalFeed",
"setpointA": 71.0
}
],
"dataType": "Float8",
"enabled": true,
"name": "value",
"readOnly": true,
"tagType": "AtomicTag",
"value": 71.37339782714844
}

Import Attempt

We then attempted to import this configuration using system.tag.importTags():

filePath = "C:\Users\Ckotadiya\Downloads\mqtttags1.json"
basePath = "[MQTT Engine]Mimics/iotdata/RTN/W-RTN1-CM1-F-PV-NRTN total feed1/value"

system.tag.importTags(filePath, basePath, "o")

However, we are receiving the following error:

[Bad_Unsupported]

Is it possible to import alarm configurations to MQTT tags, or is there a recommended approach for managing these configurations at scale?

Any guidance or best practices would be greatly appreciated.

Thanks,
Chirag

Have you tried system.tag.configure()?

2 Likes

Thank you for the suggestion.

Our requirement is specifically about importing tag with alarm configurations.

Currently, our team has already configured alarms on several MQTT tags manually. However, we would like to understand how we can import or restore these alarm configurations programmatically, especially for MQTT Engine tags.

The reason for this requirement is related to future maintenance and recovery scenarios. For example, if a folder structure or a group of MQTT tags is accidentally deleted, we would like to restore the tags along with their alarm configurations using an import function, instead of configuring alarms manually again for a large number of tags.

Therefore, we are looking for guidance on:

  • How to import MQTT tags along with their alarm configurations.

  • Or if there is any recommended method or best practice to back up and restore alarm configurations for MQTT tags.

Any clarification or recommended approach would be greatly appreciated.

Thank you.

Instead of using AI to answer volunteers that are spending time to help you, maybe you should try reading the documentation that was linked and understand how that might help your situation.

MQTT tags are automatically generated based on the topic publishing, so you cannot create new tags.

we are not creating new tags over here, but we are facing one issue if suppose we made alarms for 100 different MQTT Tags and due to some unfortunate situation, we need to delete the MQTT Tags folder which consist of those 100 tags then all the alarm configurations will be lost.

Now, what we Thought is Exporting the MQTT Tags and Importing it again just to try if we can restore alarm configurations on the same tags, can there be a solution other than import and Export as we were not able to successfully restore the alarm configurations using this method.

Normally you wouldn't create alarms on the MQTT tag provider itself. Create derived tags that sit in a conventional tag provider that store the persistent alarms and other configuration, then these tags will just be Bad Quality if the respective linked tag in the MQTT tag provider is not present.
Building on top of this, you can make UDTs filled with derived tags that template the structures in the MQTT topics and take a single topic parameter to automatically configure themselves.

In the case that you refuse to follow that advice, system.tag.configure can be used to set the configuration of existing tags. That's why I linked it. Process your exported tags, grab the configurations and apply them if the target MQTT tag exists with a script.

3 Likes