KNX Binding installed on OpenHab2 but how to configure? (e.g. no knx.cfg available)

I installed openHABian on a raspberry 3 and everything went fine. Then in PaperUI I installed the KNX binding. According to guides and tutorials I should now have a knx.cfg in the services folder but this is not the case. How/where can I configure the KNX binding (e.g. knx.cfg, knx.things, knx.items, knx.sitemaps) as mentioned here: Many thanks for any hints!

that link does not have any reference to knx.cfg, since it describing the configuration of the (new) KNX v2 Binding
The knx.cfg file is only used for the (old) KNX v1 Binding

Start with your knx.things to setup your stuff.

1 Like

Thanks @Dim, your post is really helpful! I’m totally new to all this… I read about the confusion the switch v1 vs v2 caused for old as well as new users as many of the guides/toturials etc. are based on the old version.

So I will start with defining knx.things and knx.items. I can do that in the Paper UI, although if this then creates a file in the corresponding directories on the file system I will likely edit these config files in a text editor. In the link it also mentions knx.sitemap. This is not a configuration option in Paper UI but there is a directory in /etc/openhab2 so I guess that is where that configuration goes.

1 Like

Correct. Sitemap files should be stored in the /etc/openhab2/sitemaps/ directory.
They should have the *.sitemap file extension and the name should be the same as the sitemap name. (eg. Home.sitemap should have: sitemap Home label="whatever" { ...}


Correct also :slight_smile: most (if not all) info that you will find around is referring to KNXv1 binding. This will change gradually.

I recommend flat text files (eg. /etc/openhab2/things/knx.things)

No, that’s definitely wrong. All documentation is built automatically, based on the actual nightly build. Old documentation is pinned when a new official build is released and can be chosen through dropdown menu (upper right). For legacy bindings, you have to enable the listing of those addons in the documentation.
There may be sometimes outdated information for some time, when documentation was not already updated.

In question of OH2 bindings, there should always be the option to configure via Paper UI or text files. Please be aware that Paper UI (and al other non-text-configuration ways) will not generate a text configuration file, so if you once configured something through Paper UI, you can’t change it through text file and vice versa.

For really small installations Paper UI might be an option (and of course just to checkout some new binding, I do this frequently). When using openHAB for real :wink: I would always recommend configuration through text files. VSCode as preferred editor has many really nice functions to suit the user experience.

Thanks @Udo_Hartmann, I should have mentioned that it’s confusing for the guides/tutorials not in the official documentation. In the official documentation you can check which version the documentation was built for. But in the www there is often no reference for the version…

I already downloaded VSCode with the OpenHAB extension which is great! And I am planning on going real and using the text files and not PaperUI…

Thanks for your great inputs!

:smiley: Never trust in unofficial documentation (at least when you experiencing issues…)

Greetings Community,

I want to get answers from your experience about this question:

  • What are the benefits of integrating openHAB with KNX?


you have a paper to write in the University? :slight_smile:

The idea of openHAB is to integrate as much “IoT” stuff as possible in one system.

For example use the ntp binding to get the correct time and date, then send it to knx, which will use it for the heating and cooling scheduler. Take the status of window contacts (maybe EnOcean, zwave or zigbee) and use them for shutting down heating and cooling in those rooms which have open windows…

Sorry for the late question, but I am a noob to pi and openhab2. however, I managed to bind my KNX gateway to openhab, using paperUI. I have now installed a Visual editor, and mapped a drive to the conf directory, however there is no file for KNX.thing, knx.sitemap, knx.items. surely there should have been a knx.thing file created in the subdirectories, with the information of my knx gateway, but there isn’t, all there are, are demo.things, demo.sitemap, etc, all demo. Do I have create a new file, or do I just rename the demo files to KNX and edit that file.
Thanks for your patience.

No, if configuring through Paper UI, there is no text file at all. All configuration is stored internally, the format is not compatible to the old text files.
This is a thing that will be changed in openHAB3 - there will be neither Paper UI nor a text file configuration :wink:

Thanks Udo, that’s all rather confusing. I note that you can now install a knx device in paper ui. I tried that last night, but openhab came up with an internal error 500 code.I specified the correct device actuator address, identified the bridge, as my blinded knx gateway.

I don’t know where the error 500 comes from, but the configuration steps are:

  1. Create a bridge (either IP or serial, either TUNNEL mode or ROUTER mode)
  2. Create at least one Thing, bound to the bridge. You can set an individual address (in german physikalische Adresse), but you don’t need to. In case of a generic Thing, don’t set an individual address at all.
  3. Create at least one Channel bound to the Thing (from Thing edit page). Define GA for all parameters (for switch Channel at least one GA, but it would be better to set two GA, one for commands, one for state update from knx bus.
  4. define an item bound to that channel.

All these steps are manual, no auto configuration. (In simple mode openHAB will create an Item by itself, but the name is not nice…)

You can do these steps through Paper UI or through text files.

Thanks, I think what problem, I was changong the device ID that paper ui generates. I now managed to add a thing, and there two channels that have come up. I note that you don’t have enter the physical addresses of the actuators? Is that correct? I have about 40 actuators etc and 150 ga’s. Is there a bit of software that can import data from ets3.0?

Sorry Udo, my main object is to get alexa to control the knx system. Am I wasting my time by adding devices via paper ui, if I need to add tags for alexa. So should I start using text files?

Ah. You will need to create the Items via text files, as Paper UI does not provide tagging.
If using VSCode and the openHAB plugin, you will only need to let VSCode create the items for you.

In question of individual addresses, they are optional. Of course you can’t use fetch and ping if no individual address is set, but for now that’s only nice to have, no real benefit.

I just started with OpenHAB 3 with the KNXBinding. I make a thing with the groupaddress from the switch, I make a channel in the thing with the groupaddress of a lightbulb and I link that channel to an Item (the lightbulb). Is that the way to go in OpenHAB3 for all my lights? As you told in your comment I don’t find config files. It seems I still have the possibility to use config files under /etc/openhab/things … ? If not is there a possibility to backup all the knx settings I made via the UI? Thanks a lot for your help!

Please be aware that openHAB3 and openHAB2 are different in configuration as well as openHAB1 and openHAB2.
Nevertheless it’s possible (but not recommended) to go the text config way. As far as I know, you can configure all stuff via UI. openHAB3 stores configuration in json (as openHAB2 also did).

Thanks a lot for this very useful information. I’ll make my further configuration in the UI of OpenHAB3 and I found the json-config files under /var/lib/openhab/jsondb So when something went wrong I can reuse these files. Thanks!