Saved a rule “donker.rules” in the rules-folder:
Is this the right syntax?
rule “sunrise”
when
Item Sunrise_Event received update ON
then
Item sunset==ON
end
rule “sunset”
when
Item Sunset_Event received update ON
then
Item sunset==OFF
end
do I need the make the items sunset_event and sunrise_event in the items-file?
or are these kinda ‘stock’-items which are already in the astro-binding?
edit : sunset is a switch-item in my items-file
edit : I did it this way as I understood the moment it gets dark, the Sunset_Event gets a brief ‘ON’ and is then back to ‘OFF’
I want to trigger (on for a second or less) gpio7 at sunset when item (Presence) is OFF
and at sunrise trigger (on for a second or less) gpio8 when item (Presence) is OFF
So I thought I needed to save the ‘state’ of sunset/rise somewhere before using it in another rule.
This is my next try:
(don’t know how to write all the syntax)
rule-file:
rule “simulateMORNING”
when
Item Sunrise received update ON
then
if (Item Precense==OFF) {
Item Gpio7 setvalue(ON)
}
end
rule “simulateEVENING”
when
Item Sunset received update ON
then
if (Item Precense==OFF) {
Item Gpio8 setvalue(ON)
}
end