Configure the Properties on the MQTT Tab
The Forms of MQTT JSON Schema A Device items include an MQTT tab. Use the fields on the tab to configure these properties:
- In Service—Use to specify whether the Device item is active or inactive (see Placing an Item In Service).
You use the Disable Device pick action to take a Device item out of service. When a Device item is taken out of service, its dependents (such as database points) also become inactive (although their configuration remains unchanged).
When the Device item is In Service, Geo SCADA Expert subscribes to the specified topic for which that device publishes data, and receives the messages that the device publishes for that topic. This occurs providing that both the Broker and Device database items are In Service and have valid, saved, configuration, and Geo SCADA Expert is able to connect successfully to the broker.
When a Device item is not In Service, Geo SCADA Expert unsubscribes from the topic, and so no longer receives messages relating to that topic.
- Confirm Disable/Enable—Users with the required permissions can disable a Device item that is In Service, or enable a Device item that is not In Service. Such actions are carried out using the Disable Device and Enable Device pick actions.
Use the Confirm Disable/Enable combo box to specify whether a confirmation dialog box is displayed whenever an operator requests that this Device item is disabled or enabled (see Requesting Confirmation of Action Requests).
- Broker—Specify the MQTT Broker item with which this Device item is associated. Use the browse button to display a Reference browse window and then select the required entry from the window.
The MQTT Broker item represents the broker to which the device publishes the MQTT topics to which Geo SCADA Expert has subscribed.
- Topic Filter—Specify the name of the topic for which the device publishes data. The topic is context-sensitive.
Each Topic Filter that is associated with a given Broker database item has to be unique.
Use a wildcard in the topic name:
You can optionally include a wildcard in the topic name. A wildcard is a special character that you can use to represent one or more other characters. MQTT supports these types of wildcard:
+ The single-level wildcard
(which represents the content in a single level of the MQTT topic)# The multi-level wildcard
(which represents the content in one or more levels of the MQTT topic, from that wildcard onwards)
The levels in an MQTT topic are separated by a forward slash /.
Points/analog/tag1
The above topic name has 3 levels.
You can specify the topic name in various ways, including any of the following:
Using plain text:
Points/analog/tag1
Using the + single-level wildcard:
Points/analog/+
This will match received messages such as:
Points/analog/tag1
Points/analog/tag2
Using the # multi-level wildcard:
Points/#
This will match received messages such as:
Points/analog/tag1
Points/analog/tag2
Points/digital/tag1
Take care to avoid configuring two or more Devices with different Topic Filters that inadvertently end up matching the same received MQTT Topic. This could occur if each of those Devices has a Point that has the same Tag Name. If that tag name is present in a received message, this could result in that single received message unintentionally updating each of those Points with the same data.
One Device references TopicOne. It does this by having the following string in its Topic Filter field:
Points/analog/+
Another Device references TopicTwo. It does this by having the following string in its Topic Filter field:
Points/#
Both Devices include a Point that has the same Tag Name.
A message that includes that Tag Name is received with the following MQTT Topic:
Points/analog/tag1
The Topic matches both of the above Topic Filter fields, so the points with that Tag Name on both Devices are updated (even though each Device is intended to reference a different Topic).
When using wildcards, ensure that you conform to these rules:
In the tables below:
✓ = Acceptable use of a wildcard
✘ = Not an acceptable use of a wildcard
You cannot use a wildcard to match the $ character in an MQTT topic that begins with an $ character (such as the topic
$SYS/Points
).Topic Filter Whether Acceptable #
✘ +/Points
✘ $SYS/+
✓ A wildcard has to be the only character in its level in the MQTT topic name.
Topic Filter Whether Acceptable Points/#
✓ Points/analog/+
✓ Points#
✘ Points/analog/tag+
✘ A Topic Filter can only contain one multi-level wildcard (#).
Topic Filter Whether Acceptable +/analog/+
✓ +/analog/#
✓ Points/#/analog/#
✘ The multi-level wildcard (#) has to be the last level in a Topic Filter.
Topic Filter Whether Acceptable Points/analog/#
✓ Points/+/tag1
✓ Points/#/tag1
✘
- Reported time offset from UTC—If required, populate this field with a suitable value, to enable Geo SCADA Expert to adjust the timestamp that the publishing device sends in messages, to convert that timestamp into UTC.