Elk M1 Security System Control with Perl Script

I have an Elk M1 security system that I like to monitor and record all the activity. It’s useful to know what doors are open and how long they have been open. For several years in the past I have use Homeseer to do the monitoring where I wrote VBScript files to push the activity and changes to my MySQL server. Honestly, I have never likes Homseer, it’s flaky and I prefer that I don’t depend on WinXP either.

About a year ago, James Russo released a script on Cocoontech to monitor and control your Elk M1 from a perl script. You can read the forum post for more details. Thanks to James and other Cocoontech members, it works fairly well.

But there have been no updates or bug fixes in over a year. Not wanting to relive my perl days (sorry, I never really liked perl), I decided to revive the project and give it a new home. I asked James for permission to take over the project and he gracefully agreed.

ElkM1::Control New Home on Github

Go check it out! ElkM1::Control on github.

Why github? First, I have stopped using SVN. And sourceforge, ElkM1::Control’s original home, doesn’t support git. Second, github makes it too easy to fork a project and make changes yourself, then push them back up so that I can integrate those changes. You really should try git if you haven’t before. And you don’t need git to download ElkM1::Control and install it.

Updates and Bug Fixes!

You read that right, I have made a few bug fixes and added a couple of new features. I have been running ElkM1::Control on my Ubuntu Hardy server for about a month with no problems. I have also run and do some debugging on OS X (10.5.x).

I also changed the version numbering system to the more common major.minor.release notation. We are not at version 0.1.0.

Quick Installation Instructions

  1. Goto the project home page and click the download button. Select the ZIP version (for some reason the TAR doesn’t work sometimes).
  2. Follow the README file, don’t forget the PREREQUISITES section. For those who don’t rtfm…
  3. From your favorite shell, you may need to add sudo in front of each: ‘perl Makefile.PL’
  4. ‘make’
  5. ‘make test’
  6. Then to install: ‘make install’

Next, you’ll need a little script to get going. There are several scripts posted on Cocoontech, but this one should get you started:

[source lang=’php’]
# Example 2: Display all M1 messages
use ElkM1::Control;
    my $elk = ElkM1::Control->new(host => ‘’, port => 2101);
    while (1) {  # Loop forever
        while (my $msg = $elk->readMessage) { # Read the M1’s messages
                print $msg->toString;  # Print the messages

Posted in Home Automation, perl. Tagged with , , .

5 Responses