I recently picked up a Gen 2 Zooz motion sensor, and I would like to use it in a manner that’s different from my other sensors. I’m placing the sensor right inside the bathroom door, and I would like it to turn on the lights when it’s first triggered, and to turn off when it’s triggered next, or it’s been 5 minutes. Since this particular sensor fires every 15 seconds and I’m only checking for motion by the door, I think this should be possible.
I’ve only ever written simple pistons that checked for motion, and end of motion. How would you write a piston that counts initial motion, and turns off at the next motion? Anything I’m not considering?
The bathroom is an L-shape.