No motion for 30 minutes

Moderator: leecollings

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

No motion for 30 minutes

Post 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
qwerk
Posts: 222
Joined: Tuesday 22 July 2014 7:21
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Netherlands
Contact:

Re: No motion for 30 minutes

Post 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.
Attachments
light-off.txt
(1.21 KiB) Downloaded 323 times
ToneStrife
Posts: 20
Joined: Sunday 16 April 2017 17:02
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: No motion for 30 minutes

Post 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.
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: No motion for 30 minutes

Post 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.
ilfavi
Posts: 11
Joined: Friday 04 May 2018 10:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: No motion for 30 minutes

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest