motion detection time option

Anything you want added or changed in future versions of ZoneMinder? Post here and there's a chance it will get in! Search to make sure it hasn't already been requested.

Moderator: zoneminder

jsbsmd
Posts: 8
Joined: Mon Aug 08, 2011 10:13 pm

motion detection time option

Postby jsbsmd » Tue Jan 15, 2013 8:06 pm

I have a need to be able to set times I wish to record alarms from 8pm until 6am daily. during the other times, I do not want ZM you save any events even if motion is detected.

blastter
Posts: 5
Joined: Thu Mar 07, 2013 4:10 pm

Re: motion detection time option

Postby blastter » Thu Mar 07, 2013 4:19 pm

You can add to the table, two hour comuns, the start and the end hour, and then you can add in the query in line 878 in the src/zm_zone.cpp the filter to enable only between the start and end event hours. I haven't tested it yet but I think it'll work, the only problem is that you need to modify the query and the interface.
Knolidge needed:
SQL->MySQL
Table to modify -> Zones
in database zm
You can find the database configuration in the zm.conf file in /etc/zm/ folder.
Good Luck. :wink:

tcpdump
Posts: 7
Joined: Wed Sep 04, 2013 12:39 am

Re: motion detection time option

Postby tcpdump » Thu Sep 05, 2013 1:21 am

It can be done without modifying zoneminder but it's not as clean.

in crontab:

Code: Select all

0 7 * * * /usr/local/bin/zm-v4 active
0 18 * * * /usr/local/bin/zm-v4 inactive


my zm-v4 script

Code: Select all

#!/bin/bash

case $1 in
 active)
mysql -s -N -uroot -p*password zm -e "update Zones set Type='Active' where Id=36"
mysql -s -N -uroot -p*password zm -e "update Zones set Type='Active' where Id=37"
sleep 1
kill `ps ax|grep "zma -m 9"|grep -v grep|awk '{print $1}'`
    ;;
 inactive)
mysql -s -N -uroot -p*password zm -e "update Zones set Type='Inactive' where Id=36"
mysql -s -N -uroot -p*password zm -e "update Zones set Type='Inactive' where Id=37"
sleep 1
kill `ps ax|grep "zma -m 9"|grep -v grep|awk '{print $1}'`
    ;;
esac


You need to adjust the zone ids based on your installation but for me it works just fine.

User avatar
knnniggett
Posts: 1217
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: motion detection time option

Postby knnniggett » Thu Sep 05, 2013 6:13 pm

You can currently use Zoneminder Run States to do this.

Set up the cameras the way you want the first state. Then click "Running" on the main screen, enter the name of your new state, call it "Daytime", and then hit save.

Now configure your cameras for the second state and save it as "Nighttime".

You can manualy switch between the two states or on a schedule via cronjob:

Code: Select all

0 6 * * * /usr/bin/zmpkg.pl daytime
0 20 * * * /usr/bin/zmpkg.pl nighttime
We want... a shrubbery! [dramatic chord]

Blog in Progress. Using the ESP8266 WiFi chip as an external trigger source.
http://zmtrigger.blogspot.com/


Return to “Feature Requests”

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest