Page 1 of 2

Is notification to an external program possible?

Posted: Sat Jun 25, 2005 5:03 am
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

Posted: Sat Jun 25, 2005 6:20 am
by Blazer
I am interested in the answer to this as well, as I intend to setup MisterHouse :-)

Posted: Sat Jun 25, 2005 6:48 am
by cordel
You can set up a filter and save it, then you will find a option to run a script.

Posted: Sat Jun 25, 2005 4:44 pm
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?

Posted: Sun Jun 26, 2005 2:42 am
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.

Posted: Mon Jun 27, 2005 9:10 am
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

Posted: Tue Jun 28, 2005 3:04 am
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!

Posted: Tue Jun 28, 2005 12:57 pm
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.

xAP

Posted: Tue Jun 28, 2005 10:40 pm
by madmax
I agree, I have wanted xAP support for a long time. That would link ZM to ALL home automation software.

Posted: Wed Jun 29, 2005 1:38 am
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?

Posted: Wed Jun 29, 2005 4:45 am
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.

Posted: Wed Jun 29, 2005 9:31 am
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

Posted: Wed Jun 29, 2005 3:14 pm
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

Posted: Tue Jul 12, 2005 2:51 pm
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

Posted: Tue Jul 12, 2005 4:13 pm
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