Tunnel mode configuration

Is it necessary to have a knx ip gateway in tunnel mode?.Please specify the configurations…

There are two different ways to connect via knx ip gateway,
1. Tunnel mode

knx:ip=192.168.178.240 # mandatory, IP or FQDN of knx gateway 
knx:port=3671 # port of knx gateway (default is 3671), optional
knx:localIp=192.168.178.241 # IP or FQDN of openhab server, optional but maybe needed for linux
knx:type=TUNNEL
knx:busaddr=1.1.255 # optional, the physical bus address of openHAB as a virtual hardware connected to knx

2. Router mode

knx:ip= 224.0.23.12 # **Multicast** IP or FQDN of knx gateway, optional
knx:port=3671 # port of knx gateway (default is 3671), optional
knx:localIp=192.168.178.241 # IP or FQDN of openhab server - Multicast has to be enabled, optional
knx:type=ROUTER
knx:busaddr=1.1.255 # optional, the physical bus address of openHAB as a virtual hardware connected to knx

The IP gateway has to support at least one of these two modes, called EIBnet/IP Tunneling and EIBnet/IP Routing

openHAB does not support EIB LIB/IP! Maybe one can circumvent this with using eibd or knxd, I don’t know though.

Thank you for the response.
But I have seen that
KNX gateway IP address is optional, if serialPort or connection type ‘ROUTER’ is specified.

Yes, that’s what I’ve written. :slight_smile: for Tunnel Mode knx:ip is mandatory, for Router Mode it’s optional (and 224.0.23.12 is the default multicast IP)

Thank you sir.!
Is knx IP router is necessary to access knx bus in router mode or tunnel mode??

The gateway has to provide Router mode to use this one. Simple knx ip gateways only do provide Tunnel mode, I think only knx ip routers do provide router mode (in addition to tunnel mode).

Thank you sir!..
what is the difference between tunnel mode and router mode(functionality wise)?

Would you please give an example for how to configure single switch in tunnel mode…

There is no difference between the two modes from openHAB’s point of view, the difference is only the communication layer.

With router mode you get the ability to couple segments from knx together with an IP backbone, this is especially relevant for pretty large knx installations :). The IP Router has the ability to filter the knx traffic so only relevant messages get to the knx line - remember, that knx tp is 9600bit/s.

A knx IP tunnel interface is (more or less) a dump interface to get access to the knx line, which is fine for most home installations.

A typical switch item would be

Switch MyItem "My item is [%s]" {knx="1/2/3+<1/2/4"}

where GA 1/2/3 is the address to switch on/off the actuator, and GA 1/2/4 is the address where the actuator announces its state (on/off). Get in mind, that the actuator can react to more than one GA, it’s possible that the actuator belongs to a scene-group, so it’s important to get the real state, not only information from one GA which steers the actuator.

is GA 1/2/4 necessary ? In demo example .items file containing
String KITCHEN “KITCHEN” { serial="/dev/ttyUSB0:19600", autoupdate=“false” }
like serial port address…what is that ? is it require ? and how to give that one.

I am very new to openhab…lots of doubts and confusions in my mind…would please post how to configure a switch with .sitemap , .items , .rules and .cfg files.that would be very helpful for me…

No, you don’t need a GA with the state of the actuator, but as I wrote before, openHAB will not know about any changes which origin from other Group Addresses and cause the actuator to change it’s state.
If you are using knx, given a switch actuator with GA 1/1/1 for switching ON/OFF and GA 1/1/2 for report it’s state, let’s say it’s the kitchen light, in my.items:

Switch kitchenLight "Light in kitchen is [%s]" {knx="1/1/1+<1/1/2"}
// you can omit +<1/1/2, you can also use {knx="<1/1/1"} to read out the actual state at startup from 1/1/1

which means for openHAB: if sending a command to the bus, use GA 1/1/1. When starting up, send a read request to 1/1/2. If getting any states from 1/1/1 or 1/1/2 set the item kitchenLight to this state.

In your sitemap, you would use

Switch item=kitchenLight

to generate a Switch. This will use the label previously setup in .items, so “Light in kitchen is” at the left side, and “ON” or “OFF” at the right side, depending on it’s state. As the default icon of switch items is a light bulb, this icon will show up in your sitemap, too (grey if OFF and yellow if ON)

As you can see, you need very little code to implement a working switch, there is no need for rules or other stuff so far.

To connect your knx bus to openHAB, it depends on what interface you are using. For a knx IP tunnneling interface the config in openhab.cfg would be something like

knx:ip=192.168.1.250 # this is the ip address of the knx ip gateway
knx:localIp=192.168.1.240 # this is the ip address of the openHAB server
knx:type=TUNNEL

and this should suffice for communication. Of course there are some other configs for knx, it depends on what you need.

Hello sir!
java.lang.RuntimeException: No properties in openhab.cfg set!
at org.openhab.binding.ebus.internal.EBusBinding.updated(EBusBinding.java:154)
at org.openhab.binding.ebus.internal.EBusBinding$1.run(EBusBinding.java:305)

I am getting this exception.