MQTT Subscribe (TLS-Beta)
This function block connects to an MQTT broker and listens for messages on a chosen topic using TLS (secure) connection options. It receives incoming text payloads and signals when new data has arrived so you can process or forward the data in your scenario.
π₯ Inputs
Enable This boolean input socket controls whether the subscription is active. Set to TRUE to allow receiving messages; FALSE disables processing.
π€ Outputs
Data Text payload of the most recently received message.
New Data Boolean flag that becomes TRUE for a single evaluation when a new message has been received.
πΉοΈ Controls
Server / Broker Enter the MQTT broker address or hostname.
Port Set the broker port (common TLS port is 8883).
Topic Specify the topic to subscribe to. Incoming messages on this topic appear on the Data output.
Client ID Optional identifier for this client on the broker.
Username Optional username for broker authentication.
Password Optional password for broker authentication.
Use TLS Toggle to enable secure (TLS) connection mode.
CA Certificate Option to provide or reference a CA bundle for TLS certificate verification (the block supports system CA verification).
Connect A control to initiate or re-establish the connection with the current settings.
Auto Reconnect Toggle to automatically reconnect if the connection is lost.
Note: If the block provides a compact UI, some advanced options may be grouped or under an "Advanced" section.
π― Features
Secure MQTT subscription with TLS support for encrypted communication.
Live flagging of new messages via the
New Dataoutput so you can trigger downstream processing only when necessary.Flexible topic selection to subscribe to any valid MQTT topic.
Connection parameters and basic authentication controls for most broker configurations.
Graceful reconnect handling so temporary network glitches do not require manual intervention.
π Usage Instructions
Configure your broker details using the
Server / Broker,Port, and authentication controls if needed.Enter the topic you want to listen to in the
Topiccontrol.Enable the block by sending TRUE to the
Enableinput or using the blockβs UI connect control.Read incoming text payloads from the
Dataoutput. Use theNew Dataoutput to trigger downstream blocks only when a fresh message arrives.If you change connection parameters, use the
Connectcontrol (or toggleEnable) to apply them.
π Evaluation
When active, this function block maintains a subscription to the configured topic. On each run it outputs the latest received payload on Data and sets New Data TRUE only when a new message has arrived since the last evaluation.
π‘ Tips and Tricks
Use
Parse Data DictionaryorData to JSONafterMQTT Subscribe (TLS-Beta)to convert incoming JSON text into structured values for further processing.If you want to log incoming messages, connect
DatatoCSV ExportorData to JSONthen to an export block.Combine with
Debug Inputto print or inspect messages during setup.Use
Logic InputorRising Edgeto trigger actions only whenNew Databecomes TRUE.For distributed scenarios, pair this block with
Data Write Global/Data Read Globalto share the latest message across separate branches of your scenario.If the message contains image references or encoded image data, send the decoded image to
Show Imageto preview it.When publishing responses or acknowledgements, use the corresponding
MQTT Publish (TLS-Beta)block to send messages back to the broker.
π οΈ Troubleshooting
Connection fails: Verify
Server / Broker,Port, and network access. Ensure TLS port and firewall rules are correct.Authentication errors: Re-check
UsernameandPasswordentries, and confirm broker ACLs.No messages appearing: Confirm the exact
Topicstring (wildcards and hierarchy matter) and that another client is publishing to it. Use a simple tester client to confirm.Unexpected message format: Use
Parse Data DictionaryorString Operationsto inspect and normalize payloads.TLS issues: If certificate verification fails, ensure the CA certificate bundle is available or use the system CA option. For troubleshooting only, try a non-TLS connection (if broker allows) to isolate the cause.
Last updated
Was this helpful?