How to create a switch to set Rollershutter to 50%

Hi guys,

I hope you can help me to set up a switch that sets my rollershutter down to 50%. I have no idea about the command… Thanks in advance!

ps it´s about an homematic item and I guess it must look sth. like this:

Dimmer Light “Light [%d %%]” { channel=“homematic:HM-LC-Dim1T-Pl-2:ccu:JEQ0555555:1#LEVEL” }

Hi John (@siod),

I recommend to define a new Switch item that triggers a rule. There you send the command to go to 50% (either directly - if that’s supported, or with a timer). If you are new to rules, please have a look how they work …

import java.util.concurrent.locks.ReentrantLock

val ReentrantLock _lockSchattenprogramm = new ReentrantLock()

rule SchattenprogrammON
  when
    Item ItemSceneSchattenprogramm changed to ON
  then
    println("Schattenprogramm => ON")
    if (!_lockSchattenprogramm.locked) {
    	try {
    	  _lockSchattenprogramm.lock
    	  
    	  GroupRollerShutterShadowGarden.sendCommand(UP)
    	  GroupRollerShutterShadowGarage.sendCommand(UP)
    	  GroupRollerShutterShadowZufahrt.sendCommand(UP)
    	  
    	  // Time to open ~20s
    	  createTimer(now.plusSeconds(20)) [| 
      	    GroupRollerShutterShadowGarden.sendCommand(DOWN)
    	    GroupRollerShutterShadowGarage.sendCommand(DOWN)
    	    GroupRollerShutterShadowZufahrt.sendCommand(DOWN)
    	  	
    	  	  // close 50% ...
    	  	 createTimer(now.plusSeconds(10)) [|
    	       GroupRollerShutterShadowGarage.sendCommand(STOP)
    	       GroupRollerShutterShadowZufahrt.sendCommand(STOP)
    	       createTimer(now.plusSeconds(5)) [| GroupRollerShutterShadowGarden.sendCommand(STOP)]    	  	  	
    	  	 ]
    	   ] 
    	      	  	
    	} finally {
    	  _lockSchattenprogramm.unlock
    	}
    } else {
    	println("Schattenprogramm - locked!")
    }
  end

with kind regards,
Patrik

thanks for your quick reply! You said:

There you send the command to go to 50% (either directly - if that’s supported, or with a timer)

And that´s the one more question I have: is it possible to set it directly in the homematic binding or not. Who could tell me that?
Your supposed way is excellent, but I would prefer the direct way if possible…

Hi John (@siod),

you can just give it a try by sending the command to go to 50 directly - then you’ll see if it’s supported or you have to use the timer approach. A rule you’ll need with both approaches.

with kind regards,
Patrik