MQTT Client

This protocol connects to an MQTT broker and allows you to subscribe to and publish MQTT topics as parameters.

Supported Devices and Prerequisites

The MQTT Client can connect to any MQTT broker that supports plain TCP or SSL/TLS connections.

Optional username/password authentication is supported.

Configuration

Network settings:

  • Host: The hostname or IP address of the MQTT broker.
  • Port: The port number to connect to. The default is 1883 (the standard MQTT port). For SSL/TLS connections the typical port is 8883.
  • Use SSL: Check this option to connect using SSL/TLS encryption.
  • Client ID: The MQTT client identifier sent to the broker. Each client connecting to a broker must use a unique client ID. If left empty, the broker may assign one automatically.
  • User and Password: Fill in values here if your broker requires authentication.

Topics:

  • Subscribed Topics: Enter one topic filter per line. The connection will subscribe to these topics on the broker, and incoming messages will be exposed as readable parameters. Standard MQTT wildcard characters (+ for a single level, # for multiple levels) are supported.
  • Published Topics: Enter one exact topic per line. These topics will be exposed as writable parameters, and writing to them will publish a message to the broker. Wildcard characters are not allowed here.
  • Allow Any Publish: If enabled, BTConnect will publish to any valid MQTT topic that is written to, not just the topics listed under Published Topics. This is useful when the target topic is determined dynamically at runtime via converter rules.

If a topic appears in both Subscribed Topics and Published Topics, the corresponding parameter will be both readable and writable.

The connection will automatically attempt to reconnect to the broker every five seconds if the connection is lost.

Parameters

Each configured topic becomes a string parameter in the parameter tree. The parameter path matches the topic name exactly.

Parameter access depends on where the topic is configured:

  • Topics listed only in Subscribed Topics: read-only — updated when a message is received from the broker.
  • Topics listed only in Published Topics: write-only — writing the parameter publishes a message to the broker.
  • Topics listed in both: read/write.

All parameter values are strings. Incoming message payloads are decoded as UTF-8.


Last modified March 18, 2026