Hello,
I have been using Zoneminder for the past 9 months and think it is a really excellent app. I am using it for home security and I currently have 3 cameras - 1 internal and 2 external. I have setup a filter to automatically email me video clips and generate a text message for any motion that is detected by the camera inside the house during weekday working hours. This is in case my zoneminder PC get stolen.
I sometimes get home early from work or leave late and this sends me a video and text message that I don't need. In this case, I have to change the filter configuration in Zoneminder if I remember, so that the "Automatically email details of all matches:" and "Automatically execute command on all matches: " checkboxes are not selected.
I would like to be able to run a script that makes this change via the command line. Would it be possible to change the zmfilter.pl script to make updates to the filter configuration? I would like to get a remote control like an X10 key phob to arm my house i.e. run a simple script that changes my filter configuration to automatically send emails and text when I close the front door.
Also, I have also noticed that if I have any past events that are found when the filter runs and I have disabled and re-enabled the email and execute command options in the filter, I get an email and text for all the old hits on the filter. Is there any way to set the filter to only send the new hits without deleting all of the old hits before? i.e. can a flag be set in the ZM database that marks if an email or command has already been sent for an event?
One last thing, Can anybody suggest a good key phob that can be set to run simple scripts in Linux? Thanks in advance for feedback.
Matthew
Changing filters via the command line
Re: Changing filters via the command line
Already possible, The configuration is in the database so the mysql client can be used.wicklowman wrote:Would it be possible to change the zmfilter.pl script to make updates to the filter configuration?
Actualy that flag already exisits and thats why you don't get any duplicates. You will have to make your filter a bit smarter and add a time constraint to it like; less than 5 minutes.wicklowman wrote: Also, I have also noticed that if I have any past events that are found when the filter runs and I have disabled and re-enabled the email and execute command options in the filter, I get an email and text for all the old hits on the filter. Is there any way to set the filter to only send the new hits without deleting all of the old hits before? i.e. can a flag be set in the ZM database that marks if an email or command has already been sent for an event?
-
- Posts: 3
- Joined: Wed Apr 26, 2006 5:41 pm
Thanks for the quick reply.
I can't believe I didn't think about limiting my auto email filter to only display results for the past 5 mins myself! I use that feature for other filters!
Any chance you could post the mysql syntax to update the database directly? I had a look at the filters database table and it's not obvious how the value is set for filters with different names. It looks like the TINYINT(3) data type is either on or off for all of the filters. Sorry, I don't know much about mysql. Thanks again.
Matthew
I can't believe I didn't think about limiting my auto email filter to only display results for the past 5 mins myself! I use that feature for other filters!
Any chance you could post the mysql syntax to update the database directly? I had a look at the filters database table and it's not obvious how the value is set for filters with different names. It looks like the TINYINT(3) data type is either on or off for all of the filters. Sorry, I don't know much about mysql. Thanks again.
Matthew
Of couse you can substitute the login root with the user you configured zm to login to the database with.mysql zm -u root -p
UPDATE Filters SET AutoEmail='0' WHERE Name='FilterName';
exit
Change the systax in green ( AutoEmail='0' ) for the field you want to change and the value you want assigned (In this case would be 1 for on, and 0 for off).
Change FilterName to the name you asigned the filter.
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
Also, since 1.22.3, there is now a 'Backgound' flag. So if all your filter does is send you an email, or you want to diable it altogether, you can just turn off the backgrounding, while leaving the rest of the filter unchanged. If you want finer control then using the AutoEmail, AutoDelete flags is the right approach though it may take a few minutes for zmfilter.pl to pick up the change.
Phil