KNX
The KNX Connector connects KNX-based devices to ThingsBoard, letting the gateway read telemetry and attributes from KNX group addresses and send RPC commands to KNX automation systems.
To enable this connector, add it to the connectors list in tb_gateway.json — see the
General Configuration reference.
Connector configuration: knx.json
Section titled “Connector configuration: knx.json”The connector reads its settings from a JSON file. Below is a full example:
{ "logLevel": "INFO", "client": { "type": "AUTOMATIC", "addressFormat": "LONG", "localIp": "127.0.0.1", "localPort": 3671, "autoReconnect": true, "autoReconnectWait": 3, "gatewaysScanner": { "enabled": true, "scanPeriod": 3, "stopOnFound": false } }, "devices": [ { "deviceInfo": { "deviceNameDataType": "string", "deviceNameExpressionSource": "expression", "deviceNameExpression": "Device ${1/0/5}", "deviceProfileDataType": "none", "deviceProfileExpressionSource": "constant", "deviceProfileNameExpression": "default" }, "pollPeriod": 5000, "attributes": [ { "type": "temperature", "key": "temperature", "groupAddress": "1/0/6" } ], "timeseries": [ { "type": "humidity", "key": "humidity", "groupAddress": "1/0/7" } ] } ], "attributeUpdates": [ { "deviceNameFilter": ".*", "dataType": "percent_U8", "groupAddress": "1/0/9", "key": "brightness" } ], "serverSideRpc": [ { "requestType": "read", "deviceNameFilter": ".*", "method": "get_name", "dataType": "string", "groupAddress": "1/0/5" }, { "requestType": "write", "deviceNameFilter": ".*", "method": "set_name", "dataType": "string", "groupAddress": "1/0/5" } ]}Section “client”
Section titled “Section “client””Configures the KNX client responsible for communication with the KNX router.
| Parameter | Default | Description |
|---|---|---|
type | AUTOMATIC | Connection type: AUTOMATIC, ROUTING, TUNNELING, TUNNELING_TCP, or TUNNELING_TCP_SECURE |
addressFormat | LONG | Group address format: SHORT, LONG, or FREE |
localIp | Local IP address or network interface name | |
localPort | Local port number | |
autoReconnect | true | Reconnect automatically if the tunneling connection is lost |
autoReconnectWait | 3 | Seconds to wait before a reconnect attempt |
gatewayIP | IP address or hostname of the KNX/IP tunneling device | |
gatewayPort | 3671 | Port of the KNX/IP tunneling device |
individualAddress | Individual KNX address of the local endpoint | |
rateLimit | 0 | Max outgoing telegrams per second; 0 disables the rate limiter |
multicastGroup | 224.0.23.12 | Multicast group for KNXnet/IP routing |
multicastPort | 3671 | Multicast port for KNXnet/IP routing |
stateUpdater | false | Default state-updating mechanism used by devices |
Address format values:
SHORT— two-part address, e.g.1/34(no middle group)LONG— three-part address, e.g.1/2/34(with middle group)FREE— integer or hex representation
Connection type values:
AUTOMATIC— scans the network using GatewayScanner to find KNX/IP devices automaticallyROUTING— KNX/IP multicast routingTUNNELING— UDP connection to a specific KNX/IP tunneling deviceTUNNELING_TCP— TCP connection to a KNX/IP tunneling v2 deviceTUNNELING_TCP_SECURE— secure TCP connection to a KNX/IP tunneling v2 device
Example:
"client": { "type": "AUTOMATIC", "addressFormat": "LONG", "localIp": "127.0.0.1", "localPort": 3671, "autoReconnect": true, "autoReconnectWait": 3}Subsection “security”
Section titled “Subsection “security””KNX security provides three complementary protection mechanisms:
- KNX IP Secure — encrypts communication between KNX IP devices (routers and interfaces) over IP networks
- KNX Data Secure — encrypts communication at the telegram level, protecting any medium (TP, RF, or IP)
- KNX Secure Tunneling — authenticates and encrypts tunneling sessions between a client and a KNX Secure IP interface
Configure the desired mechanism by adding a security subsection inside client:
Protects data transmitted over Ethernet/IP-based networks to prevent unauthorized access and tampering.
| Parameter | Description |
|---|---|
backbone_key | Backbone key for KNX Secure Routing (hex) |
latency_ms | Latency tolerance in milliseconds for KNX Secure Routing |
"security": { "backbone_key": "secret", "latency_ms": 100}Protects sensitive KNX messages on any medium (TP, RF, or IP).
| Parameter | Description |
|---|---|
knxkeys_file_path | Full path to the .knxkeys file, including the filename |
knxkeys_password | Password to decrypt the .knxkeys file |
"security": { "knxkeys_file_path": "/path/to/knxkeys.knxkeys", "knxkeys_password": "password"}Provides authentication and encryption for secure tunneling sessions.
| Parameter | Description |
|---|---|
backbone_key | Backbone key for KNX Secure Routing (hex) |
latency_ms | Latency tolerance in milliseconds |
user_id | User identifier for the secure tunnel session |
device_authentication_password | Authentication password for the tunneling device |
user_password | User password |
"security": { "backbone_key": "secret", "latency_ms": 100, "user_id": "user", "device_authentication_password": "password", "user_password": "password"}Subsection “gatewaysScanner”
Section titled “Subsection “gatewaysScanner””Scans the local network for KNX routers — useful when the router IP address is not known in advance. Detected IP addresses are printed to the gateway log.
| Parameter | Default | Description |
|---|---|---|
enabled | true | Enable or disable the scanner |
scanPeriod | 3 | Scan interval in seconds |
stopOnFound | false | Stop scanning after the first KNX router is found |
"gatewaysScanner": { "enabled": true, "scanPeriod": 3, "stopOnFound": false}Example log output when a gateway is discovered:
Found KNX gateway:- Calimero test network 1.1.0 192.168.1.160:3671 Tunneling: TCP Routing: YesSection “devices”
Section titled “Section “devices””Configures polling and data mapping for each KNX device. Each entry in the array defines:
| Field | Description |
|---|---|
deviceInfo | Device name and profile to create in ThingsBoard |
pollPeriod | Poll interval in milliseconds |
attributes | Group addresses mapped to device attributes |
timeseries | Group addresses mapped to time-series telemetry |
"devices": [ { "deviceInfo": { ... }, "pollPeriod": 5000, "attributes": [ ... ], "timeseries": [ ... ] }]Subsection “deviceInfo”
Section titled “Subsection “deviceInfo””Sets the device name and profile that will be created in ThingsBoard.
| Parameter | Default | Description |
|---|---|---|
deviceNameDataType | string | Value type for the device name |
deviceNameExpressionSource | expression | Source type: expression or constant |
deviceNameExpression | Device ${1/0/5} | Expression used to build the device name |
deviceProfileDataType | none | Value type for the device profile |
deviceProfileExpressionSource | constant | Source type: expression or constant |
deviceProfileNameExpression | default | Expression used to select the device profile |
"deviceInfo": { "deviceNameDataType": "string", "deviceNameExpressionSource": "expression", "deviceNameExpression": "Device ${1/0/5}", "deviceProfileDataType": "none", "deviceProfileExpressionSource": "constant", "deviceProfileNameExpression": "default"}Subsections “attributes” and “timeseries”
Section titled “Subsections “attributes” and “timeseries””Map KNX group addresses to ThingsBoard attributes and time-series telemetry. Both sections use the same field structure:
| Parameter | Description |
|---|---|
type | KNX data type (e.g. temperature, humidity, percent_U8) |
key | ThingsBoard attribute or telemetry key name |
groupAddress | KNX group address to read from |
"attributes": [ { "type": "temperature", "key": "temperature", "groupAddress": "1/0/6" }],"timeseries": [ { "type": "humidity", "key": "humidity", "groupAddress": "1/0/7" }]Section “attributeUpdates”
Section titled “Section “attributeUpdates””Optional. Writes ThingsBoard shared attribute updates to KNX group addresses, pushing remote configuration changes to connected KNX devices.
| Parameter | Default | Description |
|---|---|---|
deviceNameFilter | .* | Regex filter to match device names |
dataType | string | KNX data type of the value to write |
groupAddress | KNX group address to write to | |
key | Shared attribute name to subscribe to |
"attributeUpdates": [ { "deviceNameFilter": ".*", "dataType": "percent_U8", "groupAddress": "1/0/9", "key": "brightness" }]Section “serverSideRpc”
Section titled “Section “serverSideRpc””Optional. Maps ThingsBoard RPC method calls to KNX read or write operations.
| Parameter | Default | Description |
|---|---|---|
requestType | read | Operation type: read or write |
deviceNameFilter | .* | Regex filter to match device names |
method | RPC method name to bind | |
dataType | string | KNX data type |
groupAddress | KNX group address to read from or write to |
"serverSideRpc": [ { "requestType": "read", "deviceNameFilter": ".*", "method": "get_name", "dataType": "string", "groupAddress": "1/0/5" }]Every attribute and telemetry entry also has a built-in set RPC method available automatically — no manual
serverSideRpc entry required. See the
Reserved RPC methods guide for details.