From: Kevin R. K. <ke...@kr...> - 2013-09-25 23:12:02
|
Wayne, Very cool, I have planned on getting the AD2USB device for a long time now. You have already done a lot of work, but my initial thought was to use the XPLAdemco project here: https://github.com/hwstar/xplademco I had intended on getting a raspberry pi to act as the XPL gateway for the alarm box. I would then need to enable XPL in MH. My alarm box and MH server are in different locations of the house, so this made sense for me. As for your plan, it sounds like your current design is very code-based rather than object-based for lack of a better description. In order to truly make your work extensible, you would want to make use of the Generic_Item class already built into MH. I would make a Zone class that inherits Generic_Item and I would define each Zone as a separate object. This would avail you of all of the benefits of the set(), state_now(), and timer() functions already built into MH. This would allow you to fire off an action when a trigger occurs as well as make it easier to link the ademco zones to other objects defined within MH such as an insteon light switch. Alarm would also likely be its own object and class that would offer the same control and outputs as the alarm panel. This would also likely be a Generic_Item descendant as well. Next, you would want to create an Interface object that likely inherits Serial_Items. Finally, the mh.private.ini file should be used for settings. You would be better off adding an entry to read_table_A.pl for the various zones and alarms. Then you can define each zone and alarm in an MHT file such as ademco.mht. Sorry, I am sure this has been a poor explanation. I don't really have the software-coding lingo, but I am more than happy to answer more of your questions. Based on what you have achieved, I bet you have done much of the work already, now you just need to structure your design to fit into the MH structure to get all of the benefits of MH. Kevin On Tue, Sep 24, 2013 at 8:59 PM, Wayne Gatlin <wa...@ra...> wrote: > Hello, > > I am new to misterhouse, this is my first time using it and writing code > for it. I have completed the code to watch and track serial messages from > the AD2USB interface (from my Vista 21 alarm system). I really don't know > the best way to design the interface to interact with misterhouse so I will > explain what I have in mind and maybe someone can give me some suggestions > on the best way to do it. > > What I have completed: > - My current code watches the alarm messages, keeps track of the states of > the any zones you configure in the mh.private.ini > (This can be used to watch motion detectors and trigger lights, etc.) > - it also keeps track of the alarm system state (armed/disarmed/alarmed) > > Currently my code just puts the zone states in a comma separated list > containing the faulted zones. > > from my mh.private.ini: > ad2usb_relay_zone_map=14-02-006-Livingroom_motion,14-03-007-Garage_Open > > so if the Livingroom_motion and the Garage_Open zone is faulted the list > will be "Livingroom_motion-R,Garage_Open-R" and when the zone is no longer > faulted, that zone is removed from the list. > > I put the faulted zone list in a var called $faultedzonecnt > The alarm system state is in a var called $alarmstate > > > > The first thing I would like to do is be able to set times to alert me > that the Garage_Open zone is faulted via the web interface. Maybe a > calendar item or something. > > Next I want to watch the system alarm state and run a voice command when > it changes to alarmed and run another one when it changes back. This will > start my cameras recording. I would like to do this in a separate script > from the one I have already written to keep this one generic so others can > use it. > > Last (for now) I want to be able to send commands to the alarm system, but > to do this I need to be able to see the response. I've played with the > Voice_Cmd and got it working to trigger my zoneminder cameras, but when I > send a command via telnet, I cant figure out how to send a response back to > the terminal. > > > > -Wayne > > > ------------------------------------------------------------------------------ > October Webinars: Code for Performance > Free Intel webinars can help you accelerate application performance. > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most > from > the latest Intel processors and coprocessors. See abstracts and register > > http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk > ________________________________________________________ > To unsubscribe from this list, go to: > http://sourceforge.net/mail/?group_id=1365 > > > |