I like to control my KNX environment using openhab 2. Because I don’t find a way to install the “in development” KNX2 addon in my existing openHab2 instance (which would be my preferred way), I now trying to run the KNX1 binding in opneHab2.
Looking to the openHab2 documentation, the legacy-binding-part points to the openHab1-KNX-binding documentation.
But: for me it looks like the filesystem structure is different from openHab1 and openHab2. So I don’t have an idea, how to apply the KNX1-binding documentation (from openHab1 docs) on an openHab2 setup. Are there any code-examples or howto’s for merging both worlds?
By the way: for me it’s possible to install knx1 binding using the paper UI or habmin interface in openHab2. That works and the KNX1 binding comes during openHab2 startup. But, it’s not configured. So: where can I found the configuration files in openHab2 for setup an legacy binding?
Thank you for that response and those hints.
I tried that, but get the message " KNXBinding configuration is not present". Do I have to register the KNX configuration file anywhere?
I started learning, configuring and using OH2 with the knx 1.9 addon somewhere in November, so I’m not the big expert either. But the basics are working. On the raspberry pi I have a knx.cfg file in /etc/openhab2/services. It contains information about how the knx addon connects to the KNX bus. In my case I’m connecting to knxd, which in turn connects to a USB connected serial FT1.2 interface. I also have a file knx.items in /etc/openhab2/items. This one basically contains the list of KNX Group Adresses, a name and an icon to be used for it in OH2. See below for examples of both files. I didn’t have to register these files, OH2 picks them up automatically. You may need to restart OH2 if you change knx.cfg although I’m not really sure about that.
##knx.cfg
# KNX gateway IP address
# (optional, if serialPort or connection type ‘ROUTER’ is specified)
ip=
# Local KNX Binding bus address.
# Use it, when two or more openHAB Instances are connected to the same KNX bus.
# (optional, defaults to 0.0.0)
busaddr=0.0.0
# Ignore local KNX Events, prevents internal events coming from
# 'openHAB event bus' a second time to be sent back to the 'openHAB event bus'.
# Note: To send back events second time is a Bug, but for backward compatibility, the behavior is not changed.
# For new installations, its recommend to set "ignorelocalevents=true"
# (optional, defaults to false)
ignorelocalevents=true
# KNX IP connection type. Could be either TUNNEL or ROUTER (optional, defaults to TUNNEL)
# Note: If you cannot get the ROUTER mode working (even if it claims it is connected),
# use TUNNEL mode instead with setting both the ip of the KNX gateway and the localIp.
type=ROUTER
# KNX gateway port (optional, defaults to 3671)
# Note: If you use eibd, setting to 6720
port=6720
# Local endpoint to specify the multicast interface, no port is used (optional)
localIp=172.16.0.8
# Serial port of FT1.2 KNX interface (ignored, if ip is specified)
# Valid values are e.g. COM1 for Windows and /dev/ttyS0 or /dev/ttyUSB0 for Linux
#serialPort=
# Pause in milliseconds between two read requests on the KNX bus during
# initialization (optional, defaults to 50)
#pause=
# Timeout in milliseconds to wait for a response from the KNX bus (optional,
# defaults to 10000)
#timeout
# Number of read retries while initialization items from the KNX bus (optional,
# defaults to 3)
#readRetries
# Seconds between connect retries when KNX link has been lost
# 0 means never retry, it will only reconnect on next write or read request
# Note: without periodic retries all events will be lost up to the next read/write
# request
# (optional, default is 0)
#autoReconnectPeriod=30
### Auto refresh feature
# Number of entries permissible in the item refresher queue.
# (optional, defaults to 10000)
#maxRefreshQueueEntries=
# Number of parallel threads for refreshing items. (optional, defaults to 5)
#numberOfThreads=
# Seconds to wait for an orderly shutdown of the auto refresher's
# ScheduledExecutorService. (optional, defaults to 5)
#scheduledExecutorServiceShutdownTimeoutString=
# Use NAT (Network Address Translation)
# (optional; defaults to false)
#useNAT=true
@esteevens: I have used something similar to your knx.items file and it works. Items appear OpenHab2 as expected. However, it’s just the item, how about defining the Thing with the Channel to link to the item? What does your .things file look like? Because no “Things” appear in OpenHab2. Any ideas?
Since the KNX Binding is coming from the 1.x world of OH, there are no “Things” & associated “Channels” available for it. The Thing+Channel concept is valid for 2.x Bindings, build for openHAB 2.
You just need to define the items (with their binding settings) and use them in your sitemap, etc.