OH2 - KNX - infinite command loop

Hi,
I’m running OH2 beta2 with the knx 1.9 binding.
the knx.cfg is quite simple:

# 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

# Local endpoint to specify the multicast interface, no port is used (optional)
localIp=192.168.0.180

the problem is that when I switch a lamp ON, OH2 send the command in an infinite loop:

2016-02-13 01:10:00.192 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command ON
2016-02-13 01:10:00.212 [INFO ] [ome.event.GroupItemStateChangedEvent] - grHome changed from NULL to UNDEF through grGM_Rez_Bureau
2016-02-13 01:10:00.213 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command ON
2016-02-13 01:10:00.213 [INFO ] [ome.event.GroupItemStateChangedEvent] - grGM changed from NULL to UNDEF through grGM_Rez_Bureau
2016-02-13 01:10:00.233 [INFO ] [ome.event.GroupItemStateChangedEvent] - grGM_Rez changed from NULL to UNDEF through grGM_Rez_Bureau
2016-02-13 01:10:00.235 [INFO ] [ome.event.GroupItemStateChangedEvent] - grGM_Rez_Bureau changed from NULL to UNDEF through swLampeBureauRez
2016-02-13 01:10:00.236 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command ON
2016-02-13 01:10:00.240 [INFO ] [ome.event.GroupItemStateChangedEvent] - grLights changed from NULL to UNDEF through swLampeBureauRez
2016-02-13 01:10:00.242 [INFO ] [marthome.event.ItemStateChangedEvent] - swLampeBureauRez changed from NULL to ON
2016-02-13 01:10:00.246 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command ON
2016-02-13 01:10:00.255 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command ON
2016-02-13 01:10:00.263 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command ON
2016-02-13 01:10:00.271 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command ON
2016-02-13 01:10:00.281 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command ON
2016-02-13 01:10:00.291 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command ON
2016-02-13 01:10:00.299 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command ON
2016-02-13 01:10:00.307 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command ON

and when I try to switch it off, I’ve got a flashing lamp :wink:

2016-02-13 01:10:11.635 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command ON
2016-02-13 01:10:11.636 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command ON
2016-02-13 01:10:11.637 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command ON
2016-02-13 01:10:11.638 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command OFF
2016-02-13 01:10:11.639 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command OFF
2016-02-13 01:10:11.639 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command ON
2016-02-13 01:10:11.639 [INFO ] [marthome.event.ItemStateChangedEvent] - swLampeBureauRez changed from ON to OFF
2016-02-13 01:10:11.639 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command ON
2016-02-13 01:10:11.640 [INFO ] [marthome.event.ItemStateChangedEvent] - swLampeBureauRez changed from OFF to ON
2016-02-13 01:10:11.640 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command OFF
2016-02-13 01:10:11.640 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command ON
2016-02-13 01:10:11.641 [INFO ] [marthome.event.ItemStateChangedEvent] - swLampeBureauRez changed from ON to OFF
2016-02-13 01:10:11.641 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command OFF
2016-02-13 01:10:11.641 [INFO ] [marthome.event.ItemStateChangedEvent] - swLampeBureauRez changed from ON to OFF
2016-02-13 01:10:11.641 [INFO ] [marthome.event.ItemStateChangedEvent] - swLampeBureauRez changed from OFF to ON
2016-02-13 01:10:11.641 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command ON
2016-02-13 01:10:11.642 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command OFF
2016-02-13 01:10:11.642 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command ON
2016-02-13 01:10:11.642 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command OFF
2016-02-13 01:10:11.642 [INFO ] [marthome.event.ItemStateChangedEvent] - swLampeBureauRez changed from OFF to ON
2016-02-13 01:10:11.642 [INFO ] [marthome.event.ItemStateChangedEvent] - swLampeBureauRez changed from OFF to ON
2016-02-13 01:10:11.642 [INFO ] [marthome.event.ItemStateChangedEvent] - swLampeBureauRez changed from ON to OFF
2016-02-13 01:10:11.643 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command ON
2016-02-13 01:10:11.643 [INFO ] [marthome.event.ItemStateChangedEvent] - swLampeBureauRez changed from ON to OFF
2016-02-13 01:10:11.643 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command OFF
2016-02-13 01:10:11.647 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command ON
2016-02-13 01:10:11.648 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command OFF
2016-02-13 01:10:11.648 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command ON
2016-02-13 01:10:11.649 [INFO ] [marthome.event.ItemStateChangedEvent] - swLampeBureauRez changed from OFF to ON
2016-02-13 01:10:11.651 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command ON
2016-02-13 01:10:11.651 [INFO ] [marthome.event.ItemStateChangedEvent] - swLampeBureauRez changed from ON to OFF

Here is the KNX item definition

Switch swLampeBureauRez "lampe bureau rez" (grGM_Rez_Bureau,grLights) {knx="0/0/3+0/1/3"}

this knx definition was working fine with OH1.8.1 and knx1.8.1 binding.
Any idea how to fix my config/definition?

Regards

Hi yphyph01,

please add busaddr=15.10.1 (or any other free KNX address) and ignorelocalevents=true to your KNX configuration and test it.

# 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

