KNX Binding control switches in OH 2.4.0 does not work properly

Hi Community,

i set up my KNX binding including all channels (also one switch-control channel) in version 2.3.0. Everything worked fine, but since i updated to version 2.4.0 my control switch doesn’t work anymore. I also had the autoupdate problem, but solved the issue with a workaround from another Thread.

All of my KNX Switches are working, also all of my Hue Items are working how they are supposed to. The only Item/Channel that doesn’t work properly is my switch-control. It does switch my hue Lamp on and off, exactly if i would use the original Hue Switch Item, but it does not send or receive commands from the KNX System. Also i can turn the lamp on with my KNX Hardware Switch on my Wall, but not off again.

What should happen (and also worked like supposed to) is, when i turn the HueKnx control switch on/off, the “Musikzimmer” lamp and the Hue lamp both turn on/off.

Here my knx things file:

Bridge knx:ip:44aacde2 [                                                                                                //Bridge um mit dem KNX System zu kommunizieren, auch in Paper UI konfigurierbar
    ipAddress="192.168.178.***", 
    portNumber=3671, 
    localIp="192.168.178.***", 
    type="TUNNEL", 
    readingPause=50, 
    responseTimeout=10, 
    readRetriesLimit=3, 
    autoReconnectPeriod=1,
    localSourceAddr="0.0.0"
] {                                                                                                                     //KNX Gerät deffinieren (relativ egal ausschließlich um Channel erstellen zu können)
    Thing device KNXBus [
        address="1.2.3",
        fetch=false,
        pingInterval=0,
        readInterval=0
    ] {                                                                                                                 //Channel des Things | KNX Geräte
        Type switch:switchLichtFlurErstesOG             "Flurlicht 1.OG"                    [ga="1.001:2/4/0+<2/4/1"]
        
        Type switch:switchSpielzimmerLicht1      "Licht Spielzimmer"         [ga="1.001:2/5/0+<2/5/1"]
        Type switch:switchSpielzimmerVentilator  "Ventilator Spielzimmer"    [ga="1.001:2/5/2+<2/5/3"]

        Type switch:switchMusikzimmerLicht1             "Licht Musikzimmer"                 [ga="1.001:2/2/0+<2/2/1"]

        Type switch:switchBadezimmmerLicht1             "Deckenlicht Badezimmer"            [ga="1.001:2/1/0+<2/1/1"]
        Type switch:switchBadezimmerLicht2              "Wandlicht Badezimmer"              [ga="1.001:2/1/2+<2/1/3"]

        Type switch:switchSchlafzimmerLicht1            "Deckenlicht Schlafzimmer vorne"    [ga="1.001:2/0/0+<2/0/1"]
        Type switch:switchSchlafzimmerLicht2            "Deckenlicht Schlafzimmer Bett"     [ga="1.001:2/0/2+<2/0/3"]
        Type switch:switchSchlafzimmerVentilator        "Ventilator Schlafzimmer"           [ga="1.001:2/0/4+<2/0/5"]
                                                                                                                        //Weitere Channel | KNX fremde Geräte (Hue)
        Type switch-control:controlSwitchHueStehlampe   "Hue Stehlampe"                     [ga="1.001:2/2/0+<2/2/1"]                                                                                           
    }
}

And here my knx item file:

Group:Switch AllLights "Alle Lichter" 
Group:Switch AllVentilatoren "Alle Ventilatoren"

// !Achtung! Autoupdate Funktion der KNX Channels sind ein Workaround für  das aktuelle Autoupdate für die aktuelle  OpenHAB stable Version 2.4.0
Switch FlurErstesOGLampe            "Licht Flur 1.OG" <light> (AllLights)                           {channel="knx:device:44aacde2:KNXBus:switchLichtFlurErstesOG", autoupdate="true"}

Switch SpielzimmerLampe1     "Licht Spielzimmer" <light> (AllLights)               {channel="knx:device:44aacde2:KNXBus:switchSpielzimmerLicht1", autoupdate="true"}
Switch SpielzimmerVentilator "Ventilator Spielzimmer" <ventilator> (AllVentilatoren)   {channel="knx:device:44aacde2:KNXBus:switchSpielzimmerVentilator", autoupdate="true"}

Switch MusikzimmerLampe1            "Licht Musikzimmer" <light> (AllLights)                         {channel="knx:device:44aacde2:KNXBus:switchMusikzimmerLicht1", autoupdate="true"}

