Page 1 of 1

motion detection and timeout

Posted: Wednesday 20 March 2019 23:19
by necrofrost
Hi all,

I'm trying to create a small "security" enhancement to my new domoticz raspberry pi (bought a new one). Whenever my APIR-2150 (motion detector) is triggered, I want to set the garden light to on for an X amount of time. But for some reason my Blockly doesn't work properly. And since I want to try to avoid as much LUA as possible.... I'm asking here for advise.

This is my blockly
2019-03-20 23_09_43-Domoticz.png
2019-03-20 23_09_43-Domoticz.png (34.55 KiB) Viewed 1426 times
I've used the variable "garden motion detected" as a variable to store an integer in order to not keep on sending notifications. But that also doesn't work. The variable doesn't get set to 1.

if you guys need anymore information, please let me know

Henk

Re: motion detection and timeout

Posted: Friday 22 March 2019 6:57
by kuifje
Henk
I think you need to use the if else blocky .
IF " gardenmotion detected=0 and time< sunset and movement = on
SET " gardenmotion detected = 1
SET " garden lights on
IF " gardenmotion detection = 1
SET" garden lights off after 1 minute.

Kuifje

Re: motion detection and timeout

Posted: Friday 22 March 2019 21:00
by necrofrost
Thanks for your response Kuifje.

Yesterday I had the PIR laying on the kitchen table and all of a sudden the garden lights turned on. after some time (I think it was the 60 seconds time out) the lights went out again. moving in the kitchen activated the light again. So apparently it works now. sometimes the pir doesn't get noticed by domoticz it looks like. very strange.

Re: motion detection and timeout

Posted: Wednesday 27 March 2019 9:10
by kuifje
OK
good for you

kuifje