Hi guys,
I have a motion sensor (pir) connected to a wemos, it sends t's dat to Domoticz, works perfect. On Domoticz i havesetup a switc (motion sensor) and when activated it should run a script.
The script start a camera record for 5 minutes. So far so good!
But when during this 5 minutes the switch is activated again, the scripts runs again after the first run.
Is there a way to surpress this? Thus after the inital trigger the motion sensor should be ignored for a predfined time?
motion sensor triggers script to often
Moderators: leecollings, remb0
- jvdz
- Posts: 2359
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: motion sensor triggers script to often
What is the script that you use?
You could test in the script for the time passed since the last change and when that is less than 5 minutes you skip the recording.
You could test in the script for the time passed since the last change and when that is less than 5 minutes you skip the recording.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
- waltervl
- Posts: 6015
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2025.1
- Location: NL
- Contact:
Re: motion sensor triggers script to often
And you can do that for example with code example:
Code: Select all
if (domoticz.devices('My PIR').lastUpdate.minutesAgo > 5) then
-- your code to record camera for 5 minutes
end
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Who is online
Users browsing this forum: redhouse and 1 guest