Skip to content
Stand with Ukraine flag

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.

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"
}
]
}

Configures the KNX client responsible for communication with the KNX router.

ParameterDefaultDescription
typeAUTOMATICConnection type: AUTOMATIC, ROUTING, TUNNELING, TUNNELING_TCP, or TUNNELING_TCP_SECURE
addressFormatLONGGroup address format: SHORT, LONG, or FREE
localIpLocal IP address or network interface name
localPortLocal port number
autoReconnecttrueReconnect automatically if the tunneling connection is lost
autoReconnectWait3Seconds to wait before a reconnect attempt
gatewayIPIP address or hostname of the KNX/IP tunneling device
gatewayPort3671Port of the KNX/IP tunneling device
individualAddressIndividual KNX address of the local endpoint
rateLimit0Max outgoing telegrams per second; 0 disables the rate limiter
multicastGroup224.0.23.12Multicast group for KNXnet/IP routing
multicastPort3671Multicast port for KNXnet/IP routing
stateUpdaterfalseDefault 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 automatically
  • ROUTING — KNX/IP multicast routing
  • TUNNELING — UDP connection to a specific KNX/IP tunneling device
  • TUNNELING_TCP — TCP connection to a KNX/IP tunneling v2 device
  • TUNNELING_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
}

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.

ParameterDescription
backbone_keyBackbone key for KNX Secure Routing (hex)
latency_msLatency tolerance in milliseconds for KNX Secure Routing
"security": {
"backbone_key": "secret",
"latency_ms": 100
}

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.

ParameterDefaultDescription
enabledtrueEnable or disable the scanner
scanPeriod3Scan interval in seconds
stopOnFoundfalseStop 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: Yes

Configures polling and data mapping for each KNX device. Each entry in the array defines:

FieldDescription
deviceInfoDevice name and profile to create in ThingsBoard
pollPeriodPoll interval in milliseconds
attributesGroup addresses mapped to device attributes
timeseriesGroup addresses mapped to time-series telemetry
"devices": [
{
"deviceInfo": { ... },
"pollPeriod": 5000,
"attributes": [ ... ],
"timeseries": [ ... ]
}
]

Sets the device name and profile that will be created in ThingsBoard.

ParameterDefaultDescription
deviceNameDataTypestringValue type for the device name
deviceNameExpressionSourceexpressionSource type: expression or constant
deviceNameExpressionDevice ${1/0/5}Expression used to build the device name
deviceProfileDataTypenoneValue type for the device profile
deviceProfileExpressionSourceconstantSource type: expression or constant
deviceProfileNameExpressiondefaultExpression 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:

ParameterDescription
typeKNX data type (e.g. temperature, humidity, percent_U8)
keyThingsBoard attribute or telemetry key name
groupAddressKNX group address to read from
"attributes": [
{
"type": "temperature",
"key": "temperature",
"groupAddress": "1/0/6"
}
],
"timeseries": [
{
"type": "humidity",
"key": "humidity",
"groupAddress": "1/0/7"
}
]

Optional. Writes ThingsBoard shared attribute updates to KNX group addresses, pushing remote configuration changes to connected KNX devices.

ParameterDefaultDescription
deviceNameFilter.*Regex filter to match device names
dataTypestringKNX data type of the value to write
groupAddressKNX group address to write to
keyShared attribute name to subscribe to
"attributeUpdates": [
{
"deviceNameFilter": ".*",
"dataType": "percent_U8",
"groupAddress": "1/0/9",
"key": "brightness"
}
]

Optional. Maps ThingsBoard RPC method calls to KNX read or write operations.

ParameterDefaultDescription
requestTypereadOperation type: read or write
deviceNameFilter.*Regex filter to match device names
methodRPC method name to bind
dataTypestringKNX data type
groupAddressKNX 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.