Hello peoples...
I'm a bit confused about how to Work with timers in SH.py.
eg if i want a Motion detector to turn on a light for 5 min and reset every time the detector input goes high - and if no activity within 5 minutes - turn the light off...
Could i use the timer function, and do something like:
IF Motion1 == True:
Light1 = 100%
Timer(5m,0%)
So when the Motion becomes true, set light to 100% and set a timer to set it to 0%?
Could some one please give a short code sample of how to do that? I'm planning to create different timers in the same logic file
Thanks
I'm a bit confused about how to Work with timers in SH.py.
eg if i want a Motion detector to turn on a light for 5 min and reset every time the detector input goes high - and if no activity within 5 minutes - turn the light off...
Could i use the timer function, and do something like:
IF Motion1 == True:
Light1 = 100%
Timer(5m,0%)
So when the Motion becomes true, set light to 100% and set a timer to set it to 0%?
Could some one please give a short code sample of how to do that? I'm planning to create different timers in the same logic file

Thanks
Kommentar