No motion for 30 minutes

Post Reply
ToneStrife
Posts: 21
Joined: Sunday 16 April 2017 17:02
Target OS: Raspberry Pi
Domoticz version:
Contact:

No motion for 30 minutes

Post by ToneStrife » Sunday 16 April 2017 19:15

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

qwerk
Posts: 281
Joined: Tuesday 22 July 2014 7:21
Target OS: Raspberry Pi
Domoticz version: beta
Location: Netherlands
Contact:

Re: No motion for 30 minutes

Post by qwerk » 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.
Attachments
light-off.txt
(1.21 KiB) Downloaded 159 times

ToneStrife
Posts: 21
Joined: Sunday 16 April 2017 17:02
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: No motion for 30 minutes

Post by ToneStrife » Monday 17 April 2017 10:07

Thanks!
I think I need to learn a little bit more about scripting and lua.
But now I have something to start with.

User avatar
Egregius
Posts: 2619
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: Beta
Location: Beitem, BE
Contact:

Re: No motion for 30 minutes

Post by Egregius » Tuesday 18 April 2017 8:10

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.

ilfavi
Posts: 3
Joined: Friday 04 May 2018 10:04
Target OS: Raspberry Pi
Domoticz version: V3.9443
Contact:

Re: No motion for 30 minutes

Post by ilfavi » Sunday 13 May 2018 9:56

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

Post Reply

Who is online

Users browsing this forum: waaren and 0 guests