MQTT Publish

The MQTT Publish action sends raw MQTT publishes on the MQTT device's MQTT connection. The MQTT Publish action allows custom data publishing to the MQTT device's MQTT broker.  


Parameter descriptions

Parameter Description
Client Type

Select Static or Dynamic.

Static: Select the MQTT Client

Dynamic: Allows the MQTT Client to be passed to the action during trigger execution.

MQTT Client The MQTT device that represents the MQTT connection to use for this MQTT Publish. The list contains the MQTT devices on this gateway.
Topic Name The MQTT topic to use. This is a required field of type String.

The topic name can be a user defined topic or a topic that is specified by the MQTT broker.

The command can use the substitution string feature indicated by using $(string). The substitution variables entered in this parameter are then defined in the corresponding parameters in the Input tab.

Quality of Service (QoS) Quality of service that is used to send the publish. Default is set to 0.
  1. QoS 0: The defined behavior for QoS 0 is that an acknowledge for the publish is not required for a successful action.
  2. QoS 1: The defined behavior for QoS 1 is that an acknowledge for the publish is returned from the server for the action to be successful. In the case of a failure, the MQTT connection will be disconnected and the MQTT device will be disabled.
  3. QoS 2: The defined behavior for QoS 2 is that an acknowledge for the publish is returned from the server. The trigger then sends a message to the server to release the message for publishing. The server will acknowledge that request. All these steps must be performed for the action to be successful.
Payload Type Type of payload to send, either String or Binary. The default is String.
Payload The payload or content of the publish to send. This field is only enabled when the Payload Type is set to String. This field is required when the payload Type is set to String and defaults to $(payload).

This field can use the substitution string feature indicated by using $(payload). The substitution variables entered in this parameter are then defined in the corresponding parameters in the Inputtab. If the substitution string feature is not used, this field is simply treated as a String field and the substitution parameter in the input tab is disabled.

Retained Message When set to true, the broker stores the last retained message and the corresponding QoS for that topic. Each client that subscribes to a topic pattern that matches the topic of the retained message receives the retained message immediately after they subscribe. The broker stores only one retained message per topic.

Input tab

Input Description
Topic The value for the substitution variables entered for the Topic Name parameter. You can define them to reference any started device, constant, trigger macro, trigger local variable, trigger static variable, or event variable available from the pull down list displayed for the Value cell for that row.
Payload When the Payload Type is set to String, this field can be used to set the value for the substitution variables entered for the Payload parameter. You can define them to reference any started device, constant, trigger macro, trigger local variable, trigger static variable, or event variable available from the pull down list displayed for the Valuecell for that row. When the substitution string feature is not used in the Payload parameter, this field is disabled.

When the Payload Type is set to Binary, this field is a required field to set the binary content of the payload to send.

Related Topics Link IconRelated Topics