MQTT.PUBLISH
Publishes either a message or an arbitrary value using a specified Producer and topic. To reference a message from the outbox use the outbox function and to reference a message from the inbox use INBOX. You can use the Function Wizard for this function.
Syntax
=MQTT.PUBLISH(Producer, MessageOrValue, Topic, [QoS], [User Properties])
Arguments
Name | Description |
---|---|
Producer | Producer to use for publishing. |
MessageOrValue | Either an existing message from the outbox or a value to publish. |
Topic | Topic that is appended to the base topic defined in the Connector. |
QoS (optional) | Quality of Service. This option defines the reliability of the publish operation. It depends on the used protocol. |
User Properties (optional) | Define Metadata. |
Return
TRUE, if no error.
Examples
All examples assume a base topic with the value "/cedalo" in the connector.
Formula | Result | Comment |
---|---|---|
| TRUE | This publishes a JSON object created by the json function using the "MQTT Producer" and topic "cedalo/test" |
| TRUE | This publishes the string value "Message" using the "MQTT Producer" under the topic "cedalo/test" |
| TRUE | This publishes the outbox message with id "Message" using the "MQTT Producer" and topic "cedalo/test" |