I’m finally giving up on this 
I couldn’t get the “who called” string working, so as a last resort I tried
and bingo, this gives me a nice switch which only gets triggered (state update to ON) when the physical momentary switches are pressed:
Switch FibFGR222_Kitchen_East_Manual_UP_1x "Kitchen East Manual UP 1x [%d %%]" {zwave="11:command=SCENE_ACTIVATION,scene=16,state=0"}
and
Switch FibFGR222_Kitchen_East_Manual_DOWN_1x "Kitchen East Manual DOWN 1x [%d %%]" {zwave="11:command=SCENE_ACTIVATION,scene=26,state=0"}
Now I thought it’s easy to setup some logic rule, but I’m still struggling.
The complete rule can be found here:
http://pastebin.com/skJWCbJd
The part which doesn’t work as expected is:
rule "shading kitchen east"
when
Item Shading_tempDiff_Proxy received update
then
if (Night_Proxy.state==OFF &&
((Sun_Az.state > 80 && Sun_Az.state < 140) &&
(Sun_El.state > 10 && Sun_El.state < 40)) ) {
if (Shading_Shutter_Proxy.state==ON) {
if (!ShutterOverrideEast) {
if (Shading_tempDiff_Proxy.state >= 15) {
if (ShutterDelayTimerKitchen_East!=null) {
ShutterDelayTimerKitchen_East.cancel
ShutterDelayTimerKitchen_East = null
logInfo("FILE", "Shutter Delay Timer East reset because sunshine was detected, but timer was active")
}
FibFGR222_Kitchen_East.sendCommand(ShadingKitchenEastPosition)
logInfo("FILE", "shading kitchen east active, shutters are down")
}
if (Shading_tempDiff_Proxy.state <= 14) {
logInfo("FILE", "shading kitchen east temporary terminated, starting 30 min timer")
ShutterDelayTimerKitchen_East = createTimer(now.plusMinutes(30)) [|
if (FibFGR222_Kitchen_East.state != UP) {
FibFGR222_Kitchen_East.sendCommand(UP)
logInfo("FILE", "ShutterDelayTimer_East has expired, shutters are up")
}
]
}
}
else if (ShutterOverrideEast) {
logInfo("FILE", "shading kitchen east overridden, starting 3 hour timer")
ShutterOverrideTimerKitchen_East = createTimer(now.plusMinutes(180)) [|
logInfo("FILE", "ShutterOverrideTimer_East has expired, override set to false")
ShutterOverrideEast=false
]
}
}
}
else
logInfo("FILE", "shading kitchen east permanently deactivated, it's night or activation conditions not met")
end
My goal was to have the shutters down when sun is detected, then have a 30 minutes delay if no sun is detected and after the timer has expired the shutters should go up again.
If in the meantime during the 30 minutes timer delay sun is detected again the timer should be cancelled and the shutters should stay down.
In addition to that if a physical switch is pressed, a 3 hours timer should start and after expiration give control back to the “auto” rules.
I tried to do this part by part and then put all pieces together, but the final step (putting all pieces together) is not possible with my programming skills.
If anybody has an idea with which logic I have to start or could take a look at the rule excerpt above to tell me if I am on the wrong track would be very much appreciated.
Thanks.