Nov 012015

As you can see from previous posts, I’ve started automating my house. There was an ADT alarm system installed. I was given a user code, but that was it. I opted not to pay ADT’s ridiculous monthly fee since reasonable monitoring can be had for $10/month.

Looking at the panel, I have a Safewatch Pro 3000, which the internets tells me is close to a honeywell/ademco vista20p without a couple features like zone doubling.

I have a simple touchpad, not an alpha display, probably similar to the 6150, so it’s terrible to program with.

The wireless receiver is in the 5881 series, still don’t know for sure the specific model, but I suspect its the 5881enh.

Looking at the OpenHAB wiki, there’s only a couple options for alarm integration, and alarmdecoder seems to be the thing to use for honeywell/ademco panels

Looking at the alarmdecoder supported panels FAQ page, the Safewatch Pro 3000 is specifically listed! Score!

So I bought an alarmddecoder AD2USB to interface with the alarm. I have to say their shipping is pretty reasonable. I had it within a week.

The quickstart guide that comes with it is helpful enough to get it connected

The Getting Started wiki page is also really helpful

The installation video really helps to clear up any questions about installing it

Of course life happens and it was almost another week before I had time to try connecting it.

I’m going to pick another service for monitoring later, so the ADT communications programming isn’t useful to me. If you’re still using ADT for monitoring, definitely put your account in test mode before monkeying with anything,

According to the Safewatch Pro 3000 manual, you can get into programming without the installer code by pressing both the * and # keys within 50 seconds of startup.

I pulled the battery connection from my alarm, tripped the GFCI outlet the transformer was plugged into, then powered back up, and pressed both buttons. Instantly in programming mode!

First order of business, setting a new installer code. This will allow me to get back into programming mode without cutting power.

The installer code field is *20. Assuming I want to use the code 1234 as my installer code, the sequence is *201234
If you don’t want to change the installer code, but just read out the installer code, read field is #20.

The whole point of this was to enable another touchpad on address 18. That’s data field *191, I only have one partition configured, and I don’t want it to suppress the beeps. The key sequence is *19110

Done programming, *99 is the command to exit (without locking out programming mode)

Following the quick start guide, I powered down the panel, disconnected the battery, and connected the alarmdecoder

Powering back up, I connected the battery and reconnected the transformer. On my windows laptop, I used the alarmdecoder keypad program. The keypad program is excellent for testing (and further programming if you’re like me and don’t have an alpha keypad)

Before long, I started getting FC error / Comm Error

These links were pretty helpful for disabling the dialer for now

Disable dialer
*41*, *42* and *94* and *92 0 0

A few other bits copied from the manual I found really helpful

Set new master code
[installer code] + 8 + 02 + [new master code]

Add a user code:
[Master Code] + [8] + user # + [New user code]

Delete a user code:
[Master Code] + [8] + user # + [#] [0]

I had some issues with the openhab binding for the alarmdecoder connecting directly to the serial device. It kept setting the baud rate wrong. Instead of correcting the issue and submitting a patch, I set up the ser2sock TCP/IP port proxy for it. It makes configuring the panel from my laptop easier anyway.

One thing to remember if you have all hardwired zones, the keypad can’t see those messages so you’ll have to use the relay emulation feature of the alarmdecoder and tie your hardwired zones to a relay output

The sample config in the alarmdecoder binding page in the openhab wiki is probably enough to get you rolling. For specific configuration of your zones, you’ll want to skim the alarmdecoder protocol to get a handle on the bit masking so you can properly address your zone devices.

One final annoyance, usb serial devices can move around between reboots, so tweaking some udev rules to create symlinks to specific hardware keeps things from breaking
This page really helped me understand the syntax of udev rules

Sep 142015

We (my wife and I) are finally home owners. Now that I have a home to play with, I wanted to get back into home automation.

Before buying anything, I needed to survey the market again so I don’t buy something that’ll lose support over the next 5 years.

In the US market, for easily available in-wall switches, there’s X-10, Insteon, Z-Wave, and Lutron’s Caseta wireless. I’ve already got X-10 equipment and I’m not making that mistake again. Insteon’s main claim to fame was X-10 compatibility. Caseta wireless is only made by lutron and has limited compatibility. Z-wave has some drawbacks, like a technically proprietary protocol, etc. The Open Z-Wave project has done a lot to address those concerns.

I did some reading and arrived at this list of serious contenders.