Switch BadezimmerLampe1             "Deckenlicht Badezimmer" <light> (AllLights)                    {channel="knx:device:44aacde2:KNXBus:switchBadezimmmerLicht1", autoupdate="true"}
Switch BadezimmerLampe2             "Wandlicht Badezimmer" <light> (AllLights)                      {channel="knx:device:44aacde2:KNXBus:switchBadezimmerLicht2", autoupdate="true"}

Switch SchlafzimmerLampe1           "Schlafzimmerlicht vorne" <light> (AllLights)                   {channel="knx:device:44aacde2:KNXBus:switchSchlafzimmerLicht1", autoupdate="true"}
Switch SchlafzimmerLampe2           "Schlafzimmerlicht Bett" <light> (AllLights)                    {channel="knx:device:44aacde2:KNXBus:switchSchlafzimmerLicht2", autoupdate="true"}
Switch SchlafzimmerVentilator       "Ventilator Schlafzimmer" <ventilator> (AllVentilatoren)        {channel="knx:device:44aacde2:KNXBus:switchSchlafzimmerVentilator", autoupdate="true"}

//Hue Stehlampe als KNX Device
Switch HueStehlampeKNX              "Hue Stehlampe" <light>                                         {channel="hue:0100:00178862b959:2:brightness", channel="knx:device:44aacde2:KNXBus:controlSwitchHueStehlampe", autoupdate="true"}

Here some log entries:

2019-02-26 10:04:53.229 [ome.event.ItemCommandEvent] - Item 'MusikzimmerLampe1' received command ON
2019-02-26 10:04:53.233 [vent.ItemStateChangedEvent] - MusikzimmerLampe1 changed from OFF to ON
2019-02-26 10:04:53.233 [GroupItemStateChangedEvent] - AllLights changed from OFF to UNDEF through MusikzimmerLampe1
2019-02-26 10:04:57.879 [ome.event.ItemCommandEvent] - Item 'MusikzimmerLampe1' received command OFF
2019-02-26 10:04:57.884 [GroupItemStateChangedEvent] - AllLights changed from UNDEF to OFF through MusikzimmerLampe1
2019-02-26 10:04:57.886 [vent.ItemStateChangedEvent] - MusikzimmerLampe1 changed from ON to OFF
2019-02-26 10:04:58.934 [ome.event.ItemCommandEvent] - Item 'HueStehlampeKNX' received command ON
2019-02-26 10:04:58.937 [vent.ItemStateChangedEvent] - HueStehlampeKNX changed from OFF to ON
2019-02-26 10:05:00.926 [vent.ItemStateChangedEvent] - Light2_Toggle changed from OFF to ON
2019-02-26 10:05:00.927 [vent.ItemStateChangedEvent] - Light2_Dimmer changed from 0 to 31
2019-02-26 10:05:00.982 [ome.event.ItemCommandEvent] - Item 'HueStehlampeKNX' received command OFF
2019-02-26 10:05:00.988 [vent.ItemStateChangedEvent] - HueStehlampeKNX changed from ON to OFF

That happens if i turn the KNX Wall Switch on:

2019-02-25 20:22:39.977 [hingStatusInfoChangedEvent] - 'hue:0100:00178862b959:2' changed from OFFLINE: Die Hue Bridge meldet, dass die Lampe nicht erreichbar ist. to ONLINE

Thanks for all replies and sorry for my englisch :slight_smile:

Hello Alexander,
did you try switching the order in which you link the channels to HueStehlampeKNX ?
Try putting the knx channel in front of the hue channel.
I experienced some strange behaviour like that which was solved be reordering the channels.
Don´t ask me why… just worth giving it a try.

Hello Oggerschummer,
thanks for the advice, tried to change the order of the channels, unfortunately didn’t work. Still only switching the Hue device and no commands to the KNX Bus.

I set my logging for knx to TRACE now. Maybe anyone can help me with this problem. Here are some log entries i got from knx:

