Motion timer reset

Im just getting started with Vera and am going crazy.

All I want to do is have a light come on and stay on as long as there is movement detected and only be turned off when there is no movement detected for 2 minutes. I have spent hours looking through forums and cant seem to work out how to do it. I’ve tried Scripts and PLEG and am having no success. I am using UI7 so smart switch doesn’t work so that’s not an option. The script that is on the micasa forum doesn’t work for me. The only thing that I can think might be causing the problem is that the device to be controlled is a LightwaveRF plug and the script on the forum assumes a light switch but is is happily controlled my an on and off scene. Please help.

You were right to look at PLEG, that is the solution. Take a look at @RexBeckett’s excellent PLEG Basics - An Introduction to the Program Logic Event Generator tutorial. It includes an example that does exactly what you seek.

Thanks z-waver,
I managed to get a rough pleg event working after hours but will have a look at the link to see a better way. The logic I have working doesn’t seem to be bullet proof.

So here is an update,

That document was great and has given me some fantastic tools for getting my automation to do what I want. For info the way that I achieved the light to do what I wanted it to do was to change my way of thinking. Instead of making the light switch off 5 mins after sensing no movement. This didnt work because if I left the bathroom for lets say 30 seconds and then returned and stayed in the bathroom the light would switch off regardless of the fact that I was back in there. As no more ‘no detection’ created a new time stamp. Any way the logic is now to turn off the list light if there is no ‘movement signal’ detected and there has been no ‘movement signal’ detected for 5 minutes. Understanding the difference between the inverse of sensing movement and no movement detected helped me understand the logic and stopped the light randomly turning off when I was in the bathroom.

I hope this helps someone. The pleg plugin is excellent.

[quote=“nickgosling, post:4, topic:187271”]So here is an update,

That document was great and has given me some fantastic tools for getting my automation to do what I want. For info the way that I achieved the light to do what I wanted it to do was to change my way of thinking. Instead of making the light switch off 5 mins after sensing no movement. This didnt work because if I left the bathroom for lets say 30 seconds and then returned and stayed in the bathroom the light would switch off regardless of the fact that I was back in there. As no more ‘no detection’ created a new time stamp. Any way the logic is now to turn off the list light if there is no ‘movement signal’ detected and there has been no ‘movement signal’ detected for 5 minutes. Understanding the difference between the inverse of sensing movement and no movement detected helped me understand the logic and stopped the light randomly turning off when I was in the bathroom.

I hope this helps someone. The pleg plugin is excellent.[/quote]

If you ever get stuck click the status button, print as PDF and post your PDF on here. From that you can receive the help you need to fix your logic if needed.