I have a small problem
I want to check when on the esp an event occurs if it is in the time between sunset and sunrise. If yes then turn light(GPIO 12,1) on otherwise ignore.
I have tried with time comparison but it does not work because of date change at midnight.
Code: Select all
If %systime%>%sunrise%
let,1,0
Endif
If %systime%<%sunset%
let,1,1
Endif
Second attempt. I set a variable to 1 when sunset and to 0 when sunrise.
Code: Select all
on Clock#Time=All,%sunrise% do
let,1,0
endon
on Clock#Time=All,%sunset-2h% do
let,1,1
endon
Does anyone have an idea how i can get the start after sunset?