I’m running Openhabian 2.3.0. Loaded the Astro binding on PaperUI. The following is not working for me, please advise what I’m doing wrong. I’m looking for a rule to run at the following times:
30 minutes prior to sunset
At sunset
At sunrise
30 minutes after sunrise
I have tried “rise”/“set” instead of “daylight” and neither work.
Looking at the log I received a message saying the “Internal_Daylight_End2” item has changed to a date in the future, however, that date in the future occurs, and my log entry doesn’t show. Just as a note, I have other logInfo rules, and they show so I know it’s not the logger.
@ktech here is my rule and my things file. This works for me with no issue. I struggled with this a little also. I am using the start trigger you were trying the end. I am not sure the exact difference. I know mine triggers 30 minutes prior to sunset. I believe you were missing the range event from your thing declaration. Hope this helps.
rule "Turn porch light on at Sunset"
when
Channel 'astro:sun:minus30:set#start' triggered START
then
logInfo("rules", "S It's sunset, I'm turning the porch light on")
end
//===============================================================================
val String filename = "astro-rules"
rule "Sunset_180 Start"
when
Channel 'astro:sun:stowing:set#event' triggered START
then
logInfo(filename + "_03", "Sunset_180 Start. START")
//EG_EG_Kind2_Licht.sendCommand(ON)
end
//===============================================================================
rule "Sunset_180 Ende"
when
Channel 'astro:sun:stowing:set#event' triggered END
then
logInfo(filename + "_04", "Sunset_180 Ende. END")
//EG_EG_Kind2_Licht.sendCommand(ON)
end
//===============================================================================
rule "Sunrise Start"
when
Channel 'astro:sun:local:rise#event' triggered START
then
logInfo(filename + "_05", "Sunrise START ")
//EG_EG_Kind2_Licht.sendCommand(ON)
end
//===============================================================================
rule "Mittag Start"
when
Channel 'astro:sun:local:noon#event' triggered START
then
logInfo(filename + "_06", "Mittag - noon. START")
//Sonoff_Basic_03.sendCommand(ON)
end
//===============================================================================
The first two Rules will be fired, when the offset time of your thing ( astro:sun:stowing) is reached, the other two Rules interact with the “normal” thing ( astro:sun:local).
You don’t need any items (as far as I know ) to test the set.
For me this work quite fine. And I have created a lot more testing rules (and itmes) for the astro-binding to understand what’s going on.
Have fun with testing.
Peter
I was trying to do the offsets with the “start”/“stop” types instead of rangeEvent because I thought the thing must be called “astro:sun:local”, instead of replacing the “local” with other descriptors. I was able to do what I needed by creating multiple astro things, and using the rangeEvent type as described. Thanks!