KNX – Tasmota

The KNX IP protocol is an international open standard for smart home and smart building automation. It’s a decentralized system. Devices can communicate directly with each other without the need for a central controller or server. Each panel or server is dedicated to remote monitoring and sending requests. The KNX IP protocol uses UDP multicast on 22

.0.23.12:3671, so you don’t need a KNX router unless you want to communicate with KNX devices that aren’t on your WIFI network (twisted pair, RF, powerline).

Each device has a physical address (such as a fixed IP) as 1. 1.0 and this address is used for configuration purposes.

Each device can be configured with a group address as 2 / 2 / 1 and can send and receive commands using this address. For example, if two devices configured as 2 / 2 / 1 turn their outputs on and off and another device sends a Turn ON command to 2 / 2 / 1, both devices will turn their outputs on.


Several home automation systems support KNX. Home Assistant, for example,  has the XKNX Python library for connecting to her KNX device via a KNX router. If you don’t have a KNX router, you can use a software KNX router such as KNXd as your home assistant on the same Raspberry Pi. KNXd is used by Home Assistant to read this UDP multicast, but KNXd has other nice features that require additional hardware, such as: B. Connection to his KNX device via twister pair, powerline, or RF.

If you use the Home Assistant distribution called Hassio, everything from KNX is already included by default. When using the ETS (KNX Configurator Software), any TasmotaTasmota KNX can be added as a dummy device.

If your Tasmot device is connected to a WiFi repeater, you may have problems receiving KNX telegrams. This also applies to mDNS and emulation features.

Implemented Features

All the implemented features KNX for Tasmota offers are listed below:

  • relays (on/off/toggle)
  • buttons (just push)
  • lights (led strips, etc. but just on/off)

Sensors that you can use in KNX is (only one sensor per type):

  • Energy (v, i, power)
  • Temperature
  • Humidity

For using rules :

  • receive KNX command (on/off)
  • send KNX command (on/off)
  • receive a KNX read request
  • send and receive SCENE commands
  • send values by KNX (any float type, temperature for example)

Usage Examples

There are several possible configurations. Only a few examples are described here. Options to select relays, buttons, sensors, etc. are only available when configured in the module’s configuration menu.

To configure KNX, go to Tasmota’s configuration menu and select Configure KNX.

Note about the KNX communication extension option: Wifi multicast communication on some WLAN routers is unreliable due to IGMP issues or snooping, so the extension has been implemented. This option increases reliability by reducing the chance of telegrams being lost by sending the same telegram three times. In practice, it works quite well and is good enough for normal home use. With this option enabled, Tasmota will send toggle commands from his KNX  more than once per second. Ignore it even if it is. One toggle per second is enough.

1)Setting Several Tasmota to be controlled as one by a Home Automation System:

One of the group addresses can be set the same for all devices and turned on or off at the same time. In this case, only one device needs to be configured as a responder to report the status of all relays to the automation system. Care must be taken to avoid loops when using the same group address for sending and receiving.

2)Setting 2 Tasmota to be linked as stair lights:

You can configure one device to send the status of the output, and another device to read and follow it. Then the second device can send the status of that button and the first device will toggle. This construct allows you to avoid creating loops.

3) Setting a button as the initiator of a scene:

Configure one device to send a button press and the rest will be turned on using that value. In this case there is no switching. A switch-on command is sent with each keystroke.

4) Setting a Temperature sensor:

A temperature or humidity value can be configured to be sent every teleperiod. This tele period is configurable. See the TasmotaTasmota documentation. It is recommended to also set the response temperature address.

5) Using rules:

You can easily include more functionality to Tasmota using certain rules.

You can set the group address in the KNX menu to send data or commands according to the rules, such as KNX TX1 to KNX TX5.

A rule can use the KnxTx_Cmnd1 1 command to send an ON state command to the group address configured for the KNX TX1 slot in the KNX menu. You can also use the KnxTx_Val1 15 command to send the value of 15 to the group address set in the KNX TX1 slot in the KNX menu.

The group address can be set in the KNX menu to receive commands according to the convention KNX RX1 to KNX RX5.

Rules can use events to intercept the receipt of COMMANDS from KNX to these RX slots.

For example, event#knxrx_cmnd1 do var1 %value% endon saves the received command in variable VAR1.

Rules can use events to intercept the receipt of values ​​from KNX on these RX slots.

Example: rule for event#knxrx_val1 do var1 %value% endon to store the received value  in the variable VAR1

Also, if a read request is received from the KNX network, it can be used in the rule. Example: Rule with event number knxrx_req1 do knxtx_val1 %var3% endon.

Note: Starting with, KnxTX_valn commands, KNXRX_Reqn triggers and sensor telegrams use KNX DPT1

(32-bit float). Older versions use DPT9 (16-bit floating point). Old and new versions cannot send values ​​to each other. command only. We recommend using the same version on all devices.

Scene :

To use the KNX scene feature, you need to add a rule containing the desired behavior for that scene, such as:

Rule1 on EVENT#KNX_SCENE=0 do power1 1 endon on EVENT#KNX_SCENE=1 do power1 0 endon.

6) Rule to send KNX Telegram with BH1750 Sensor Data:

If you want to send the sensor values via KNX  to the group address defined in KNX_TX1 every teleperiod, you can use the following rule:

rule1 1

rule1 on tele-BH1750#Illuminance do knxtx_val1 %value% endon.

If you just want to send the sensor value via KNX to the group address defined by KNX_TX1 when there is a change in the delta of 10 lx, you can use the following rule:

rule1 1

rule1 on system#boot do backlog var1 0; var2 0 endon on BH1750#Illuminance>%var1% do backlog var1 %value%; knxtx_val1 %value%; var2 %value%; add1 5; sub2 5 endon on BH1750#Illuminance<%var2% do backlog var2 %value%; knxtx_val1 %value%; var1 %value%; add1 5; sub2 5 endon.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top