xAP/xPL support

Anything you want added or changed in future versions of ZoneMinder? Post here and there's a chance it will get in! Search to make sure it hasn't already been requested.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Gliming, thanks for taking the time to do this. I think your approach is right in the current circumstances. Eventually I'd like to have a more generic triggering interface which X10, xAP etc could wrap around but that won't be for a little while yet.

I'd be interested to see how you get on with this and if you need any help or tips just let me know.

Phil
gliming
Posts: 33
Joined: Wed Sep 07, 2005 5:40 pm
Location: Ohio, USA

Post by gliming »

Phil,

I definitely agree w/ eventually working toward a more generic wrapper/framework w/i which these scripts could integrate. I'd be quite happy to asist if that makes sense.

Thanks for the offer to answer questions. Would you prefer that I ask questions regarding technical implementation details on this forum (and, if so, which forum category) or an email?

As samples, here is an initial set:

1) Each monitor appears to have a unique ID which is an incrementing integer starting at 1. Is this id system assigned or can the user change it? Are ids reused by the system if a monitor is added and then deleted?

2) Is it possible (or useful?) to get the zone name and id for a monitor that has gone into alarm? If so, can you provide a pointer on the programmtic way to get this info? Also, is it possible for more than one zone to have caused/permitted an alarm?

3) I note that you test for monitor state values 0 and 2 (suggesting alarm and non-alarm). Is there also a "1" and if so, what does it mean? Would it be possibly useful to differentiate all three states (with xAP, we're not limited to just ON and OFF state maps as you did w/ x10)?

4) I have an xAP library (multiple pm files) that isn't in CPAN. Do you have a preference on location (e.g., scripts/lib/xAP) that could serve as a precedent? BTW: This library is currently BSD licensed--is that a problem (I'm assuming the more liberal license would be ok)? I'm leaving the header/license text of the modified zmx10.pl (I guess I'll tentatively call it xmxap.pl realizing it might need to masquerade as zmx10.pl initially) untouched as I'm significantly reusing it.

BTW: If you prefer a separate email dialoge, you can reach me at gregg <at> limings <dot> net.

Regards,

Gregg
gliming
Posts: 33
Joined: Wed Sep 07, 2005 5:40 pm
Location: Ohio, USA

Post by gliming »

Joe,

I just noticed the following from your recent reply:
I could envision in the future listening to xAP messages as well, and forcing an alarm on or off, etc...
Given that I was going to replicate the existing x10 functional capabilities--only via xAP messages--I don't see that it won't do exactly as you mention above. Specifically, I do intend to allow the same mechanism for (1) turning a monitor on and off, (2) turning an alarm on or off and (3) reporting monitor alarm states--all using xAP BSC schema (I'd use the text field in addition to basic on/off to supplement the extended states). The difference is that you won't be referencing x10 codes in xAP--nor would you actually use zm to turn control x10 devices via xAP--leaving that to some separate home automation control application.
zimmer62
Posts: 13
Joined: Mon Jun 27, 2005 1:06 pm

Post by zimmer62 »

gliming, Great news then. Sounds like this will do everything I need it to.

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

Post by madmax »

Did anything ever come of this? Just wondering. :)
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Not so farI think. 1.22.x has an improved zmtrigger.pl model that should make it easier to support all sorts of incoming and outgoing triggers though.
Phil
gliming
Posts: 33
Joined: Wed Sep 07, 2005 5:40 pm
Location: Ohio, USA

Post by gliming »

I have the script running in my 1.21.4 install since Nov 05. It was modelled after a combination of 1.21.4 zmtrigger.pl and zmx10.pl scripts. The proper points of integration still need to be addressed (I have them grabbing values out of the local conf file). And, perhaps more importantly, testing by users other than me (I'm not convinced that I understand the various capture modes sufficient to have properly interpretted intended operation). Joe Z had started testing; but, I believe was hampered by his xAP software. I'll be happy to make it available to anyone that asks. The script reports alarms, allows invocation of alarms and/or recording and will report telemetry (x/y coords)--if desired--while an alarm is occuring (so as to permit calculation of movement direction(s)).

Gregg
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

wow sounds great. This xap thing then what equipment you running
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

gliming wrote:I have the script running in my 1.21.4 install since Nov 05. It was modelled after a combination of 1.21.4 zmtrigger.pl and zmx10.pl scripts. The proper points of integration still need to be addressed (I have them grabbing values out of the local conf file). And, perhaps more importantly, testing by users other than me (I'm not convinced that I understand the various capture modes sufficient to have properly interpretted intended operation). Joe Z had started testing; but, I believe was hampered by his xAP software. I'll be happy to make it available to anyone that asks. The script reports alarms, allows invocation of alarms and/or recording and will report telemetry (x/y coords)--if desired--while an alarm is occuring (so as to permit calculation of movement direction(s)).
Hi Gregg. That sounds great, if you can make it available I would like a look. If you don't have somewhere to put it, just mail it to me and I'll stick it on the site.
Phil
gliming
Posts: 33
Joined: Wed Sep 07, 2005 5:40 pm
Location: Ohio, USA

Post by gliming »

For the time being, you can get the current package at limings.net/xap/zmxap. I plan to take a look at the latest 1.22.x next week and revise the script to take advantage of any new features and/or practices. The README provides the current "hacked" method of integrating w/ zm. The xap messages are small enough that you can either view them in tcpdump or grab an xAP-aware message viewer. Sample xAP messages are included in the README.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Thanks. The 1.22.0 zmtrigger.pl is very different, and not fully documented yet, so if you need any help just let me know. On the other hand, as all the shared memory access stuff is in perl modules it is much easier to create bespoke scripts to perform specific tasks or integrate ZM functionality into other applications.
Phil
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

General Question
I have been looking into this xap thing and isnt it a bit too powerful for alarm use or did i miss something glaringly obvious

James
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
gliming
Posts: 33
Joined: Wed Sep 07, 2005 5:40 pm
Location: Ohio, USA

Post by gliming »

General Question
I have been looking into this xap thing and isnt it a bit too powerful for alarm use or did i miss something glaringly obvious
I'm not sure what you mean by "too powerful". xAP is a protocol for communicating home-automation related information. In my case, I'm getting alarm information sent from zm on one system and intercepted by misterhouse (mh) on another system. This info is integrated by mh using occupancy tracking functions that combine data now from PIRs, zm alarms, door contacts, etc. Likewise, I can have misterhouse deliberately start an alarm or recording based upon perceived occupancy and or occupancy modes (e.g., sleeping, away, awake, etc.). That's a long winded way of saying that it's not at all "too powerful" for my use (and I would expect others). Likewise, w/ telemetry reporting, I can potentially deduce whether an alarmed "target" is moving in a particular direction--which could be used to anticipate a target coming into another "zone".
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

Oh i see, i was looking at all the tv and stereo control stuff. Does this then get converted ti ip or are you linking rs232 between your servers. I only ask as im looking for a flexible way to get normal movement sensors into zm, and linking this to zm, zm4ms an d then linux viewer to see status's etc

James
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
gliming
Posts: 33
Joined: Wed Sep 07, 2005 5:40 pm
Location: Ohio, USA

Post by gliming »

The xAP messages sent/received to/from zm are UDP. I would think that what you are attempting to do would be a natural fit for xAP.
Post Reply