rule "Sunset"
when
Channel 'astro:sun:home:set#event' triggered START
then
IsItDark.postUpdate(ON)
end
rule "Sunrise"
when
Channel 'astro:sun:home:rise#event' triggered START
then
IsItDark.postUpdate(OFF)
end
rule "Do stuff on button press if its after sunset"
when
Item alarm_switch received command ON
then
if (IsItDark.state == ON) {
// do this
} else {
// do that
}
end
It may be for now.
My advice.
Read the DP and then copy the code. I don’t mean copy and paste. I mean write the code yourself, line by line.
I my experience this is still the best way to understand code.
Write it or copy it. Understand it. When you copy it line by line your understanding of it will come.