SpeedMaxX
(Markus Gevers)
July 13, 2017, 7:06pm
1
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
hmerk
(Hans-Jörg Merk)
July 14, 2017, 7:12am
2
Please try
gRolllaedenKueche.sendcommand(DOWN)
Why aren’t you using the Astro Binding with a negative offset for triggering your rule?
SpeedMaxX
(Markus Gevers)
July 14, 2017, 9:13am
3
Hi @hmerk ,
thanx. Could you give me a hint for your offset-solution?
would it be
"astro:sun:homeMinus60:rise#start"
Regards,
Markus
SpeedMaxX
(Markus Gevers)
July 15, 2017, 8:30pm
5
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
SpeedMaxX
(Markus Gevers)
July 16, 2017, 9:53am
6
Did not work. Can anyone help me?
SpeedMaxX
(Markus Gevers)
July 16, 2017, 12:18pm
7
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
Thetmar
(Thetmar)
August 6, 2017, 7:41pm
8
Hello Markus,
Does it work with your new rules? Im also intrested in your code
SpeedMaxX
(Markus Gevers)
August 6, 2017, 8:19pm
9
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
yves
(YvesHanoulle)
August 6, 2017, 8:21pm
10
Do I understand it correctly that these offsets make your events go of earlier?
SpeedMaxX
(Markus Gevers)
August 7, 2017, 11:50am
11
yes, but you have to take care on the events name, like “rise”.