1) Give a description of the problem
Need to turn on two lights when theres motion on one sensor. Nothing should happen if the lights are already turned or if the TV is on.
I’ve handled all those conditions. Lights turn on when they should and they obey rules regarding swtich being on and TV being on.
The real problem I’m having is turning them off. I need for both of them to be turned off if there hasn’t been any motion in X minutes.
2) What is the expected behavior?
Lights should turn on with motion (WORKS)
Lights should do nothing if the switch is already on or if the TV is on (WORKING)
Lights should both turn off when there’s no motion in X minutes (NOT WORKING)
3) What is happening/not happening?
Can’t find the logic required for the lights to turn on after X minutes. I’ve tried multiple variations of “stays off for x minutes” and adding “wait for x minutes” before the off command.
I’m pretty sure I know what’s going on but can’t find a way to prevent it. Currently I have it so once the motion detector motion changes to inactive to turn them off after waiting 5 minutes. My guess is that once that 5 minutes timer starts it keeps counting down even though motion is detected again. Thus if you leave the area for 30 seconds (time it takes for the sensor to go back to inactive) then return (sensor changes to active) the light still turns off after a while.
**4) Post a Green Snapshot of the piston!
I really love the idea of webcore and the potential behind it but its really frustrating for me. I keep coming with piston ideas that in my mind seem very straight forward but then I turn them into a mess when trying them out; there’s always something that won’t work as expected that I never thought off