The first 3 are devices with cloud tie-in. Vera has superb compatibility. Smartthings is pretty awesome, just released their second version, but I’m still salty at Samsung for what they did to Boxee. Wink is super slick, but Quirky is in a bit of trouble so continued support isn’t certain.

The last 3 are software running on a local computer. Homeseer is sort of the grandaddy of the bunch, having been around for the longest. I’m still tempted to buy it when it goes on sale because it’s so well integrated, but it is the most expensive option here. Castle OS is pretty awesome too, with awesome speech recognition.

I’m ultimately deciding on OpenHAB. It’s free, which is nice, but more importantly, it’s open and has a rapidly growing international community.

This link is pretty helpful for getting started with OpenHAB

Interface Hardware
Since I’ve decided on Z-Wave and OpenHAB, the wiki page for the Z-Wave binding is probably a good place to start looking.

Searching each device on the Supported controllers table, the Aeon Labs seemed to be the easiest to buy, gen2 and gen5 are about the same price… both have compatibility with homeseer if i decide to go that route in the future. This was a pretty easy decision: Aeon Labs USB Z-Stick Gen5

Light Switches
These were easier to pick out than I expected. The most reasonably priced switch capable of controlling LED and CFL bulbs was in stock at the local Lowes for a lower price than Amazon. A small pile of Lowes 10% off moving coupons later, I’d cleaned out inventory at the 3 closest Lowes stores.

Quick note about these switches, the 12722 will do a Z-Wave hail when switched from the switching unit, but not the 12723 add-on. the 12724 doesn’t seem to send a Z-Wave hail. The 12724 buzzes with a lot of LED bulbs, but the Cree flow LED bulbs from Home Depot don’t seem to buzz.


GE 12722
ZW4005 On/Off Relay Switch

GE 12724
ZW3003 In-Wall Dimmer

GE 12723
ZW2004 Add-On Auxiliary Switch

One thing that makes this easier overall, there are only a few manufacturers actually making this equipment. It just takes a bit of googling to find out who actually makes the rebranded stuff. In the case of the door switches and motion sensor I bought, it was labeled GoControls for Wink, but made by Nortek Controls (which is Linear)

I bought this multipack at the local Home Depot to get started

What’s actually in the box?

Other Hardware

Of course this is just a start. I want to expand this as much as my wife and finances will allow!

To pick additional hardware. I’m starting with this site

And comparing to the OpenHAB Z-Wave binding database

If it matches, I check the device’s capabilities

And use the Open Z-Wave dev documents as reference for the command classes

If it looks supported, I take a peek at the examples in the Z-Wave binding page

Mar 292015

Like many people, I’ve been trying to find an easier way to archive all of my movies and TV shows to hard disk instead of DVD disc. My previous attempt at semi-automated DVD ripping used an autoloader and some scripts, but it still required a lot of intervention because I couldn’t find a way to correctly name and tag my movies automatically. I wished there was something like CDDB or FreeDB for DVDs that would lookup metadata from the disc in the drive.

Windows Media Player does a lookup of the DVD metadata so I figured it had to be possible.

Thankfully, I’ve stumbled across an awesome utility that will get the DVD’s discid in the format Microsoft uses for their media player and media centers.

Time to fire up Wireshark (or Ethereal if you’ve been doing this forever) and see where that request is going. I stuck the disc in my DVD drive and opened Windows Media Player. A couple of HTTP 302 redirects later I’ve got a HTTP 200 and the current request and reply.

Looking at the discid and the URL, it looks like it strips out the vertical bar pipe character | that was used in previous versions.

Opening the request gives me the URL. It looks like it’s using “User-Agent: Windows-Media-Player/12.0.7601.18741″. To avoid being ridiculously obvious while abusing this api, it might be a good idea to spoof your useragent as well.

Response is an XML file. Looks really straight forward to parse.

The request URL is super straight forward too. Just replace everything after the CRC= with the output from dvdid, removing the | character.

There doesn’t appear to be much of anything prevent this from being abused. It opened in a regular browser without issue. I used IE in this screenshot.

Apr 132014

Sometimes I feel a need to automate some meme generation. Luckily I found this incredibly helpful blogpost from jackmeme.

I used it as inspiration and did something similar in Perl. Of course the Imagemagick perl-magick reference was invaluable.

The first thing I thought of with automated meme generation? The Weather! See my previous post about getting data from the Weather Underground API using Perl

This naturally lead to the forecast overlaid on the current radar.

