I am not sure if I am supposed to use a virtual switch.
Idea: LDR measures light level. If light level is < 600 turn on LED and start a 5 second timer.
After 5 seconds turn off the LED.
If the light level is > 600 turn off the LED.
Here is what I have tried, but it doesn't work.
Code: Select all
on LDR#LightLevel<600 do
timerSet,1,5
gpio,0,1
endon
on Rules#Timer=1 do
gpio,0,0
endon
on LDR#LightLevel>600 do
gpio,0,0
endon