The following basic operations are available for the MQTT Engine Module and can be executed within any of the available Ignition scopes using the format system.cirruslink.engine.operation
where:
Configuration changes made through scripting do have the same validation as when made through the UI. For example, attempting to delete a Sets configuring that is being referenced by a Servers configuration will result in no action being performed. |
The following extended operations are available for the MQTT Engine Module and can be executed within any of the available Ignition scopes using the format system.cirruslink.engine.operation
where:
| enabled | boolean | Whether or not the configuration resource is enabled |
| name | string | The unique name for the configuration resource |
| enableEngine | boolean | Whether to enable MQTT Engine |
| blockNodeCommands | boolean | Block outbound Edge Node Tag writes |
| blockDeviceCommands | boolean | Block outbound Device Tag writes |
| includeSecurityContext | boolean | Whether or not to include the Security Context in write commands to be validated at the Edge Node |
| securityContextHashingAlgorithm | string | The hashing algorithm to use when encrypting the Security Context |
| securiyContextHashingPassword | string | The hashing password to use when encrypting the Security Context |
| blockTagPropertyChanges | boolean | Block incoming Tag property changes |
| storeHistoricalEvents | boolean | Enable the writing of historical change events directly to the History provider instead of updating the Tag value |
| reorderingTimeout | long | Sets the Sparkplug Reordering Timeout in milliseconds |
| enableLatching | boolean | Enable latching on tags to synchronize MQTT Engine tag updates with events in Ignition projects |
| latchTimeout | long | The amount of time to wait for the latch to be released by the Ignition project component in milliseconds before timing out |
| latchTagList | string | A semicolon separated list of comma separated trigger tag/latch tag pairs |
| filteredProperties | string | A semicolon delimited list of Tag properties to filter/ignore on received Tags |
| enableBdSeqChecking | boolean | Enables/disables BIRTH/DEATH sequence number validation as required by the Sparkplug specification |
| metricTimestampValidation | boolean | Enables/disables validation of metric timestamps against the current tag value timestamp before writing |
| customProperties | string | Custom properties to provide to MQTT Engine |
| primaryHostControlTagList | string | A semicolon separated list of comma separated Primary Host control tag triples |
| rebirthDebounceDelay | long | The amount of time to delay in milliseconds before another Sparkplug Rebirth request can be sent to an Edge Node |
| useCirrusEncoder | boolean | Whether to use the Cirrus Link Encoder which will use special encoding for non-Sparkplug supported PropertyDataTypes |
| sparkplugMessageHandlerThreadCount | integer | The Sparkplug message handler thread count |
| enableAlarmEventPublishing | boolean | Whether or not to support alarm events via MQTT |
| alarmDisplayPathType | string | The format to use for the Alarm Display Path |
| h2dbDirectory | string | Directory to store the H2 Database in |
| h2dbPort | integer | TCP Port to connect to H2 Database |
| enabled | boolean | Whether or not the configuration resource is enabled |
| name | string | The unique name for the configuration resource |
| url | string | The URL of this MQTT Server |
| serverSet | string | The Server Set this MQTT Server is associated with |
| username | string | The username for this MQTT connection |
| password | string | The password for this MQTT connection |
| caCertFile | string | CA certificate file |
| clientCertFile | string | Client certificate file |
| clientPrivateKeyFile | string | Client Private Key file |
| clientKeyPassword | string | Client Private Key password |
| hostnameVerification | boolean | Enable/Disable TLS Hostname Verification |
| tlsAlpnExtensions | string | The TLS ALPN Extensions for this connection |
| clientId | string | The MQTT Client ID for this MQTT connection |
| cleanSession | boolean | Whether or not this is a Clean MQTT Session |
| keepAlive | integer | The MQTT Client keep alive |
| filteredNamespaces | string | Comma separated list of namespaces to be disabled |
| includesparkplugDataTypes | boolean | Include Sparkplug DataType fields in DATA messages |
| enableLegacyStateMessages | boolean | Whether to support legacy (Sparkplug v2) Host State Messages |
| enablePrimaryHostSubscriptions | boolean | Whether to enable primary host subscriptions |
| legacyStateUsername | string | (Legacy) The username for this MQTT connection |
| legacyStatePassword | string | (Legacy) The password for this MQTT connection |
| legactClientId | string | (Legacy) The MQTT Client ID for this MQTT connection |
| legacyStateCaCertFile | string | (Legacy) CA certificate file |
| legacyStateClientCertFile | string | (Legacy) Client certificate file |
| legacyStateClientPrivateKeyFile | string | (Legacy) Client Private Key file |
| legacyStateClientKeyPassword | string | (Legacy) Client Private Key password |
| legacyStateHostnameVerification | boolean | (Legacy) Enable/Disable TLS Hostname Verification |
| legacyStateTlsAlpnExtensions | string | (Legacy) The TLS ALPN Extensions for this connection |
| enabled | boolean | Whether or not the configuration resource is enabled |
| name | string | The unique name for the configuration resource |
| primaryHostEnabled | boolean | Whether Primary Host ID is enabled |
| primaryHostId | string | The Primary Host ID |
| enabled | boolean | Whether or not the configuration resource is enabled |
| name | string | The unique name for the configuration resource |
| fileContents | string | The file contents |
| fileName | string | The filename |
| fileDescription | string | The file description |
| enabled | boolean | Whether or not the configuration resource is enabled |
| name | string | The unique name for the configuration resource |
| ignoreFiles | boolean | Whether all published files will be ignored |
| fileHostType | string | Defines if file host sends message ACKs - 'Active' or 'Passive' |
| baseFileDirectory | string | The directory to store files in when using the 'Store' file policy |
| addTopicTokens | boolean | Whether to add Group, EdgeNode, and Device IDs to the base file directory |
| fileStoringPolicy | string | The policy for storing incoming files - 'Overwrite Existing File' or 'Keep Existing File' |
| basicFileAttriburesPolicy | string | The policy for handling basic attributes - 'Ignore', 'Append To Filename', 'Update File Attributes', Append And Update' |
| enabled | boolean | Whether or not the configuration resource is enabled |
| name | string | The unique name for the configuration resource |
| subscription | string | Comma separated list of topics the the MQTT server will subscribe on |
| qos1 | boolean | Use QoS1 for all subscriptions |
| rootFolder | string | The root folder where all tags will be located |
| tagName | string | The name of the tag |
| jsonPayload | boolean | Parse the payload as a JSON string |
| charset | string | The encoding format to use for Strings when not parsing as JSON |
| writeableTags | boolean | Makes created tags Writable |
| numbersAsFloats | boolean | Treat all numbers as decimal numbers when creating tags |
| enabled | boolean | Whether or not the configuration resource is enabled |
| name | string | The unique name for the configuration resource |
| namespace | string | The Namespace this resource is associated with |
| serverSet | string | The Server Set this resource is associated with |
| enabled | boolean | Whether or not the configuration resource is enabled |
| name | string | The unique name for the configuration resource |
| defaultNamespace | string | Default Namespace reference |
| orderIndex | integer | The order index which specifies the order in which to execute the replacement |
| source | string | The source string or regular expression (regex) in the MQTT topic or payload to be replaced |
| replacement | string | The replacement string that will be used to replace the source string in Ignition tags |
| regex | boolean | Whether the source string is a regular expression |
| enabled | boolean | Whether or not the configuration resource is enabled |
| name | string | The unique name for the configuration resource |
| subscription | string | Comma separated list of topics the the MQTT server will subscribe on |
| qos1 | boolean | Use QoS1 for all subscriptions |
| rootFolder | string | The root folder where all tags will be located |
| tagName | string | The name of the tag |
| jsonPayload | boolean | Parse the payload as a JSON string |
| charset | string | The encoding format to use for Strings when not parsing as JSON |
| writeableTags | boolean | Makes created tags Writable |
| numbersAsFloats | boolean | Treat all numbers as decimal numbers when creating tags |
| enabled | boolean | Whether or not the configuration resource is enabled |
| name | string | The unique name for the configuration resource |
| defaultNamespace | string | Default Namespace reference |
| orderIndex | integer | The order index which specifies the order in which to execute the replacement |
| source | string | The source string or regular expression (regex) in the MQTT topic or payload to be replaced |
| replacement | string | The replacement string that will be used to replace the source string in Ignition tags |
| regex | boolean | Whether the source string is a regular expression |
| enabled | boolean | Whether or not the configuration resource is enabled |
| name | string | The unique name for the configuration resource |
| namespace | string | Namespace reference |
| groupID | string | A Group ID to include in the subscription list |
| edgeNodeId | string | An Edge Node ID to include in the subscription list |
| serverList | string | A comma separated list of MQTT Server names to apply to the the filter to |
| Cirrus Link provides these scripts as examples only, they are not supported or guaranteed to meet any particular functionality. Cirrus Link cannot provide any assistance to modify these scripts to meet a particular need. |
# Cirrus Link provides these scripts as examples only, they are not supported or guaranteed to meet any particular functionality. Cirrus Link cannot provide any assistance to modify these scripts to meet a particular need.
# Create new server set
serverProps = {}
serverProps["name"] = "Server Set 1"
serverProps["description"] = ""
serverProps["primaryHostEnabled"] = True
serverProps["primaryHostId"] = "MyPrimaryHost"
system.cirruslink.engine.createConfig("Sets", serverProps)
# Delete server
system.cirruslink.engine.deleteConfig("Servers", name)
# Read alarms
system.cirruslink.engine.readAlarms()
# Example list returned for 4 alarms
[{59ff123d-62af-4272-83c8-cbc444891982={"id":"59ff123d-62af-4272-83c8-cbc444891982","name":"Alarm4","alarmSource":"prot:MQTT:/src:Ignition-pi5:/prov:edge:/tag:Edge Nodes/G1/E1/D1/tag1:/alm:Alarm4","priority":"Critical","activeTime":1731373561034,"groupId":"G1","edgeNodeId":"E1","deviceId":"D1","state":"ActiveUnacked","ackedBy":null}, fa076e0f-bc37-4ce0-a7a3-709d2e2389b2={"id":"fa076e0f-bc37-4ce0-a7a3-709d2e2389b2","name":"Alarm1","alarmSource":"prot:MQTT:/src:Ignition-pi5:/prov:edge:/tag:Edge Nodes/G1/E1/D1/tag1:/alm:Alarm1","priority":"Low","activeTime":1731373531034,"groupId":"G1","edgeNodeId":"E1","deviceId":"D1","state":"ActiveUnacked","ackedBy":null}, 2ac2c263-b552-49fc-a969-98313ca107b6={"id":"2ac2c263-b552-49fc-a969-98313ca107b6","name":"Alarm2","alarmSource":"prot:MQTT:/src:Ignition-pi5:/prov:edge:/tag:Edge Nodes/G1/E1/D1/tag1:/alm:Alarm2","priority":"Medium","activeTime":1731373541033,"groupId":"G1","edgeNodeId":"E1","deviceId":"D1","state":"ActiveUnacked","ackedBy":null}, 74a19264-8672-4e5b-ab9b-420c6aae7877={"id":"74a19264-8672-4e5b-ab9b-420c6aae7877","name":"Alarm3","alarmSource":"prot:MQTT:/src:Ignition-pi5:/prov:edge:/tag:Edge Nodes/G1/E1/D1/tag1:/alm:Alarm3","priority":"High","activeTime":1731373551034,"groupId":"G1","edgeNodeId":"E1","deviceId":"D1","state":"ActiveUnacked","ackedBy":null}}]
# Clear alarm
system.cirruslink.engine.clearAlarm("59ff123d-62af-4272-83c8-cbc444891982") |