max90034 Posted January 14, 2014 Posted January 14, 2014 I am using state variable to identify "stay" (0 value) vs "away" (1 value) mode and then to control thermostats, etc. I would like to use activation of the motion sensor ( when I am back home) to change its value from 1 to 0. The problem I have is that my motion sensor stays On for 30 sec ( or so) after event. It means that when I am leaving home and set state var to 1, it will detect my motion and change it back to zero. How can I write a program to ignore motion sensor response for 1 min after I change the state of the var from 0 to 1 and only after that to make it possible the sensor event changing state var value 1->0? Thanks much.
KMan Posted January 14, 2014 Posted January 14, 2014 If you are using a program to change the state variable from 0 -> 1, and you don't need it to go to 1 immediately when the program runs ... you could just add a "wait 30 seconds" before setting the state varible to 1. (Hard to know for sure if this would work without seeing the whole program though!) Otherwise, if you need the state variable to go to 1 immediately, then you'll likely need another variable that changes value 30 seconds after the state variable is set to 1 (could be done with a wait as above). And then condition the motion sensor program on that new variable.
max90034 Posted January 16, 2014 Author Posted January 16, 2014 It seems to be working. Great. Thanks.
Recommended Posts