# Local endpoint to specify the multicast interface, no port is used (optional)
localIp=192.168.0.180

# 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=15.10.1

# 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

Furthermore enable debug for KNX in openHAB 2 console:
log:set DEBUG org.openhab.binding.knx

whith log:tail you’l see the output.

Many thanks Helmut.
Haven’t seen this option in config file
The lamp behavior is now correct.
However, I wonder why, with the new OH2 release, the knx binding is not updated to fix this issue. Would be easier for new comers. But I can understand the backward compatbility issue. So at least, if the bug couldn’t be fix, having the ignorelocalevents set to ‘true’ as default should it not be a normal knx behavior for new installation ?

I don’t understand the ‘busaddr’ parameter. Do you have a link to point to documentation for my personal knowledge :wink:

With the 2 parameters set as you propose, I’ve noticed new traces.
Are those repetitive “link notifier” warnings normal or do I have to change something?

13:23:54.549 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'swLampeBureauRez' received command OFF
13:23:54.552 [WARN ] [.binding.knx.internal.bus.KNXBinding] - Ignoring local Event, received from my local Source address 15.10.1 for Group address 0/0/3.
13:23:54.556 [INFO ] [marthome.event.ItemStateChangedEvent] - swLampeBureauRez changed from ON to OFF
13:23:54.560 [WARN ] [.binding.knx.internal.bus.KNXBinding] - Ignoring local Event, received from my local Source address 15.10.1 for Group address 0/0/3.
13:28:40.595 [WARN ] [tuwien.auto.calimero                ] - [Link notifier] process link 224.0.23.12:3671: unsupported APDU service - ignored, service code = 0x300
13:28:40.648 [WARN ] [tuwien.auto.calimero                ] - [Link notifier] process link 224.0.23.12:3671: unsupported APDU service - ignored, service code = 0x340
13:28:43.518 [WARN ] [tuwien.auto.calimero                ] - [Link notifier] process link 224.0.23.12:3671: unsupported APDU service - ignored, service code = 0x3d1
13:28:43.575 [WARN ] [tuwien.auto.calimero                ] - [Link notifier] process link 224.0.23.12:3671: unsupported APDU service - ignored, service code = 0x3d2
13:28:44.208 [WARN ] [tuwien.auto.calimero                ] - [Link notifier] process link 224.0.23.12:3671: unsupported APDU service - ignored, service code = 0x200
13:28:44.271 [WARN ] [tuwien.auto.calimero                ] - [Link notifier] process link 224.0.23.12:3671: unsupported APDU service - ignored, service code = 0x240
13:28:44.387 [WARN ] [tuwien.auto.calimero                ] - [Link notifier] process link 224.0.23.12:3671: unsupported APDU service - ignored, service code = 0x3d5
13:28:44.471 [WARN ] [tuwien.auto.calimero                ] - [Link notifier] process link 224.0.23.12:3671: unsupported APDU service - ignored, service code = 0x3d6

Thank you for your support
Yann

Hi @yphyph01,

However, I wonder why, with the new OH2 release, the knx binding is not updated to fix this issue.

The knx 1.9 binding is not a OH2 Binding, it’s a OH1 Binding with OH2 compatibility. Do not know the state of the KNX OH2 Binding yet, but yes indeed this will be fixed.

I don’t understand the ‘busaddr’ parameter.

It is used for openHAB to identify and filtering like: Ignoring local Event, received from my local Source address 15.10.1
The default used KNX Groupadress for openHAB “0.0.0” would be unique too, if you are running only OH instance. After it works, you can test if it works without ‘busaddr’ parameter!

Are those repetitive “link notifier” warnings normal or do I have to change something?

tuwien.auto.calimero is the library, knx binding uses to communicate to/from KNX Router. “link notifier” is new for me too. I would observe and then ignore, if everything works well.

My pleasure
Helmut

I’ve overlooked

I don’t understand the ‘busaddr’ parameter. Do you have a link to point to documentation for my personal knowledge

See here: https://github.com/openhab/openhab/wiki/KNX-Binding

# 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)
#knx:busaddr=

Thank you for your explanation
I understand the “busaddr” parameter. As I’m using only one OH instance, I leave the parameter empty (defualt value) but keep the “ignorelocelevent” to true.

The behavior of OH2 is still correct with this new config stteing, no more repetitive events.
And the events “link notifier” have disapearred. Might be a side effect with my KNX installation (2 knx installations linked together through IP, so 2 KNX router) … I don’t know…
But anyway, my first issue is resolved
Many thanks for your help
Yann

I just stumbled over the bus busaddr parameter, in OH1 I used the default, but now I want to connect my OH2 test installation to the same bus as my OH1 productive system.

The default used KNX Groupadress for openHAB “0.0.0” would be unique too, if you are running only OH instance. After it works, you can test if it works without ‘busaddr’ parameter!

Is it really a group address or should I enter a physical address?

The ‘knx:busaddr=’ in ‘knx.cfg’ is a PA (Physical Address) of the openhab “client” on the KNX Bus (it’s not a GA (Group Address)).

I usually set it to some PA that is free in project (outside my line) (e.g. 2.2.200 when my KNX line is 1.1.x)

BR,
Dim