View unanswered posts | View active topics It is currently Thu Nov 27, 2014 3:38 am



Reply to topic  [ 4 posts ] 
motion detection time option 
Author Message

Joined: Mon Aug 08, 2011 11:13 pm
Posts: 8
Post motion detection time option
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.


Tue Jan 15, 2013 9:06 pm
Profile

Joined: Thu Mar 07, 2013 5:10 pm
Posts: 5
Post Re: motion detection time option
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:


Thu Mar 07, 2013 5:19 pm
Profile

Joined: Wed Sep 04, 2013 1:39 am
Posts: 7
Post Re: motion detection time option
It can be done without modifying zoneminder but it's not as clean.

in crontab:

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


my zm-v4 script

Code:
#!/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.


Thu Sep 05, 2013 2:21 am
Profile
User avatar

Joined: Thu Oct 18, 2007 2:55 pm
Posts: 600
Location: Shiloh, IL
Post Re: motion detection time option
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:
0 6 * * * /usr/bin/zmpkg.pl daytime
0 20 * * * /usr/bin/zmpkg.pl nighttime

_________________
We want... a shrubbery! [dramatic chord]


Thu Sep 05, 2013 7:13 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group