KNX 2.x Binding issues

Hi,

in the last few days I migrated my KNX 1.x configuration to the new KNX 2.x binding and did some testing. Doing so I encountered some issues. I am not sure if these issues are already known. If these topics should be discussed in an other place or if I should report an issue in the issue tracker please let me know.

Jus for information: My KNX configuration consists of 60 devices wit about 350 channels, every channel is linked to on item.

The issues I encountered:

1. KNX devices and channels are not initialized on startup.
This happens at about 50% of the openHAB starts I performed. If this happens not a single KNX GA is functional. A added an excerpt of the log messages related to KNX when the bugs occurred (left out parts are marked by “…”)

2018-03-26 17:23:51.583 [DEBUG] [org.openhab.binding.knx             ] - BundleEvent STARTING - org.openhab.binding.knx
2018-03-26 17:23:51.592 [DEBUG] [ab.binding.knx.internal.KNXActivator] - KNX binding has been started.
2018-03-26 17:23:51.600 [DEBUG] [org.openhab.binding.knx             ] - ServiceEvent REGISTERED - {org.openhab.binding.knx.config.KNXTypeMapper}={service.id=136, service.bundleid=12, service.scope=bundle, component.name=org.openhab.binding.knx.typemapper, component.id=39} - org.openhab.binding.knx
2018-03-26 17:23:51.624 [DEBUG] [org.openhab.binding.knx             ] - ServiceEvent REGISTERED - {org.openhab.model.item.binding.BindingConfigReader, org.openhab.binding.knx.config.KNXBindingProvider, org.openhab.core.autoupdate.AutoUpdateBindingProvider}={service.id=137, service.bundleid=12, service.scope=bundle, component.name=org.openhab.binding.knx.genericbindingprovider, component.id=40} - org.openhab.binding.knx
2018-03-26 17:23:51.630 [DEBUG] [org.openhab.binding.knx             ] - BundleEvent STARTED - org.openhab.binding.knx

...

2018-03-26 17:24:28.647 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'knx.things'
2018-03-26 17:24:28.677 [DEBUG] [.thing.internal.GenericThingProvider] - Read things from model 'knx.things'

...

