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
https://github.com/openhab/openhab/wiki/AlarmDecoder-binding

Looking at the alarmdecoder supported panels FAQ page, the Safewatch Pro 3000 is specifically listed! Score!
http://www.alarmdecoder.com/wiki/index.php/Supported_Panels

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.
http://www.alarmdecoder.com/catalog/product_info.php/products_id/29

The quickstart guide that comes with it is helpful enough to get it connected
http://www.alarmdecoder.com/wiki/images/e/ef/Ad2quickstartv2.pdf

The Getting Started wiki page is also really helpful
http://www.alarmdecoder.com/wiki/index.php/Getting_Started

The installation video really helps to clear up any questions about installing it
http://www.alarmdecoder.com/wiki/index.php/Installation_Videos

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)
http://www.alarmdecoder.com/wiki/index.php/AlarmDecoder_Keypad

Before long, I started getting FC error / Comm Error

These links were pretty helpful for disabling the dialer for now
http://www.doityourself.com/forum/electronic-home-security-systems-alarms-devices/239918-ademco-vista-20p-fc-comm-failure.html
http://www.doityourself.com/forum/electronic-home-security-systems-alarms-devices/290389-disable-dialer-vista-20p.html

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.
http://www.alarmdecoder.com/wiki/index.php/Remote_Access
https://github.com/nutechsoftware/ser2sock

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
http://archive.nutech.com/index.php?option=com_fireboard&Itemid=74&func=view&catid=4&id=656

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.
http://www.alarmdecoder.com/wiki/index.php/Protocol

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
https://github.com/openhab/openhab/wiki/symlinks
This page really helped me understand the syntax of udev rules
http://hintshop.ludvig.co.nz/show/persistent-names-usb-serial-devices/

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.

Technology
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.

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

http://getvera.com/
http://www.smartthings.com/
http://www.wink.com/
http://www.homeseer.com/
http://www.castleos.com/
http://www.openhab.org/

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
http://www.makeuseof.com/tag/getting-started-openhab-home-automation-raspberry-pi/

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. https://github.com/openhab/openhab/wiki/Z-Wave-Binding

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

http://aeotec.com/z-wave-usb-stick
http://www.amazon.com/Aeotec-Aeon-Labs-Z-Stick-ZW090-A/dp/B00X0AWA6E

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.

Advertisement:

GE 12722
ZW4005 On/Off Relay Switch
https://jascoproducts.com/products/ge-z-wave-wireless-lighting-control-onoff-switch
http://www.amazon.com/GE12722-Z-Wave-Wireless-Lighting-Control/dp/B0035YRCR2

GE 12724
ZW3003 In-Wall Dimmer
https://jascoproducts.com/products/ge-z-wave-wall-smart-dimmer
http://www.amazon.com/GE-Z-Wave-Wireless-Lighting-Control/dp/B006LQFHN2

GE 12723
ZW2004 Add-On Auxiliary Switch
https://jascoproducts.com/products/ge-z-wave-wall-add-switch
http://www.amazon.com/GE-12723-Add-On-Switch/dp/B00RKJS8MQ

Sensors
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

http://www.wink.com/products/gocontrol-essential-home-security-suite/
http://www.homedepot.com/p/GoControl-Essentials-DIY-Home-Security-Kit-Z-Wave-and-Wink-Enabled-WNK01-21KIT/205785795
http://www.amazon.com/GoControl-WNK01-21KIT-Essentials-Enabled-Security/dp/B00XUXYSWU

What’s actually in the box?
2x http://www.nortekcontrol.com/pdf/manuals/WADWAZ_install.pdf
1x http://www.nortekcontrol.com/pdf/manuals/WAPIRZ_install.pdf

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 http://www.smarthomedb.com/products

And comparing to the OpenHAB Z-Wave binding database
https://github.com/openhab/openhab/tree/master/bundles/binding/org.openhab.binding.zwave/database

If it matches, I check the device’s capabilities
http://www.pepper1.net/zwavedb/

And use the Open Z-Wave dev documents as reference for the command classes
http://www.openzwave.com/dev/namespaceOpenZWave.html

If it looks supported, I take a peek at the examples in the Z-Wave binding page
https://github.com/openhab/openhab/wiki/Z-Wave-Binding

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.
WindowsMediaPlayer

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. http://dvdid.cjkey.org.uk/
dvdid-command

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.
redirects-and-success

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

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.
request-url

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

The request URL is super straight forward too. Just replace everything after the CRC= with the output from dvdid, removing the | character.
http://metaservices.windowsmedia.com/pas_dvd_B/template/GetMDRDVDByCRC.xml?CRC=92918cc3b7506a7e

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.
response-in-IE

Apr 132014
 

Sometimes I feel a need to automate some meme generation. Luckily I found this incredibly helpful blogpost from jackmeme. http://www.jackmeme.com/blog.php?id=1

I used it as inspiration and did something similar in Perl. Of course the Imagemagick perl-magick reference was invaluable. http://www.imagemagick.org/script/perl-magick.php

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.
68127-radar

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

OllieForecast

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

68127-memetemp

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

68127

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.

meme25

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 grabweather.pl
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: www.wunderground.com/weather/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.

gmail-message

Samples:
overview.pdf
overview.png

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.
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-delete-index.html
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-open-close.html

The awesome people working on elasticsearch already have the solution! It’s called curator.
https://github.com/elasticsearch/curator
https://logstash.jira.com/browse/LOGSTASH-211

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
/usr/local/bin/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 127.0.0.1 and delete all indexes older than 120 days and close all indexes older than 90 days.

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

If you prefer an alternative, here’s one written in perl.
https://github.com/bloonix/logstash-delete-index

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
http://www.ragingcomputer.com/2014/02/logstash-elasticsearch-kibana-for-windows-event-logs
http://www.ragingcomputer.com/2014/02/sending-windows-event-logs-to-logstash-elasticsearch-kibana-with-nxlog

What does all this mean? This heavily redacted screenshot should give some idea.
kibana-ocularis-logs
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.

kibana-irc

I have a ZNC bouncer set up on my network. 192.168.1.10

http://wiki.znc.in/ZNC

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.
pfsense-kibana

BACKGROUND
My home network is pretty boring. Network is 192.168.1.0/24. Router is 192.168.1.254. Logstash is installed on 192.168.1.126.
Continue reading »