Page 1 of 1

No motion for 30 minutes

Posted: Sunday 16 April 2017 19:15
by ToneStrife
Hello to everyone,

I'm a little noob and lost to be fair.

I want the light to turn on when the door opens but online if the motion sensor has not been active during 30minutes.

A little help? Is it possible with blocky? Only with LUa?

Thanks

Re: No motion for 30 minutes

Posted: Sunday 16 April 2017 20:28
by qwerk
It is not difficult, if you know how.:

I attached my script with even two sensors that need to be motionless for 20 minutes.

Re: No motion for 30 minutes

Posted: Monday 17 April 2017 10:07
by ToneStrife
Thanks!
I think I need to learn a little bit more about scripting and lua.
But now I have something to start with.

Re: No motion for 30 minutes

Posted: Tuesday 18 April 2017 8:10
by Egregius
In pass2php that would be like this:

Code: Select all

<?php
if($status=='Open'){
    if(apcu_fetch('spir')=='Off' && apcu_fetch('tpir')<time-1800)sw('light','On');
}
 
Only when the door opens ($status) and the status of pir is off and the last updatetime of the pir is more than 1800 seconds ago the light is switched on.

Re: No motion for 30 minutes

Posted: Sunday 13 May 2018 9:56
by ilfavi
qwerk wrote: Sunday 16 April 2017 20:28 It is not difficult, if you know how.:

I attached my script with even two sensors that need to be motionless for 20 minutes.
this is exactly what I was looking for, thank you very much