View unanswered posts | View active topics It is currently Sat May 25, 2013 11:06 pm



Reply to topic  [ 8 posts ] 
run states 
Author Message

Joined: Wed Apr 26, 2006 1:39 am
Posts: 227
Location: Boston USA
Post run states
The run state dialogue in 1.23.3 does not show saved run states. I'm also wondering if when it does show the saved run states, it also shows which state is the active one?

Thanks,

_________________
MRD


Sun Jan 04, 2009 4:49 am
Profile

Joined: Thu Oct 11, 2007 6:10 am
Posts: 182
Post 
Need more info. I'm running 1.23.3 and my run states dialog shows run states I've saved (I have two). Saving them is actually tricky; you have to type the name in the "New State" box, then press the tab key to exit that field, *then* the "Save' button becomes enabled and the state can be saved. Apologies if you knew that.

Also, there is a bug somewhere that causes runstates not to show in XHTML mode. Here are my notes on this and how to fix if it is affecting you (I'm pretty sure I posted this before so sorry for the duplication):

Found a little bug in 1.23.3 changing state in xhtml mode.

In zm_xhtml_view_state.php line 28,

Code:
$status = dbFetchAll( "select * from States" );


should be changed to:

Code:
$states = dbFetchAll( "select * from States" );


Without the change of the variable name from $status to $states, it is not possible to select the run state using the xhtml state menu (the menu shows stop and restart, but the next line is an error about invalid options on line 70, which is referencing the nonexistent $states variable.

To answer your second question, the answer is no. There is actually not really a concept of persistent run states in ZoneMinder (at least not that I can find). The run states are simply database entries that correspond to various monitor functions. So when you set a run state, ZoneMinder sets the corresponding monitor functions and then completely forgets what "run state" it is in...it simply doesn't care.

I encountered this trying to set up a beep for my "armed" run state...rather than look for the state, I have to check the function of one of my monitors which is either Modect or Monitor depending on the run state I've chosen.


Fri Jan 09, 2009 1:40 am
Profile

Joined: Wed Apr 26, 2006 1:39 am
Posts: 227
Location: Boston USA
Post 
That was the problem! I must not have really saved the states due to the
inactive button maybe?

Since states don't save/apply any changes to filters, I'm thinking the only way I can change my email alerts would be to manually apply the filter background/disable mode. Can you or anyone out there suggest a command line way to do this. I'm guessing it will be a mySQL command.

I have a filter that runs in the background and sends email alerts when motion is detected in one of my zones. I want to change it with (cron probably) to NOT run in the background at certain times and to start again in the background at aother times.


Thanks for your help!

_________________
MRD


Mon Jan 12, 2009 7:48 pm
Profile

Joined: Thu Oct 11, 2007 6:10 am
Posts: 182
Post 
I could think of a couple ideas. First (what I do)...if you only want email alerts when there is motion, then you won't get any alerts when the cameras are not set to modect, so use the run states to set the cameras from "monitor" to "modect". That's what I have; a "disamed" state that uses monitor and an armed state that uses modect.

Another option might be to specify time frames in your filters. For example, can you set "Time" -> "less than" -> 20:00 and "Time" -> "greater than" -> 06:00 in the filter itself to create a window during which matches will result (I just tried this and it works).


Mon Jan 12, 2009 8:25 pm
Profile

Joined: Wed Apr 26, 2006 1:39 am
Posts: 227
Location: Boston USA
Post 
Those a re great suggestions that will work for some of my issues, but in at least one case I really don't know when I need to send alerts, but I always want to detect motion.

An example is when I leave home for the weekend and want to easily change the "State" to start alerting me when there is any motion in a
certain zone. When I'm home, I still want the motion detected, but don't want to be bothered by alerts.

I'm thinking the only thing I can do is send a command to change the configuration of the filter on the fly.

I would also do this during the day when I'm at work, which could be done by setting time frames in a filter since I'm pretty much at work every week day. When I'm leaving for the weekend, it would be nice to schedule the filter config change or have a simple command to change several instead of having to re-save the filter with a different config in the web gui.

_________________
MRD


Mon Jan 12, 2009 9:17 pm
Profile

Joined: Thu Oct 11, 2007 6:10 am
Posts: 182
Post 
I understand.

I don't think there's a built-in way to do that, but you could brute-force it a bit, if you muck with /usr/bin/zmfilter.pl. For example, you could use a perl script to touch or unlink a little file in /tmp, call it "sendalerts.txt" and write a line or two into zmfilter.pl that would skip the email function if that file isn't there. A link or form could run the perl script, and you could add such a link to the console yourself. One thing ZM is...very customizable. :)

But I have a habit of engineering over-complex solutions before really thinking about the problem, so there's probably a simpler way!

Edit: there is an easier way, probably - just write something to change the status of your filter in the "Filters" table (change the value of "AutoEmail" from 0 to 1).


Mon Jan 12, 2009 11:26 pm
Profile

Joined: Wed Apr 26, 2006 1:39 am
Posts: 227
Location: Boston USA
Post 
Is there anyone out there that can give me a hint as to what the possible command syntax would be?

Thanks!

_________________
MRD


Tue Jan 13, 2009 1:06 am
Profile

Joined: Thu Oct 11, 2007 6:10 am
Posts: 182
Post 
mrd wrote:
Is there anyone out there that can give me a hint as to what the possible command syntax would be?

Thanks!


This is a really old topic but I finally found myself in the same situation now, where I always want modect but I only want alerts in a specific run state. I mulled over various solutions and finally decided on this one.

let's say you have "Monitor1" on Modect all the time, saving events. If you want to have Monitor1 only email you during a given run state, create a copy of Monitor1 (I call mine "Monitor1_Armed" corresponding to my "Armed" run state). Then in your run states, make the two monitors mutually exclusive. In other words, in one run state, Monitor1 is "Modect" and Monitor1_Armed is "none". Then in the other run state, Monitor1 is "none" and Monitor1_Armed is "Modect". The run state basically toggles between the two monitors.

Now recreate the zone on the new monitor. If you don't like writing down lots of numbers, here's a shortcut. Go into phpmyadmin or your favorite mysql editor, go into the zoneminder database, Zones table, delete the default zone for the new copy of the monitor, and copy the zone record for the original monitor over to the new monitor. In phpmyadmin this is pretty easy - just edit the zone record for the old monitor and instead of saving the edits, further down the screen select "insert as new row" among the options. I incremented the Zone ID number, since it seemed the right thing to do.

Then in your filters, when you want an email, just look for an event on the "Monitor1_Armed" camera instead of "Monitor1". If your filter sees an event on "Monitor1_Armed", it will email it to you, and by virtue of your run states, that will only happen when Monitor1_Armed is in "Modect".

It is kind of a kludge - it would be great if there was a way for the filter to specify if another monitor was in a specific state or not, but this will do for now.


Mon Aug 02, 2010 10:30 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 8 posts ] 

Who is online

Users browsing this forum: No registered users and 0 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