Publish and Receive MQTT Messages

Send and receive metadata from the pipeline to a MQTT topic at a periodic interval or based on a trigger.

Overview

The Publish and Receive MQTT Messages node allows for sending and receiving metadata from the pipeline to a MQTT topic at a periodic interval or based on a trigger. This integration is useful for applications requiring real-time data exchange and monitoring.

Properties

PropertyDescriptionTypeDefaultRequired
publish_topicMQTT topic to publish to. Use Jinja2 template syntax to customize the topic using metadata.stringnullNo
publish_with_retainIf true, marks all published messages to be retained by MQTT broker.boolfalseNo
trigger_typeWhen to collect metadata. Options: Custom Trigger, Auto Trigger, Interval, Startup, Shutdown.enumauto_triggerYes
triggerSend a MQTT message when this condition evaluates to true. Conditional on trigger_type being custom_trigger.trigger-conditionnullNo
intervalHow frequently to send message. Set to 0 to publish every time metadata is collected.number0Yes
formatMessage Format. Options: JSON (Dynamic keys), JSON (Static keys), Custom Body.enumjsonYes
custom_body_templateUse Jinja2 template syntax to customize the body of the message. Conditional on format being custom_body.text"{}"Yes
subscribe_topicComma separated list of MQTT topics to subscribe to. Use Jinja2 template syntax to customize the topic using metadata. Inserts metadata from topic into node metadata.stringnullNo
sanitize_messagesReplace invalid characters in topic name with underscores so you can use them in trigger conditions.booltrueNo
persist_last_messageIf true, retains latest message in node metadata for each topic.booltrueNo
mqtt_protocolMQTT Protocol. Options: MQTT, MQTT with SSL, MQTT over Websocket, MQTT over Websocket with SSL.enummqttNo
mqtt_hostMQTT Host.stringnullYes
mqtt_portPort number to connect to. Leave blank to use default port based on MQTT Protocol.stringnullNo
usernameUsername.stringnullNo
passwordPassword.stringnullNo
validate_certValidate SSL Certificate?boolfalseNo
lastwill_messageLastwill Message.textnullNo
lastwill_topicUse Jinja2 template syntax to customize the topic using metadata.stringnullNo
debugLog Debug Messages?boolfalseNo

Output Metadata

Metadata PropertyDescription
topicsThe MQTT topics subscribed to or published.
topicThe specific MQTT topic being referenced.
last_messageThe last message received for a topic.
messagesAll messages received for a topic.
topic_deltaIndicates if there has been a change in the topic.
any_topic_deltaTrue if any topic has changed.
all_topic_deltaTrue if all topics have changed.

Example JSON