2018-03-26 17:24:32.560 [TRACE] [g.knx.internal.dpt.KNXCoreTypeMapper] - toTypeClass looking for dptId = 17.001
2018-03-26 17:24:32.562 [TRACE] [g.knx.internal.dpt.KNXCoreTypeMapper] - toTypeClass looking for dptId = 17.001
2018-03-26 17:24:32.571 [INFO ] [b.core.service.AbstractActiveService] - HTTP Refresh Service has been started
2018-03-26 17:24:32.572 [DEBUG] [org.openhab.binding.knx             ] - ServiceEvent REGISTERED - {org.osgi.service.event.EventHandler, tuwien.auto.calimero.process.ProcessListener}={service.id=315, service.bundleid=12, service.scope=bundle, event.topics=openhab/*, component.name=org.openhab.binding.knx, component.id=38} - org.openhab.binding.knx
2018-03-26 17:24:32.572 [DEBUG] [org.openhab.binding.knx             ] - ServiceEvent REGISTERED - {org.osgi.service.cm.ManagedService}={service.id=316, service.bundleid=12, service.scope=bundle, service.pid=org.openhab.knx, component.name=org.openhab.binding.knx.config, component.id=37} - org.openhab.binding.knx
2018-03-26 17:24:32.599 [TRACE] [.binding.knx.internal.bus.KNXBinding] - allBindingsChanged() msg received.
2018-03-26 17:24:32.600 [DEBUG] [.binding.knx.internal.bus.KNXBinding] - Calimero library version 2.3-beta
2018-03-26 17:24:32.600 [TRACE] [.binding.knx.internal.bus.KNXBinding] - KNXBinding: activating
2018-03-26 17:24:32.601 [TRACE] [x.internal.bus.KNXBusReaderScheduler] - Starting auto refresh scheduler
2018-03-26 17:24:32.601 [DEBUG] [x.internal.bus.KNXBusReaderScheduler] - Starting reader task.
2018-03-26 17:24:32.603 [DEBUG] [x.internal.bus.KNXBusReaderScheduler] - Starting schedule executor.
2018-03-26 17:24:32.603 [DEBUG] [al.bus.KNXBindingDatapointReaderTask] - Autorefresh: Waiting for new item in reader queue
2018-03-26 17:24:32.604 [DEBUG] [nx.internal.connection.KNXConnection] - KNXBinding configuration present. Setting up KNX bus connection.
2018-03-26 17:24:32.605 [TRACE] [nx.internal.connection.KNXConnection] - stacktrace.length = '11'
2018-03-26 17:24:32.605 [TRACE] [nx.internal.connection.KNXConnection] - getEnvironmentIsFelix RUNNING IN openHAB2 'org.apache.felix.cm.impl.helper.ManagedServiceTracker'
2018-03-26 17:24:32.605 [DEBUG] [nx.internal.connection.KNXConnection] - Not connected yet. Trying to connect.
2018-03-26 17:24:32.638 [INFO ] [nx.internal.connection.KNXConnection] - Established connection to KNX bus on 192.168.10.15:3671 in mode TUNNEL.
2018-03-26 17:24:32.638 [TRACE] [.binding.knx.internal.bus.KNXBinding] - connectionEstablished() msg received. Initializing readable DPs.
2018-03-26 17:24:32.640 [DEBUG] [nx.internal.connection.KNXConnection] - Success: connected.
2018-03-26 17:24:35.481 [DEBUG] [.binding.knx.internal.bus.KNXBinding] - Received groupWrite Event.
2018-03-26 17:24:35.483 [DEBUG] [.binding.knx.internal.bus.KNXBinding] - Received telegram for unknown group address 11/0/121
2018-03-26 17:24:35.839 [DEBUG] [.binding.knx.internal.bus.KNXBinding] - Received groupWrite Event.
2018-03-26 17:24:35.839 [DEBUG] [.binding.knx.internal.bus.KNXBinding] - Received telegram for unknown group address 11/2/200

...

2018-03-26 17:24:39.285 [DEBUG] [org.openhab.binding.knx             ] - BundleEvent STARTING - org.openhab.binding.knx
2018-03-26 17:24:39.290 [DEBUG] [org.openhab.binding.knx             ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.profiles.ProfileAdvisor}={service.id=425, service.bundleid=244, service.scope=bundle, component.name=org.openhab.binding.knx.internal.profiles.KNXProfileAdvisor, component.id=282} - org.openhab.binding.knx
2018-03-26 17:24:39.291 [DEBUG] [org.openhab.binding.knx             ] - ServiceEvent REGISTERED - {org.openhab.binding.knx.KNXTypeMapper}={service.id=426, service.bundleid=244, service.scope=bundle, component.name=org.openhab.binding.knx.internal.dpt.KNXCoreTypeMapper, component.id=283} - org.openhab.binding.knx
2018-03-26 17:24:39.312 [DEBUG] [org.openhab.binding.knx             ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory}={service.id=427, service.bundleid=244, service.scope=bundle, component.name=org.openhab.binding.knx.internal.factory.KNXHandlerFactory, component.id=284} - org.openhab.binding.knx
2018-03-26 17:24:39.312 [DEBUG] [.thing.internal.GenericThingProvider] - ThingHandlerFactory added org.openhab.binding.knx.internal.factory.KNXHandlerFactory@1a51c34c
2018-03-26 17:24:39.313 [DEBUG] [.thing.internal.GenericThingProvider] - ThingHandlerFactory 'KNXHandlerFactory' claimed it can handle 'knx:ip' type but actually did not. Queued for later refresh.
2018-03-26 17:24:39.315 [DEBUG] [.thing.internal.GenericThingProvider] - Starting lazy retry thread
2018-03-26 17:24:39.315 [DEBUG] [.thing.internal.GenericThingProvider] - ThingHandlerFactory 'KNXHandlerFactory' claimed it can handle 'knx:device' type but actually did not. Queued for later refresh.
2018-03-26 17:24:39.316 [ERROR] [.thing.internal.GenericThingProvider] - Channel type knx:switch could not be resolved.
2018-03-26 17:24:39.317 [ERROR] [.thing.internal.GenericThingProvider] - Channel type knx:switch could not be resolved.
2018-03-26 17:24:39.318 [ERROR] [.thing.internal.GenericThingProvider] - Channel type knx:switch could not be resolved.
2018-03-26 17:24:39.319 [ERROR] [.thing.internal.GenericThingProvider] - Channel type knx:rollershutter could not be resolved.
2018-03-26 17:24:39.319 [ERROR] [.thing.internal.GenericThingProvider] - Channel type knx:rollershutter could not be resolved.
2018-03-26 17:24:39.320 [ERROR] [.thing.internal.GenericThingProvider] - Channel type knx:rollershutter could not be resolved.
2018-03-26 17:24:39.321 [ERROR] [.thing.internal.GenericThingProvider] - Channel type knx:rollershutter could not be resolved.
2018-03-26 17:24:39.321 [ERROR] [.thing.internal.GenericThingProvider] - Channel type knx:rollershutter could not be resolved.
2018-03-26 17:24:39.322 [ERROR] [.thing.internal.GenericThingProvider] - Channel type knx:rollershutter could not be resolved.
2018-03-26 17:24:39.322 [ERROR] [.thing.internal.GenericThingProvider] - Channel type knx:rollershutter could not be resolved.
2018-03-26 17:24:39.323 [ERROR] [.thing.internal.GenericThingProvider] - Channel type knx:rollershutter could not be resolved.
2018-03-26 17:24:39.323 [ERROR] [.thing.internal.GenericThingProvider] - Channel type knx:rollershutter could not be resolved.
2018-03-26 17:24:39.324 [ERROR] [.thing.internal.GenericThingProvider] - Channel type knx:rollershutter could not be resolved.
2018-03-26 17:24:39.324 [ERROR] [.thing.internal.GenericThingProvider] - Channel type knx:rollershutter could not be resolved.
2018-03-26 17:24:39.325 [ERROR] [.thing.internal.GenericThingProvider] - Channel type knx:rollershutter could not be resolved.
2018-03-26 17:24:39.325 [ERROR] [.thing.internal.GenericThingProvider] - Channel type knx:rollershutter could not be resolved.
2018-03-26 17:24:39.326 [ERROR] [.thing.internal.GenericThingProvider] - Channel type knx:rollershutter could not be resolved.
2018-03-26 17:24:39.326 [ERROR] [.thing.internal.GenericThingProvider] - Channel type knx:switch could not be resolved.
2018-03-26 17:24:39.327 [ERROR] [.thing.internal.GenericThingProvider] - Channel type knx:switch could not be resolved.
2018-03-26 17:24:39.328 [ERROR] [.thing.internal.GenericThingProvider] - Channel type knx:switch could not be resolved.
2018-03-26 17:24:39.329 [DEBUG] [.thing.internal.GenericThingProvider] - ThingHandlerFactory 'KNXHandlerFactory' claimed it can handle 'knx:device' type but actually did not. Queued for later refresh.
2018-03-26 17:24:39.329 [ERROR] [.thing.internal.GenericThingProvider] - Channel type knx:switch could not be resolved.
2018-03-26 17:24:39.330 [DEBUG] [.thing.internal.GenericThingProvider] - ThingHandlerFactory 'KNXHandlerFactory' claimed it can handle 'knx:device' type but actually did not. Queued for later refresh.


...
Remarks: 
- Above message "Channel type ... could not be resolved" is printed for all KNX channels (judged by the count)
- Above message "ThingHandlerFactory 'KNXHandlerFactory' claimed it can handle 'knx:device' type but actually did not. Queued for later refresh." is printed several times as well


2018-03-26 17:24:39.539 [DEBUG] [.thing.internal.GenericThingProvider] - Adding thing 'knx:ip:bridge' from model 'knx.things'.
2018-03-26 17:24:39.554 [DEBUG] [.thing.internal.GenericThingProvider] - Adding thing 'knx:device:bridge:generic' from model 'knx.things'.
2018-03-26 17:24:39.554 [DEBUG] [nx.internal.client.AbstractKNXClient] - Bridge knx:ip:bridge is disconnecting from the KNX bus
2018-03-26 17:24:39.559 [DEBUG] [nx.internal.client.AbstractKNXClient] - Bridge knx:ip:bridge is connecting to the KNX bus
2018-03-26 17:24:39.560 [DEBUG] [binding.knx.internal.client.IPClient] - Establishing connection to KNX bus on 192.168.10.15:3671 in mode TUNNEL.

2. Rollershutters can not be set to a percent value
With the KNX 1.x binding I could set a rollershutter to half closed by issuing “sendCommand(Rollaeden_Kueche, 50)”. With the KNX 2.x binding this has no effect. Moving the rollershutter by pressing the up or down arrows in the UI works as expected, so the configuration should be correct.

For reference the configuration for this rollershutter:

Channel in .things:

Type rollershutter           : Rollaeden_Kueche                                "Rollaeden Kueche"                                        [ upDown="4/2/100", stopMove="4/2/101", position="4/3/100" ]

Item:

Rollershutter Rollaeden_Kueche                                "Rolläden"                                                       (gKueche)                                                      { channel="knx:device:bridge:knx-1_1_101:Rollaeden_Kueche" }

3. KNX DPT 9.007 is not supported
This really is not an issue, as a simple workarround exists by using DPT 9.001 (Temperature) instead of 9.007 (Percent), but in KNX 1.x 9.007 worked as expected. But maybe this should be included in the documentation

Juelicher

Hello,

  1. Try to add status GAs for position and direction and use < sign so that OH can do read requests to KNX bus at startup. I use this channel configuration for rollershutters
upDown="2/1/0+<2/3/0", stopMove="2/2/0", position="2/4/0+<2/5/0"

2/1/0 is 1bit up/down control
2/3/0 is 1bit up/down direction status
2/2/0 is 1bit stop
2/4/0 is 1byte position control
2/5/0 is 1byte position status

3: Same issue here, but it isnt working with DPT 9.001 in my setup. I got values, but instead of 50% I got 0.50%. I created a issue on github (https://github.com/openhab/openhab2-addons/issues/3408)

I tried this, but no change in the behavior.

I will create entries for all three issues on github as well.

I added the following three issues on github:

https://github.com/openhab/openhab2-addons/issues/3414
https://github.com/openhab/openhab2-addons/issues/3415
https://github.com/openhab/openhab2-addons/issues/3416

The “Rollershutters can not be set to a percent value” could be resolved. The rule that sends the value was not triggered in the first place.

To discuss this problem I created a new topic: KNX 2: Received command rule trigger does not work