MQTT

Connection Settings

Client ID

The ID to send to identify the connection with the broker. Leave blank to make this random. MQTT brokers require each client to have a unique ID and will disconnect clients with duplicate IDs

Username and Password

The username and password required by the MQTT broker.

Connection Timeout

Maximum time to wait for a connection to respond. Valid range is 1–300 seconds.

Keep Alive

Maximum time to wait without sending a request to the broker. Valid range is 10–43200 seconds.

Use SSL

Enable for MQTT brokers that require transport layer security.

Ignore Self-Signed Certificate: When enabled, any certificate returned from the broker will be accepted. This setting should only be used for testing connectivity.

CA Certificate: The name of the certificate file (e.g., groupCA.pem) imported into the certificate store.

Client Certificate: Used if the broker requires client authentication. This is the public certificate for the client (e.g., mycert.pem).

Client Key: Used if the broker requires client authentication. This is the private key for the client (e.g., Mycert.key.pem).

Input Discovery Topic

The topic the connection listens on to auto-discover topics. When left blank, auto-discovery is disabled. When enabled, the connection subscribes on startup to the topic and the Browse Input feature shows all topics that have published data.

Clean Session

When enabled, the connection to the MQTT broker is not persisted. This means any events sent to a subscribed topic while not connected will not be received. When disabled, the connection to the MQTT broker is persisted using the provided Client ID. To use this correctly, make sure the Client ID is unique & QoS for inputs is set to 2. In this mode, events sent to a subscribed topic while the client is disconnected will be received after reconnecting.

Input Settings

Topic

Specifies a string that is used to subscribed to specific MQTT messages.

Include Topic

Specifies if the MQTT topic should be included in the read data. When enabled the reads look as follows, where the payload is inserted under value, and the topic is included at the root.

json
{
	"_topic": "deviceid",
	"value": {
		"deviceid": "press1",
		"other": 10
	}
}

Payload Type

The type of MQTT payload to process.

Type Description
JSON The payload is deserialized as JSON. Non-JSON payloads are ignored.
String (UTF-8) The payload is treated as a String.
Binary The payload is treated as a byte array.

Output Settings

Topic

Specifies a string that is used to publish MQTT messages.

Topics can be static or dynamic. Dynamic topics can include data from the output payload.

To include the source input or instance name, use a # character. As an example. /mytopic/# will convert to /mytopic/modelname or /mytopic/opctagname at runtime.

To include data from the payload, use the following syntax.

/mytopic/{{this.siteid}}

At runtime this takes the assetid attribute of the output payload and includes it in the output topic. One or more dynamic outputs can be defined.

ex. /site1/area2/{{this.assetid}}

When using dynamic outputs, if the output payload does not contain the referenced attribute the output will fail to write.

QoS

Specifies the quality of service associated with publishing the output.

Named Root

Specifies how the instance name should show up in the resulting output value.

When enabled, output values will take the form:

json
"InstanceName" : {
	...
}

When disabled, output values will take the form:

json
{
"_name" : "InstanceName"
	...
}

Retain

Specifies whether the MQTT Broker should cache the last value sent.

Breakup Arrays

When true, if the data being sent out is an array type (e.g., an array of SQL rows), this option will send out each element of the array individually. Otherwise the entire array is sent in one publish.

This is useful when used in conjunction with dynamic topics. Each element of the array can be published on a unique topic given data in the payload.

Template

If blank, the default JSON output format is used. Otherwise, the format of the output can be modified using this Apache Freemarker template engine.

AWS IoT Core

When using SSL, specifically with AWS IoT Core, AWS IoT Greengrass, or any broker that has a self-signed certificate, you will need to import the certificate into the HighByte Intelligence Hub certificate store. See the “Managing Certificates” section on how to import the certificates. You will need to import the self-signed CA certificate. You may also need to add the Client Certificate (as a certificate) and Client Key (as a key) if the broker is using certificate-based authentication.