2019-02-28 08:10:20.704 [TRACE] [.internal.handler.DeviceThingHandler] - Handling command 'OFF' for channel 'knx:device:44aacde2:KNXBus:controlSwitchHueStehlampe'
2019-02-28 08:10:20.705 [TRACE] [.knx.internal.channel.KNXChannelType] - getCommandSpec testing Keys '[ga]' for command 'OFF'
2019-02-28 08:10:20.705 [TRACE] [.knx.internal.channel.KNXChannelType] - getCommandSpec key 'ga' uses expectedTypeClass 'class org.eclipse.smarthome.core.library.types.OnOffType' witch isInstance for command 'OFF' and dpt '1.001'
2019-02-28 08:10:20.705 [TRACE] [nx.internal.client.AbstractKNXClient] - writeToKNX groupAddress '2/2/0', commandSpec 'org.openhab.binding.knx.internal.channel.WriteSpecImpl@549ebd7a'
2019-02-28 08:10:20.705 [TRACE] [nx.internal.client.AbstractKNXClient] - sendToKNX mappedValue: 'off' groupAddress: '2/2/0'
2019-02-28 08:10:20.726 [DEBUG] [nx.internal.client.AbstractKNXClient] - Wrote value 'OFF' to datapoint 'command DP 2/2/0 'knx:ip:44aacde2', DPT id 1.001, low priority' (0. attempt).
2019-02-28 08:10:20.727 [TRACE] [.internal.handler.DeviceThingHandler] - rememberRespondingSpec handled commandSpec for '2/2/0' size '1' added 'true'
2019-02-28 08:10:20.727 [TRACE] [.internal.handler.DeviceThingHandler] - Handling command 'OFF' for channel 'knx:device:44aacde2:KNXBus:controlSwitchHueStehlampe'
2019-02-28 08:10:20.727 [TRACE] [.knx.internal.channel.KNXChannelType] - getCommandSpec testing Keys '[ga]' for command 'OFF'
2019-02-28 08:10:20.727 [TRACE] [.knx.internal.channel.KNXChannelType] - getCommandSpec key 'ga' uses expectedTypeClass 'class org.eclipse.smarthome.core.library.types.OnOffType' witch isInstance for command 'OFF' and dpt '1.001'
2019-02-28 08:10:20.728 [TRACE] [nx.internal.client.AbstractKNXClient] - writeToKNX groupAddress '2/2/0', commandSpec 'org.openhab.binding.knx.internal.channel.WriteSpecImpl@29a9a5a2'
2019-02-28 08:10:20.728 [TRACE] [nx.internal.client.AbstractKNXClient] - sendToKNX mappedValue: 'off' groupAddress: '2/2/0'
2019-02-28 08:10:20.748 [DEBUG] [nx.internal.client.AbstractKNXClient] - Wrote value 'OFF' to datapoint 'command DP 2/2/0 'knx:ip:44aacde2', DPT id 1.001, low priority' (0. attempt).
2019-02-28 08:10:20.749 [TRACE] [.internal.handler.DeviceThingHandler] - rememberRespondingSpec handled commandSpec for '2/2/0' size '1' added 'true'
2019-02-28 08:10:20.749 [TRACE] [.internal.handler.DeviceThingHandler] - Handling command 'OFF' for channel 'knx:device:44aacde2:KNXBus:controlSwitchHueStehlampe'
2019-02-28 08:10:20.749 [TRACE] [.knx.internal.channel.KNXChannelType] - getCommandSpec testing Keys '[ga]' for command 'OFF'
2019-02-28 08:10:20.749 [TRACE] [.knx.internal.channel.KNXChannelType] - getCommandSpec key 'ga' uses expectedTypeClass 'class org.eclipse.smarthome.core.library.types.OnOffType' witch isInstance for command 'OFF' and dpt '1.001'
2019-02-28 08:10:20.750 [TRACE] [nx.internal.client.AbstractKNXClient] - writeToKNX groupAddress '2/2/0', commandSpec 'org.openhab.binding.knx.internal.channel.WriteSpecImpl@20c7cb33'
2019-02-28 08:10:20.750 [TRACE] [nx.internal.client.AbstractKNXClient] - sendToKNX mappedValue: 'off' groupAddress: '2/2/0'
2019-02-28 08:10:20.770 [DEBUG] [nx.internal.client.AbstractKNXClient] - Wrote value 'OFF' to datapoint 'command DP 2/2/0 'knx:ip:44aacde2', DPT id 1.001, low priority' (0. attempt).
2019-02-28 08:10:20.771 [TRACE] [.internal.handler.DeviceThingHandler] - rememberRespondingSpec handled commandSpec for '2/2/0' size '1' added 'true'

When using a *-control channel, openHAB acts as the actuator, so you will receive commands but you can’t send commands to the knx bus. The only thing you can send to knx is a status.

Type switch-control:controlSwitchHueStehlampe "Hue Stehlampe" [ga="1.001:2/2/0+<2/2/1"]

openHAB will receive commands from 2/2/0 and from 2/2/1, but it will send status updates only to 2/2/0. openHAB will NOT ask for a status at startup, as openHAB holds the status itself (openHAB is the actuator), so please omit the <

Type switch:switchMusikzimmerLicht1 "Licht Musikzimmer" [ga="1.001:2/2/0+<2/2/1"]

Now what? you’ve got a real knx actuator at the same GA? That’s ok for the command part, but not for the status GA. Sending a status you have to define an exclusive GA for each channel (in the meaning of switches, dimmers and so on)