Is notification to an external program possible?

Support and queries relating to all previous versions of ZoneMinder
hp1
Posts: 19
Joined: Sat Mar 26, 2005 6:28 am

Is notification to an external program possible?

Post by hp1 »

This may be obvious, however I am not seeing any mechanism to do what I want. I use the Misterhouse home automation program as the central hub for my house events. I am trying to think of a way to use the excellent ZoneMinder camera monitoring system to alert Misterhouse as to when there is motion detected on the cameras. Ideally if ZM could launch a script when an alarm comes up, or write out to a file, I could trap for this.

I haven't looked into writing a misterhouse script that queries mysql yet, is there a specific place that ZM immediately writes out an alarm to? Has anyone done this? Do I even make sense (it's late).

-h
User avatar
Blazer
Posts: 234
Joined: Sun Jun 05, 2005 12:57 pm

Post by Blazer »

I am interested in the answer to this as well, as I intend to setup MisterHouse :-)
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

You can set up a filter and save it, then you will find a option to run a script.
hp1
Posts: 19
Joined: Sat Mar 26, 2005 6:28 am

Post by hp1 »

Found it, however does the filter get activated in real-time, or just when browsing. What I want is real-time notification of motion such that my MisterHouse system can either speak or IM me, and then I can use ZM to review and analyze.

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

Post by cordel »

The fiters I don't think are real time. But they run by what ever frequency you specify in the options and I beleive the default is every 300 seconds. I could be wrong here though.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

There is currently no generic mechanism for outputting triggers, as there is for input triggers. This is mainly because there is not likely to be a small set of formats or behaviours that people want.

However it's not hard to brew up your own script. If you look at zmtrack.pl you will see a pretty small script that just sits and checks for alarms in real time and then issues commands. You should be able to see pretty much where to plug in your own equivalents.

On the other hand I'm also interested in adding support for common applications so if you know of a generic way that Misterhouse supports I'd be happy to add that in.

Phil
zimmer62
Posts: 13
Joined: Mon Jun 27, 2005 1:06 pm

Post by zimmer62 »

A generic method to communicate to misterhouse as well as homeseer and a bunch of others would be to send xAP messages.

would be a great feature!
zimmer62
Posts: 13
Joined: Mon Jun 27, 2005 1:06 pm

Post by zimmer62 »

This could be interesting

http://board.homeseer.com/showthread.php?t=104408

Turns out there is now xAP to control the x10 ninja pan / tilt using the cm19a

I'm sure the zmtrack.pl could be modified to send xAP messages to the ninja mount.

Recently x10 had a deal 4 of these mounts for $100, seemed like a good deal if they'd work for you.

I have one that I don't use, but I'm betting I would if I can get it working with zm...

I'll keep you posted.
madmax
Posts: 55
Joined: Fri Nov 07, 2003 8:49 pm

xAP

Post by madmax »

I agree, I have wanted xAP support for a long time. That would link ZM to ALL home automation software.
hp1
Posts: 19
Joined: Sat Mar 26, 2005 6:28 am

Post by hp1 »

Cool, I started some great discussion.

I will look at the zmtrack.pl script. Currently, I've set a trigger script that calls /usr/lib/zm/bin/mhalert

The mhalert script contains two command;

/usr/local/mh/bin/mhsend -run 'ZM Motion'
echo $1 >> /usr/local/mh/data/zm.txt

I have a voice command within misterhouse (MH) that listens for the command ZM Motion and announces that motion was detected. The command then sets a timer for 3 minutes to prevent the same announcement each second. Another loop detects changes in zm.txt and will (eventually) create http links that can be sent through Misterhouse's Instant Messaging Capability.

This does work, however there is a 20 second lag between motion and the misterhouse announcement. If this could be down to 2-3 seconds that would be great.

I'm not all that familiar with xAP. Currently I run both ZM and MH on the same box. Would this approach work?
madmax
Posts: 55
Joined: Fri Nov 07, 2003 8:49 pm

Post by madmax »

Yes, if Misterhouse and ZM were both xAP enabled they would work anywhere on the network and even on the same machine. You might have to use a xAP hub application though. These xAP hubs are a free application to allow more than one xAP program run o nthe same system.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Ok, I'll bump xAP/xPL support up the priority list a bit. Not that I have any other components (or spare capacity) for an xAP enabled ZM to talk to at present. I'll cross that bridge when I come to it though.

I need to do a bit of reading up. Is there a good intro to the messaging formats anywhere?

Phil
madmax
Posts: 55
Joined: Fri Nov 07, 2003 8:49 pm

Post by madmax »

http://www.xapautomation.org/modules.ph ... id=indepth


Also, There was a xAP library created for linux by Peter Lindstone. Maybe this will make development easier?? The author's page is down, so I put it up:

http://www.lightningbolts.net/xaplib_src.zip
zimmer62
Posts: 13
Joined: Mon Jun 27, 2005 1:06 pm

Post by zimmer62 »

Any chance you have looked over the xaplib yet? I don't think I know c well enough to be of any help. However there is a yahoo group for xap developers, I'm sure someone there could be helpful explaining anything you might need to know.

http://groups.yahoo.com/group/xAP_developer/join
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Nope, not had time to look yet. It's always harder to find time for this kind of stuff in the summer even if I wasn't up to my ears with my other jobs!

It's on the list (near the top) though so it'll come sometime :)

Phil
Locked