Open/close rooflight with KNX rollershutter

Hi folks,

From what I see in the examples, rollershutter for the KNX binding works in a way that up/down share one group address:

/* Rollershutters Up/Down, Stop/Move */
Rollershutter Shutter_GF_Living “Shutter” (GF_Living, Shutters) { knx=“4/2/10, 4/2/11” }

Unfortunately my setup is a little different. I don’t have a dedicated KNX shutter actor but use “longpress” on a switch interface together with a regular switch actor.

As a result I have one GA for OPEN (5/0/0) and another one for CLOSE (5/0/1).

So now my question is how I could best “emulate” a longpress in Openhab and can I somehow combine that with a “rollershutter” item?

Regards,
Bjoern

rule "light"
	when 
		Item Rollershutter Shutter_GF_Living received command DOWN   
	then
		sendCommand(someitem, ON)
		
end		

if i understood your question correctly!!!

Solved it myself in the meantime. Credits go to https://zukunftathome.de/workaround-garagentor-ueber-knx-anbinden-und-mit-openhab-steuern/ for the following solution:

.rules

var boolean windowActive = false
rule "Dachfenster"
when
Item Dachfenster_Steuerung received command
then
	if (receivedCommand == UP && windowActive == false) {
		windowActive = true
		Dachfenster_Auf.sendCommand(ON)
		Thread::sleep(50000)
		Dachfenster_Auf.sendCommand(OFF)
		windowActive = false
	}
	else if (receivedCommand == DOWN && windowActive == false) {
		windowActive = true
		Dachfenster_Zu.sendCommand(ON)
		Thread::sleep(50000)
		Dachfenster_Zu.sendCommand(OFF)
		windowActive = false
	}
	else if (receivedCommand == STOP) {
		Dachfenster_Auf.sendCommand(OFF)
		Dachfenster_Zu.sendCommand(OFF)
		windowActive = false
	}
end

.items

Switch Dachfenster_Auf "Dachfenster Auf" {knx="5/0/0+<5/0/2"}
Switch Dachfenster_Zu "Dachfenster Zu" {knx="5/0/1+<5/0/3"}
Rollershutter Dachfenster_Steuerung "Dachfenster"

.sitemaps

Switch item=Dachfenster_Steuerung

“Sleep” is defined as 50s because the window takes ~45s to fully open/close.

5/0/0 is GA for open and 5/0/1 for close. 5/0/2 and 5/0/3 are the corresponding blocking objects but not sure if blocking really works as it should…