motion detection time option
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.
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.
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.
Re: motion detection time option
It can be done without modifying zoneminder but it's not as clean.
in crontab:
my zm-v4 script
You need to adjust the zone ids based on your installation but for me it works just fine.
in crontab:
Code: Select all
0 7 * * * /usr/local/bin/zm-v4 active
0 18 * * * /usr/local/bin/zm-v4 inactive
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
- knight-of-ni
- Posts: 2406
- Joined: Thu Oct 18, 2007 1:55 pm
- Location: Shiloh, IL
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:
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
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
All of these can be found at https://zoneminder.blogspot.com/