Rollershutter problem

Hi, I want to close my rollershutters with an offset to sunset.

rule "Rolllaeden Küche schließen 1 h vor Sonnenuntergang"
when
Time cron "0 0/13 * 1/1 * ? *"
then
 var DateTime sundownOffset = (new DateTime((Sunset_Time.state as DateTimeType).cale$    if(sw_Urlaub.state == ON && now.isAfter(sundownOffset))
{
  sendCommand(gRolllaedenKueche, DOWN)
}
end

When the rule is triggered, the shutters only react for a moment, nothing more.

Any idea where my mistake is?
Regards, Markus

Please try

gRolllaedenKueche.sendcommand(DOWN)

Why aren’t you using the Astro Binding with a negative offset for triggering your rule?

Hi @hmerk,

thanx. Could you give me a hint for your offset-solution?

would it be

"astro:sun:homeMinus60:rise#start"

Regards,
Markus

Exactly

Hi,

now I got this:

rule "Rolllaeden Küche öffnen 2 h nach Sonnenaufgang"
when     
    Channel 'astro:sun:homePlus120:rise#event' triggered START
then
    sendCommand(gRolllaedenKueche, UP) 
end

Would it work? I’ll check this tomorrow morning :slight_smile:

Did not work. :thinking: Can anyone help me?

ok, I think, I had to define the things first …

Now I have:

// sun-settings
astro:sun:home [ geolocation="x,y", interval=60]
astro:sun:homeMinus60 [ geolocation="x,y", interval=60 ] {
    Channels:
        Type rangeEvent : rise#event [
            offset=-60
        ]
}
astro:sun:homeMinus120 [ geolocation="x,y", interval=60 ] {
    Channels:
        Type rangeEvent : rise#event [
            offset=-120
        ]
}
astro:sun:homePlus60 [ geolocation="x,y", interval=60 ] {
    Channels:
        Type rangeEvent : rise#event [
            offset=60
        ]
}
astro:sun:homePlus120 [ geolocation="x,y", interval=60 ] {
    Channels:
        Type rangeEvent : rise#event [
            offset=120
        ]
}

// moon-settings
astro:moon:home [ geolocation="x,y", interval=60]
astro:moon:homeMinus60 [ geolocation="x,y", interval=60 ] {
    Channels:
        Type rangeEvent : rise#event [
            offset=-60
        ]
}
astro:moon:homeMinus120 [ geolocation="x,y", interval=60 ] {
    Channels:
        Type rangeEvent : rise#event [
            offset=-120
        ]
}
astro:moon:homePlus60 [ geolocation="x,y", interval=60 ] {
    Channels:
        Type rangeEvent : rise#event [
            offset=60
        ]
}
astro:moon:homePlus120 [ geolocation="x,y", interval=60 ] {
    Channels:
        Type rangeEvent : rise#event [
            offset=120
        ]
}

I’ll report …

1 Like

Hello Markus,

Does it work with your new rules? Im also intrested in your code :wink:

Hi, yes, It worked, but the tricky thing is that you have to define an astro-thing for the offsets first. After that, it works

Do I understand it correctly that these offsets make your events go of earlier?

yes, but you have to take care on the events name, like “rise”.