MQTT Collection Client
Purpose
The MQTT Collection Client subscribes to broker topics and maps JSON or raw payload values to gateway variables.
Open the plugin
Open Development Configuration → Collection Configuration, create a device, and select MQTT Collection Client.
This plugin manages its broker connection in device properties and does not use an ordinary TCP, UDP, or serial channel. Configure common variable fields through Collection Configuration.
Plugin properties
Connection
| Setting | Description |
|---|---|
| Connection type | Default Tcp. Select TCP or WebSocket according to the broker endpoint. |
| IP address | Default localhost. MQTT broker host name or IP address. |
| Port | Default 1883. Use the broker's TLS or WebSocket port when applicable. |
| WebSocket path | Default /mqtt. Used only for WebSocket connections. |
| Client ID | Client identifier. It must be unique on the broker. |
| Clean session | Default enabled. Controls whether the broker removes the previous session state. |
| MQTT version | Default 4 (MQTT 3.1.1). Select the version required by the broker. |
Connection type options are Tcp and WebSocket. MQTT version options are V310 (MQTT 3.1), V311 (MQTT 3.1.1), and V500 (MQTT 5.0). For WebSocket, the effective URL is ws://IP:port/path, or wss:// when SSL is enabled.
TLS and authentication
| Setting | Description |
|---|---|
| Enable SSL | Enables TLS for the broker connection. |
| SSL target host | Host name used for certificate validation. |
| Client certificate | Client certificate configured in Certificate Management. |
| CA certificate | CA certificate used to validate the broker. |
| Allow untrusted certificate | Temporary commissioning option for self-signed certificates. Disable it in production. |
| SSL protocol | Select a TLS protocol only when required by the broker or security policy. |
| Check certificate revocation | Enables certificate revocation checks. |
| Username / password | Broker credentials. Do not expose the password in screenshots or logs. |
Disable Allow untrusted certificate in production and configure the target host name and CA. Select a client certificate for mutual TLS. When Username is non-empty, the broker credentials must match the configured username and password exactly.
Runtime and messages
| Setting | Description |
|---|---|
| Keep-alive | Default 60 seconds. The broker and network policy must allow this interval. |
| Connection timeout | Default 3000 ms. Maximum wait for establishing the broker connection. |
| QoS | Default 0. QoS used for subscriptions and publishes. |
QoS options are 0 (at most once), 1 (at least once), and 2 (exactly once). The selected level is used for subscriptions and plugin control publishes.
| Detailed log | Enables detailed connection, payload, and message logs during commissioning. Disable it after troubleshooting. |
| Check and cleanup interval | Default 60000 ms. Interval used to clean connection or request state. |
Address rule
The variable address is a semicolon-separated mapping:
{subscribeTopic};{jsonPath1||jsonPath2};{condition};{publishTopic};{Json|RawString};{retain};{rpcResponseTopic};{rpcTimeoutMs}
Examples:
| Use | Address |
|---|---|
| Read a JSON value | vendor/device;$.data.temperature;TelemetryCondition |
| Publish a raw write | ;;;factory/a/reboot;RawString;false |
| RPC request and response | ;;;factory/a/command/{RequestId};Json;false;factory/a/response/{RequestId};5000 |
Payload paths support $, dot paths such as items.0.value, filters [?()], wildcards [*] and .*, and recursive search $..name. With ||, the first existing candidate path is used. Exact case-sensitive property names are preferred; a unique case-insensitive match is used only when no exact name exists.
The condition is a DataTrans script name. Its raw input contains the complete JSON payload; it may also declare Topic or MqttTopic to inspect the published topic. A wildcard subscription updates the same variable for every matching message, so use an exact topic or filter by Topic when values must be separated by device.
The subscribed message does not include the publisher's client ID. ClientId and MqttClientId inputs are therefore empty for this plugin. Publish topics cannot contain + or #; {RequestId} must be the final topic level.
The address has at most eight segments. A subscribe topic and JSONPath must be provided together; publish options require a publish topic. RPC response topic and timeout are a pair, and the timeout must be 100–60000 ms. A read-only variable cannot contain publish fields, a write-only variable cannot contain telemetry fields, and every variable must configure at least one route.
Functions
| Function | Purpose |
|---|---|
| Publish message | Use Publish message with an approved test point and confirm site safety before execution. |
| Subscription management | Create, refresh, or remove subscriptions and inspect the received updates. |
| Refresh subscriptions | Reload the subscriptions confirmed by the current MQTT session. |
Device debug
Open Development Configuration → Collection Configuration, select the MQTT device, and click More Functions, then open Debug.
MQTT client protocol panel

Use the panel to connect, subscribe, publish a test message, or inspect the result. Start with a safe test topic and a small payload.
Verify the configuration
- Subscribe to an exact test topic.
- Publish a JSON payload containing one known field.
- Confirm that the JSONPath or condition script selects the expected value.
- Check that the variable value and collection time update.
- Test publishing or RPC only when the variable and device permissions allow it.
Troubleshooting
| Symptom | Check |
|---|---|
| Cannot connect | Broker address, port, Client ID, credentials, TLS settings, firewall, and broker ACL. |
| Message arrives but variable is unchanged | Exact topic, JSONPath, condition script, payload shape, and variable data type. |
| Wrong device value is updated | Avoid a shared wildcard topic or filter by Topic in the condition script. |
| Publish or RPC fails | Publish topic, {RequestId} position, QoS, response topic, timeout, and permissions. |
| Certificate is rejected | Client certificate, CA, target host name, and trust settings. |
Related links
- Collection Configuration: Devices, variables, common permissions, and import.
- Certificate Management: Manage MQTT client and CA certificates.
- Plugin Manual Index: Other collection and data-forwarding plugins.