Skip to content

Cookie preferences

We use cookies for our own analytics, to see how our campaigns perform and, if you allow it, to load content from other services such as the Google site search. We never sell your data. Necessary cookies keep the site working and cannot be switched off. See our Cookie Policy for details and our Privacy Policy for how we handle personal data.

Security, load balancing and remembering your cookie choice.

Show us which pages people read and how they find the site, so we can improve it (Google Analytics).

Show us which of our ad campaigns bring visitors to the site and remember the campaign or partner link you arrived from (Google Ads, partner program). We do not use these cookies to build advertising profiles.

Load the site search from Google when you use it. Google sets its own cookies and shows ads in the search results.

© 2026 The ThingsBoard Authors
Try for free

ThingsBoard Cloud

Choose your data region

Your data stays in the region you choose, for residency and compliance. No credit card required.

Rather run it yourself? Install on your own servers

XMPP

The XMPP Connector collects data from IoT devices over the XMPP protocol and forwards it to ThingsBoard.

To enable this connector, add it to the connectors list in tb_gateway.json — see the General Configuration reference.

The connector reads its settings from a JSON file. Below is a full example:

{
"server": {
"jid": "gateway@localhost",
"password": "password",
"host": "localhost",
"port": 5222,
"use_ssl": false,
"disable_starttls": false,
"force_starttls": true,
"timeout": 10000,
"plugins": [
"xep_0030",
"xep_0323",
"xep_0325"
]
},
"devices": [
{
"jid": "device@localhost/TMP_1101",
"deviceNameExpression": "${serialNumber}",

Configures the gateway’s XMPP account and connection to the XMPP server.

Parameter Default Description
jid gateway@localhost JID (Jabber ID) of the gateway’s XMPP account
password Password for the gateway’s XMPP account
host localhost XMPP server hostname
port 5222 XMPP server port
use_ssl false Use legacy SSL instead of STARTTLS
disable_starttls false Disable TLS entirely for the connection
force_starttls true Abort the connection if the server does not advertise STARTTLS support
timeout 10000 Connection timeout in milliseconds
plugins ["xep_0030","xep_0323","xep_0325"] XMPP extension plugins to register with the client
"server": {
"jid": "gateway@localhost",
"password": "password",
"host": "localhost",
"port": 5222,
"use_ssl": false,
"disable_starttls": false,
"force_starttls": true,
"timeout": 10000,
"plugins": [
"xep_0030",
"xep_0323",
"xep_0325"
]
}

An array of devices the connector is allowed to communicate with. Any device whose JID is not listed here is rejected.

Each entry in the array configures one device and may contain the following subsections: attributeUpdates and serverSideRpc are optional.

Parameter Default Description
jid JID of the device’s XMPP account
deviceNameExpression JSON-path expression to extract the device name from incoming messages
deviceTypeExpression JSON-path expression to determine the device type (profile)
attributes Group addresses mapped to ThingsBoard device attributes (see below)
timeseries Group addresses mapped to ThingsBoard time-series telemetry (see below)

Both attributes and timeseries entries share the same field structure:

Parameter Description
key ThingsBoard attribute or telemetry key name
value JSON-path expression to extract the value from the incoming message
{
"jid": "device@localhost/TMP_1101",
"deviceNameExpression": "${serialNumber}",
"deviceTypeExpression": "default",
"attributes": [
{
"key": "temperature",
"value": "${temp}"
}
],
"timeseries": [
{
"key": "humidity",
"value": "${hum}"
},
{
"key": "combination",
"value": "${temp}:${hum}"
}
]
}

ThingsBoard allows the provisioning of device attributes and fetches some of them from the device application. You can treat this as a remote configuration for devices, enabling them to request shared attributes from ThingsBoard. See user guide for more details.

The “attributeUpdates” configuration allows you to configure the format of the corresponding attribute data that will be sent to the XMPP device.

Parameter Default Description
attributeOnThingsBoard Shared attribute name to subscribe to
valueExpression JSON-path expression used to build the message payload sent to the device
"attributeUpdates": [
{
"attributeOnThingsBoard": "shared",
"valueExpression": "{\"${attributeKey}\":\"${attributeValue}\"}"
}
]

ThingsBoard allows sending RPC commands to the device connected to ThingsBoard directly or via Gateway.

Configuration, provided in this section is used for sending RPC requests from ThingsBoard to the device.

Parameter Default Description
methodRPC RPC method name to bind
withResponse true Send the device’s response back to ThingsBoard
valueExpression JSON-path expression used to build the message payload sent to the device
"serverSideRpc": [
{
"methodRPC": "rpc1",
"withResponse": true,
"valueExpression": "${params}"
}
]