KNX: How to get received command working?

I’ve got a physical switch on the wall with 2 buttons configured as respectively ON and OFF. I also have rule that should trigger in case ON is pressed (and a different rule in case OFF is pressed).

The rule works fine when configured as:

    when
		Item Projector_schakelen changed from OFF to ON
	then

However, it does not work when configured as:

    when
		Item Projector_schakelen received command ON
	then

I really would like to use the 2nd rule (due to reasons which are not important here).

My thing is configured as following:

        Thing device 5094TSM_living "Push button living" @ "KNX"
        {
            Type switch : Channel_84 "Projector aan/uit" [ ga="1.001:3/4/0" ] 
        }

And my item file is configured as following:

Switch Projector_schakelen  "Projector schakelen" {channel="knx:device:BAOS771:5094TSM_living:Channel_84"}

So when I press the physical ON push button on the wall, a 3/4/0 telegram is sent on the knx bus, which then switches the item “projector schakelen” from OFF to ON (or vica versa). In my log file I also read"Projector_schakelen changed from OFF to ON". Now how can I alter this so it states “Projector_schakelen received command ON”, so my second rule also works?

Isn’t this what xxx-control type channels are for?

That was also my initial thought, but couldn’t get it working with the wwitch-control type either…

You definitely have to use switch-control to receive commands:

Thing device 5094TSM_living "Push button living" @ "KNX"
    {
        Type switch-control : Channel_84 "Projector aan/uit" [ ga="1.001:3/4/0" ] 
    }

maybe don’t set the DPT…

Type switch-control : Channel_84 "Projector aan/uit" [ ga="3/4/0" ] 

Of course, 3/4/0 has to be the GA which is sent from the wall switch :slight_smile:
If you want to send a status to the wall switch, be aware that the status GA has to be the first GA:

Type switch-control : Channel_84 "Projector aan/uit" [ ga="3/4/1+3/4/0" ] 

So, openHAB will send the state to 3/4/1 but will receive commands from 3/4/0.

1 Like

Yep, got it to work finally. Didn’t work initially, but then I cleared the cache, removed tmp files & restarted openhab after which it worked. thx!