Inspired by, I decided I want my daily forecast in meme form. The first weather-related meme I think of is Ollie Williams.


But that doesn’t really fit with the meme. Change fucking to motherfucking and Samuel L Jackson is PERFECT!


Smoosh those memes together and I’ve got my morning weather!


I found another source of amusement while playing with generating image macros. There is a Pyborg bot in one of the IRC channels I frequent. “She” says some pretty funny stuff, so we keep a quote list. Of course this is ripe for meme-ifying.


More Evequotes are available in the Imgur Album

Keep reading to see the secret sauce.
Continue reading »

Apr 132014

Weather data is pretty cool to play with. Especially when playing with home automation or just turning the current weather conditions into a meme.

For example:
Weather for Omaha, Nebraska on 4/13/2014 at 16:00

raging@virtualbox3:~/weather$ perl
Forecast - Today:
weekday:        Sunday
high:   61
low:    27
precip: 100
cond:   Thunderstorm
month:  4
day:    13
hour:   22

Forecast - Tomorrow:
weekday:        Monday
high:   43
low:    25
precip: 10
cond:   Partly Cloudy
month:  4
day:    14
hour:   22

Forecast - Day After Tomorrow:
weekday:        Tuesday
high:   66
low:    37
precip: 0
cond:   Partly Cloudy
month:  4
day:    15
hour:   22

Current Conditions:
conditions:     Overcast
temp:   34
relative_humidity:      86
wind:   10.9
wind_gust:      0
pressure_trend: -
feelslike:      26
precip_1hr:     0

Radar Static Image:     /tmp/68127-radar.png
Animated Radar Image:   /tmp/68127-amimatedradar.gif

More info about Weather Underground’s API:

Keep reading for my bit of Perl to grab it and make it usable.

Continue reading »

Mar 082014

Since I mostly deal with Windows computers, and partially because I couldn’t figure out why phantomjs on my debian netinstall rendered fonts to be UGLY, I figured I’d use one of the many windows computers to render and email the reports. I’m using my gmail account for testing this.



That looks pretty awesome, right? The secret sauce here is PhantomJS It pretty much a headless WebKit. A browser without a display. And it’s cross-platform!

I use PhantomJS to screenshot for PNG output and print to PDF. I then use ImageMagick to crop the PNG to a reasonable size. I use sendEmail to, well, send an email with the files attached.

Enough jibber-jabber.
Continue reading »

Feb 162014

Part 4 of 4 – Part 1Part 2Part 3

Now that you’ve got all your logs flying through logstash into elasticsearch, how to remove old records that are no longer doing anything but consuming space and ram for the index?

These are all functions of elasticsearch. Deleting is pretty easy, as is closing an index.

The awesome people working on elasticsearch already have the solution! It’s called curator.

I like the idea of being able to let a cron job kick off the cleanup so I don’t forget.

To install, we’ll have to instal pip.

sudo apt-get install python-pip

Then use pip to install elasticsearch-curator

pip install elasticsearch-curator

When making a cron job, I always use full paths

which curator

edit the crontab. Any user should have access so I’ll run this under my user.

crontab -e

Add the following line to run curator at 20 minutes past midnight (system time) and connect to the elasticsearch node on and delete all indexes older than 120 days and close all indexes older than 90 days.

20 0 * * * /usr/local/bin/curator --host -d 120 -c 90

If you prefer an alternative, here’s one written in perl.

Feb 162014

That’s quite a title. I work with an ONSSI Ocularis CS setup. Originally installed with NetDVMS, but upgraded to RC-C.

This post builds upon a couple earlier posts

What does all this mean? This heavily redacted screenshot should give some idea.
Number of overall motion events over time, same for failure events. Top list of cameras with motion events, top list of cameras with failure events.

You can see we’ve got a few failed cameras. Likely a power surge or network failure. Having this information will lower the time to repair, minimizing camera down time!
Continue reading »

Feb 162014

To make sure I understood how to find data using Kibana3, I started collecting input from IRC.


I have a ZNC bouncer set up on my network.

I have it set to Keep Buffer, Prepend Timestamps.
Timestamp Format:

[%Y-%m-%d %H:%M:%S]

Continue reading »

Feb 162014

I have been on a logging kick (or obsession) lately. See the previous series of posts.

I’ll start with a picture. This is seriously cool. If you’re running pfsense, you want this.

My home network is pretty boring. Network is Router is Logstash is installed on
Continue reading »