Time dependent zones

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.
Post Reply
MatzR
Posts: 18
Joined: Wed Oct 02, 2019 8:02 am

Time dependent zones

Post by MatzR »

Hi,

I'm using ZM for a while now and am quite happy with it.
There is only one issue I can't get around: I have one cam at the front of my house which covers the area there with 2 zones. This works quite well during the day, but at night the lights of bypassing cars always trigger alarms - and far too many...
I tried numerous things but without success, so I came up with the following idea: if it were possible to define zones for a specific time of the day I could split the 2 zones into four - 2 sensitive ones directly in front of the house, and 2 more closer to the street side which are only active during the day (i.e. when it is light).
But for this I have to be able to set a time frame when a zone is active and when not.
Just an idea.

Regards
Matthias

NB: if you have any other suggestions I would of course be glad to read...
CountyLine
Posts: 63
Joined: Thu Aug 29, 2019 5:22 pm
Location: USA

Re: Time dependent zones

Post by CountyLine »

Did you try one or more Preclusive zones located where the vehicles lights would illuminate them, but not where interesting movement would trigger them? They can be really small, so don't take much in the way of resources.
montagdude
Posts: 88
Joined: Fri Nov 10, 2017 6:05 pm

Re: Time dependent zones

Post by montagdude »

The way I have solved this problem is to make duplicated monitors with the same zones, but different settings on the zones. I switch the active monitors based on sunrise and sunset using sunwait (https://sourceforge.net/projects/sunwait4windows/). It's kind of a pain to set it up this way, but once set up it works well. It would be easier to set up if there were a monitor cloning feature that also cloned the zones.
MatzR
Posts: 18
Joined: Wed Oct 02, 2019 8:02 am

Re: Time dependent zones

Post by MatzR »

CountyLine wrote: Wed Oct 02, 2019 2:56 pm Did you try one or more Preclusive zones located where the vehicles lights would illuminate them, but not where interesting movement would trigger them? They can be really small, so don't take much in the way of resources.
I am playing around with Preclusive zones but not really getting useful results.
Any recommendations which settings best to use?

Thanks
Matthias
MatzR
Posts: 18
Joined: Wed Oct 02, 2019 8:02 am

Re: Time dependent zones

Post by MatzR »

montagdude wrote: Wed Oct 02, 2019 3:26 pm The way I have solved this problem is to make duplicated monitors with the same zones, but different settings on the zones. I switch the active monitors based on sunrise and sunset using sunwait (https://sourceforge.net/projects/sunwait4windows/). It's kind of a pain to set it up this way, but once set up it works well. It would be easier to set up if there were a monitor cloning feature that also cloned the zones.
Interesting approach. I would have the sunset and sunrise times anyway from my weather station.
But how do you use the signal to switch the monitors on/off?

Thanks
Matthias
CountyLine
Posts: 63
Joined: Thu Aug 29, 2019 5:22 pm
Location: USA

Re: Time dependent zones

Post by CountyLine »

MatzR wrote: Fri Oct 04, 2019 3:58 pm
I am playing around with Preclusive zones but not really getting useful results.
Any recommendations which settings best to use?
My main use for them is suppressing events that occur due to the cameras changing over from daylight to night mode (IR) and vice-versa.

Small Preclusive zones are recommended by the developers. I have tried both 10x10 and 20x20 pixel square zones. I find the 20x20 works somewhat better than the 10x10. You can have multiple preclusive zones. I suspect that will be required in your use case.

I usually locate the preclusive zone up at the top of the frame on some dark object that I don't care about. I often put it on a tree. I usually have to play with the settings a bit to get it to work reliably.

One 10x10 example follows,

Type: Preclusive

Units: Pixels

Alarm Check Method: AlarmedPixels

Min/Max Pixel Threshold: 50, 0

Min/Max Alarmed Area: 10, 0

Overload Frame Ignore Count: 0

Extend Alarm Frame Count: 3

Anything else is blank or 0.

Expect to find out that you will have to play with these settings quite a bit in order to get a feel for this stuff. Every use case is different and some can be quite complicated.
montagdude
Posts: 88
Joined: Fri Nov 10, 2017 6:05 pm

Re: Time dependent zones

Post by montagdude »

MatzR wrote: Fri Oct 04, 2019 3:59 pm
montagdude wrote: Wed Oct 02, 2019 3:26 pm The way I have solved this problem is to make duplicated monitors with the same zones, but different settings on the zones. I switch the active monitors based on sunrise and sunset using sunwait (https://sourceforge.net/projects/sunwait4windows/). It's kind of a pain to set it up this way, but once set up it works well. It would be easier to set up if there were a monitor cloning feature that also cloned the zones.
Interesting approach. I would have the sunset and sunrise times anyway from my weather station.
But how do you use the signal to switch the monitors on/off?

Thanks
Matthias
Hey,

Sorry for seeing this question so late. I set up sunwait to run via a cronjob at 1am and 1pm every day. After sunwait completes, it calls zmpkg.pl to change the monitor state. Here is the crontab entry (note that my actual location has been replaced by lat and lon for posting here):

Code: Select all

# Change ZoneMinder run state a little after sunrise and a little before sunset
00 1 * * * /usr/local/bin/zm_sunwait.sh rise 00:15:00 lat lon
00 13 * * * /usr/local/bin/zm_sunwait.sh set 00:15:00 lat lon
And here is zm_sunwait.sh:

Code: Select all

#!/bin/bash
#
# Changes ZoneMinder run state based on sunrise or sunset.
#
function print_usage()
{
  echo "Usage: zm_sunwait.sh rise/set offset lat lon"
  echo "Note that offset is +ve towards noon."
}

if [ $# -lt 4 ]; then
  print_usage
  exit 1
fi

MODE=$1
OFFSET=$2
LAT=$3
LON=$4

if [ "$MODE" == "rise" ]; then
  RUNSTATE="Day"
elif [ "$MODE" == "set" ]; then
  RUNSTATE="Night"
else
  print_usage
  exit 1
fi

# Wait for sunrise or sunset, but don't start ZoneMinder if it is not running
# (it was probably turned off for a reason)
sunwait wait $MODE offset $OFFSET $LAT $LON
STATUS=$(zmpkg.pl status)
if [ "$STATUS" != "stopped" ]; then
  zmpkg.pl $RUNSTATE
  echo "$(date): Setting ZoneMinder to $RUNSTATE run state." >> /var/log/zm_sunwait.log
else
  echo "$(date): ZoneMinder is not running, so not changing run state." >> /var/log/zm_sunwait.log
fi
Post Reply