KNX does not work anymore with my items

Thank you very much Udo,
I have had in knx.cfg only:
type=“TUNNEL”, // set mode of IP connection
ipAddress=“192.168.178.20”, // IP of knx/IP Gateway
localIp=“192.168.178.58”

That is all.
For the rollershutters I have used only switches, because I do not need Stop.
I have used it only in a rule, where the rollersutters go up in the morning, and down in the evening.
This has always worked with a switch.
My Questions are: what is “address” in Thing device. Is it the physical address in the line like 1.1.6?

Second question in another discussion I find that I can use only one thing for the whole installation and define the switches within this one thing. Is that correct and can it recommended? And what would be the address in Thing device …?

I will change my configuration according to your good example tomorrow.
Thank you again.

Bernd

Then the bridge given above should suffice.

There are two options in knx2: Either use the whole knx bus as one “virtual” device, so only define a generic thing, or use every single device as “real” devices and define one thing per device. It’s possible to mix these two options.

address is the individual address (or in german terms physikalische Adresse). You don’t need to set this parameter, and if defining one generic thing for the whole knx bus, in fact, there is no individual address at all.
On the other hand, if defining each device with its individual address, openHAB will show if each device is ONLINE, if pingDevice is set to a reasonable value.
Some additional information may be downloaded and displayed in Paper UI (serial number, ROM mask, manufacturer…) when setting fetch=true (it’s dependent on the device if this option is working correct).
If there is any GA set to be read ( < before GA), openHAB will request a read at startup. As soon as a device answers to the read request, the status is set. Some devices can’t be configured to send their status frequently or even when changing the status, these devices will only answer to read requests. So how to get these channels updated?
readInterval will force openHAB to send read requests to all GA set to be read at startup each <readInterval> seconds, not only at startup. But this option is to be used carefully, as it results in very increased data traffic at the knx bus.
As the absence of correct “automatic send option” is very rare and clearly dependent to the device, this parameter is a thing parameter. Even if using the “generic thing” model, the affected GA should be defined in a “special” generic thing which has the readInterval set. All other GA are set to another generic thing which has not set readInterval.

Even if using per-device-things, there may be some GA which don’t “belong” to a device (i.e. the device holds the status of the GA, think of a knx scene, think of date/time). These GA can be configured to a channel using a generic thing.

In question of the shutters: As knx does not mark the sub DPT within the bus data, a switch will also work, because UP/DOWN is a 1 bit message. But it’s a ugly hack, and there is no good reason to do it this way.

Type switch        : ch1 "Rollershutter UP/DOWN" [ ga="1/2/3" ]
Type rollershutter : ch2 "Rollershutter UP/DOWN" [ upDown="1/2/4" ]

These two channels will be used the same way, with a slight difference. ch1 will need ON/OFF as command while ch2 will need UP/DOWN as command. So you will have to use different item types:

Switch rollershutter1 <rollershutter> { channel="knx:device:bridge:generic:ch1" }
Rollershutter rollershutter2          { channel="knx:device:bridge:generic:ch2" }

While you have to set the switch item to use a non-default icon, the rollershutter item will use the correct icon automatically.

In a sitemap you would use a mapping to avoid getting a STOP button or a slided switch:

Switch item=rollershutter1 mappings=[ ON="DOWN" OFF="UP" ]
Switch item=rollershutter2 mappings=[ DOWN="DOWN" UP="UP" ]

in a rule you would use different commands:

rollershutter1.sendCommand(ON)  // rollershutter1 DOWN
rollershutter2.sendCommand(DOWN) 

At least in a rule you can see the advantage, as there is absolutely no need to write down a comment for the latter item, while the former item is not self explanatory.

2 Likes

Hello Udo,
that was very helpful, but it does not work. It seems that there is a problem with the communication with the bus or between things and items.
I have it simplified to one groupaddress
knx.things

    type="TUNNEL",                         // set mode of IP connection
    ipAddress="192.168.178.20",            // IP of knx/IP Gateway
    localIp="192.168.178.58",              // IP address of openHAB
    autoReconnectPeriod=30                 // please don't set this to 1!
  ] {
    Thing device generic1_1_5 [
        
     ] {
        Type switch : ch2 "Lampe Arbeitszimmer"     [ ga="<2/0/2" ]
     }
}```

rUebung.items
``
Switch Licht_Arbeitszimmer "Lampe Arbeitszimmer" <light>  { channel="knx:device:bridge:generic1_1_5:ch2" } ```

rUebung.sitemap
```sitemap rUebung label="Uebung KNX" {  
Frame label="Items" {
   Switch item=Licht_Arbeitszimmer 
 }  
      } '''

What is curious: If I go to openhab/Basic in Licht_Arbeitszimmer is shown a switch instead of a light as an icon, although I have defined in the items <light>. So maybe there is something wrong with the communication between the files things and items.
Calling Licht_Arbeitszimmer does not  work.

Kind Regards
Bernd

Thanks to Udo, thanks to DIM
I was so frustrated that I have make a total new installation of openhab.
And with your help now it (it seems) works!!!
(At least with the first 4 Items which I have installed)
I do not know why it did not work before - because I made the same according to your comments.

Happy Weekend
bernd

1 Like

Sometimes openHAB2 does not update its internal data the correct way.

In most cases, a restart of openHAB2 should suffice.

If you take a look at your posting, you may notice that the code ist not as nice as it should be.
Code fences are ``` (three backticks in a row, at german keyboard it’s <shift>+<`>, the key right to <ß>) before and after code, but code fences must (!!!) stay alone in its own line.
```
// Code goes here
```
will result in

// Code goes here

Of course above I did escape the code fences to force discourse to ignore them :wink:

Another hint: As a single backtick needs another key to be typed, but we need 6 backticks, just type the backtick 6 times, scroll back three times and insert two <return> to get code fences and space between them to paste the code.

1 Like

Thank you Udo,
Now I have understood the backticks.(in a single Line)
Another thing which one learnt again from my frustration:
It is in many cases better to start a totally new system and do most of the work by paste and copy.
So you can see the project growing and you find errors quicker
So I think I have now a clean system.
… until the next KNX Binding …
Kind Regards
Bernd

1 Like