How do i reset a timer?

variables

#1

Hi,

I am looking for a way to reset the timer in my piston. I use a switch to turn on the light, which goes off after 1 minute.
What i would like it to do is reset the timer when motion gets detected. I tried a few things but cannot figure out how to do this.

Any suggestions are welcome. Thanks!


#2

hi @john010
Have you tried CANCEL ALL PENDING TASKS???

and what is it you want in the room? If you can describe A to Z, there might be a different way of doing it.


#3

This is to control the lighting in the hallway. Theres another piston for the usual state of the lighting/motion.
The piston im talking about right now overrules the other by clicking a button. Once the button gets pushed the light go to full 100%. There are 2 motion detectors in the room which i want to reset the timer so the light stays on when the room is occupied. This all is for the laundry room.


#4

I have a feeling that you can bring everything down to a single piston? (i am not sure of course)

But anyway,
If what you want is,

  • No lights is the room (or dimmed)
  • When someone enters, lights go 100%
  • as long as they are in the room, lights WONT turn off
  • when they leave lights go OFF

you don’t need to use a timer for this. Something like this will make it way easier:

IF ANY motion sensor(s) CHANGES TO ACTIVE
Then
With lights TURN ON (or set level to 100)

If ALL motion sensors STAYS INACTIVE X minutes (this part replaces your timer)
Then
With lights TURN OFF (or set level to 10) (if you want dimmed)

ANY and ALL are very important.
“Any” says which ever motion sensor in the room.
“ALL” says make sure there is no motion what so ever in the room.

And of course you can add if SWITCH IS PUSHED etc…


#5

Its not exactely what i meant, but to replace the timer part how you suggested might be a good idea.
The main difference is that i only want to activate by pressing a button and not by motion.
But to deactivate i do want to use the motion detectors.
I tried what you suggested, but the lights wont go off.


#6

Make the ‘stays inactive’ a separate if. When triggered a piston always runs top to bottom so it looks and sees the button hasn’t been pushed so doesn’t turn the lights off. If you take it outside the other if, it will run.


#7

Works. Thanks!


#8

Yes two seperate IFs