I have set a couple of pistons that do the job but I’m not sure if it’s the most efficient way to do it
I need a light to turn on when a bunch of motion sensor detects motion or any door opens, and the light to turn off after 90 seconds of inactivity if a virual switch is off (i use it to deactivate the timer)
I set a Piston to turn on the light when the conditions are met, and then to launch another piston, which evaluates if the virtual switch is off and then run the 90 seconds timer, after it it turns off the light.
Apparently it works perfectly
Is there another way to do it? Maybe in a single piston?
I tried but whenever a condition (motion or door) became false, it killed the piston and so the timer, and the light remained lit on.