Countdown timers (user variable)
Posted: Saturday 19 May 2018 8:30
I would like to make a blockly event that will turn a lamp on if there is movement detected and the lamp is currently off. Then I would also like that event to start a countdown timer (in a similar way as setting a user variable) for n seconds which automatically countsdown seperate from the blockly event.
With another blockly event I would like to set that timer back to n seconds if movement is detected.
Finally I would like to make a third blockly event that turns the light off when the timer reaches 0 seconds.
By doing it like this I can seperate movement sensor light actions easiliy from wallswitches. A wallswitch will now set the timer to -1 or sonething (not triggering the blockly to turn off the light) and it can switch the light on or off based on the current light status. (I have multiple wallswitches for one light)
Countdown timers could be added within the user variables. If we just have the option to make an integer variable a automatic countdown one I would be able to do the things I want. (you could also allow for setting to countdown seconds/minutes/hours)
With another blockly event I would like to set that timer back to n seconds if movement is detected.
Finally I would like to make a third blockly event that turns the light off when the timer reaches 0 seconds.
By doing it like this I can seperate movement sensor light actions easiliy from wallswitches. A wallswitch will now set the timer to -1 or sonething (not triggering the blockly to turn off the light) and it can switch the light on or off based on the current light status. (I have multiple wallswitches for one light)
Countdown timers could be added within the user variables. If we just have the option to make an integer variable a automatic countdown one I would be able to do the things I want. (you could also allow for setting to countdown seconds/minutes/hours)