Jump to content

How to use motion sensor to trigger "stay" mode?


max90034

Recommended Posts

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.

Link to comment

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.

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...