Disable some zones at different time

Forum for questions and support relating to the 1.24.x releases only.
Locked
gilles
Posts: 19
Joined: Tue Jun 07, 2011 6:46 am

Disable some zones at different time

Post by gilles »

Hi All,

I'm very pleased to discover zoneminder.

I use zoneminder 1.24.2 on ubuntu 10.4.2 server and I have a 7130 vivotek connected by ip.

I would like to disable some detection zones on different hour. I do some save run state but it seems like run state don't save the changing state of a zone.


To be clear when it's 8h00 I want my active zone A and B to be active and when it's 12h00 I wonder my zone A not to be active and my zone B Active.


Is it possible to do that ?

I Hope it is.

If you've got the answer, I listen you, please.

Thank you.

Gilles.
gilles
Posts: 19
Joined: Tue Jun 07, 2011 6:46 am

Re: Disable some zones at different time

Post by gilles »

Hi,

No answer ?

nobody have got an Idea ?

Gilles
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: Disable some zones at different time

Post by mastertheknife »

If you know can script, then here is a rough guide:

1) kill zmwatch.pl
2) Stop the zma daemon for that monitor by calling zmdc.pl stop zma -m 1
(change -m 1 to the correct monitor ID)
3) Edit the database to disable\enable the zones
4) Restart the zma daemon by calling zmdc.pl start zma -m 1


mastertheknife.
Kfir Itzhak.
gilles
Posts: 19
Joined: Tue Jun 07, 2011 6:46 am

Re: Disable some zones at different time

Post by gilles »

Hi ,

Thank you for your suggestion, If I don't find anything, I will try to script that.
Don't you think there is an other soft solution ? (by soft, I mean make no kill process).

Gilles.
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Re: Disable some zones at different time

Post by cordel »

There is currently no other method really available.
gilles
Posts: 19
Joined: Tue Jun 07, 2011 6:46 am

Re: Disable some zones at different time

Post by gilles »

So If I'm not wrong,

I can stop zm then update my database by changing my value to Inactive and then restart, No ?
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: Disable some zones at different time

Post by mastertheknife »

gilles wrote:So If I'm not wrong,

I can stop zm then update my database by changing my value to Inactive and then restart, No ?
Exactly. You don't have to fully stop ZM, just zma for the corresponding monitor.

mastertheknife
Kfir Itzhak.
gilles
Posts: 19
Joined: Tue Jun 07, 2011 6:46 am

[SOLVED] Disable some zones at different time

Post by gilles »

Thank you to mastertheknife and Cordel.

I just have to make my script and that's OK.

So my problem is solved.

Gilles
algenon
Posts: 55
Joined: Mon Oct 20, 2003 1:25 am

Re: Disable some zones at different time

Post by algenon »

hi gilles,

how did you get ZM to read the 7130 vivotek's MPEG video stream?

Algenon
gilles
Posts: 19
Joined: Tue Jun 07, 2011 6:46 am

Re: Disable some zones at different time

Post by gilles »

Hi Algenon,

I'm sorry for my later answer but I was sick last time.

I make a mistake about my ip camera this is a vivotek 7330 and not a 7130. And I use JPEG as MJEPG doesn't work (but I didn' last time on that)

It works very well, but I can't use the MJPEG which is best than JPEG, I think (but not sure).

If you want more informations, open a new post and I will answer what I know.

Gilles.
wdeninger
Posts: 5
Joined: Mon Nov 08, 2010 12:21 am

Re: Disable some zones at different time

Post by wdeninger »

So does anyone know how one disable a zone? (NOTE: Setting a zone to Inactive does NOT disable it. An Inactive zone only suppresses all other Zone events within the region)..

I suppose I can try a little math trick with the MonitorID, but that's a really ugly solution.

-W
PacoLM
Posts: 971
Joined: Wed Dec 02, 2009 9:55 pm
Location: Spain

Re: Disable some zones at different time

Post by PacoLM »

Isn't better just duplicate the monitor with different zones and then enable the desired monitor according the time, save a state, then do a cron job to the state??.

PacoLM

After more than 15 years, no longer using ZM as surveillance system.
Now in the dark side, using a commercial system...
wdeninger
Posts: 5
Joined: Mon Nov 08, 2010 12:21 am

Re: Disable some zones at different time

Post by wdeninger »

Keeping the zones associated with a single monitor does have some advantages, like keeping all the data referenced by region together. I simply added suffixes to the zone names (e.g. day/night), and execute a corresponding script in my crontab. That way, I could easily build onto it without needing scripting changes. Also, it gives me flexibility to create zones that are persistent all the time (not having day/night in the name). For instance, My zones are:

+----------------------------+-----------+
| Name | MonitorId |
+----------------------------+-----------+
| Driveway-day | 101 |
| Frontyard-1-day | 102 |
| Frontyard-2-day | 103 |
| Bedroom-side-day | 104 |
| Garage-side-day | 105 |
| Backyard-1-day | 106 |
| Backyard-2-day | 107 |
| Front-door-day | 103 |
| Bedroom-side-night | 4 |
| Garage-side-night | 5 |
| Backyard-1-night | 6 |
| Backyard-2-night | 7 |
| Frontyard-2-night | 3 |
| Frontyard-1A-night | 2 |
| Driveway-night | 1 |
| Frontyard-2-inactive-night | 3 |
| Frontyard-1B-night | 2 |
+----------------------------+-----------+

my crontab looks like:

# at 6 am... shift to day parameters
00 06 * * * /root/zone-day.ksh >> /root/zone-update.log
# at 9pm... shift to night parameters
00 21 * * * /root/zone-night.ksh >> /root/zone-update.log

where zone-day.ksh is:

#!/bin/bash
# zone-day.ksh
/root/zone-monitor-modify.ksh +100 night
/root/zone-monitor-modify.ksh -100 day
/root/zone-update.ksh

#!/bin/bash
# zone-night.ksh
/root/zone-monitor-modify.ksh +100 day
/root/zone-monitor-modify.ksh -100 night
/root/zone-update.ksh


#!/bin/bash
# zone-monitorid-modify.ksh
mysql -e "use zm; update Zones set MonitorID=MonitorID+'$1' where Name LIKE '%$2';"

and obviously

#!/bin/bash
# zone-update.ksh
zmu -m 0 -L -U username -P password
zmu -m 1 -L -U username -P password
zmu -m 2 -L -U username -P password
zmu -m 3 -L -U username -P password
zmu -m 4 -L -U username -P password
zmu -m 5 -L -U username -P password
zmu -m 6 -L -U username -P password
zmu -m 7 -L -U username -P password
Locked