MQTT Client

Set up connection to external MQTT broker

The MQTT client can be used to establish a connection to an external MQTT server (broker) or one that is available in the site network.

If data point values are to be exchanged across sites in relation to the HOOC solution, an MQTT client of site A can use Secure Proxy Permalink to establish a connection to the Remote Control service of site B and thus exchange data point values via the API provided.

Property Description
Protocol type Select MQTT Client
Name Enter the name of the device
Description Enter the description of the device
IP address / host IP address / host of the MQTT broker
Port Default port 1883
TLS connection The connection to the MQTT broker is encrypted
MQTT Client ID Specifiy the Client ID of the device
Username Authentication information (optional)
Password Authentication information (optional)
Topic prefix ‘READ’ Choose this option in order to read data (optional)
Topic prefix ‘WRITE’ Choose this option in order to write data (optional)
Connection monitoring If this field is checked, all data points will not be marked as invalid in case of an interruption of the connection (last known value). For the connection monitoring to work, it is mandatory to specify the MQTT Client ID.
Validity period Please note that if no value update is received during the predefined Intervall, the corresponding data point will be marked as invalid (Last known value).

Actions

The setup of a MQTT device allows a number of possible actions.

Action Description
Edit interface settings
Export data points (if data points available)
Import Datenpunkte (if no data points available)
Remove interface (if no data points available)

Data points

The live values of the acquired data points are automatically displayed. By clicking on the icon, you can stop the data monitor.

By clicking on the icon, a new data point will be created for the corresponding interface.

Property Description
Interface / Device Select the device / interface
Topic ‘read’ (optional) Optionally, enter the enlarged topic for data reading (the enlarged topic is the addition to the prefix already entered under Change settings / topic “read”)
Decoder Select and enter settings for the data decoder
Topic ‘schreiben’ (optional) Optionally, enter the enlarged topic for data writing (the enlarged topic is the addition to the prefix already entered under Change settings / topic “write”)
Encoder Select and enter the settings for the data encoder
Data point Enter the name of the data point
Description Enter a description of the data point
Data type Select a data type
Conversion If required, values can be linearized, e.g. temperature in tenths to °C with one decimal place
Unit Units in LaTeX format: e.g. ^\circ C for °C

Custom encoder and custom decoder

In order to encode or decode data, select accordingly ‘encoder’ or ‘decoder’. The templates of the functions (Javascript) are displayed in the editor. More information about the parameters and return values can be found in the table below:

Property Decoder Encoder Description
Parameter raw x Byte array of raw data
Parameter value x Data point value in the corresponding format (number, bool, string)
Parameter dataType x x Used data type of the data point (one of the following strings: “Int8”, “Int16”, “Int32”, “UInt8”, “UInt16”, “UInt32”, “Float32”, “Float64”, “Bool”, “String”)
Return value Decoder x Return value based on used data type (number, bool, string)
Return value Encoder x Byte array

In order to analyze data and implement custom encoders and custom decoders, it is recommended to activate the MQTT debug mode. (use near to Interfaces/Devices).

Actions

The setup of a data point allows a number of actions.

services-serc-datapoint-actions-mqtt

Action Description
Edit data point settings
Edit Smart UI settings
Show data point trend
Write value of the data point (if writable)
Duplicate data point
Remove data point