Tuesday, June 30, 2009

Somewhat Quiet Last Few Months

I've been a little preoccupied with other things, but I have been working on some small projects here & there. I just haven't felt like writing about them. I'll try to summarize what I've been doing for the past several weeks/months.

Last night, I hardwired the sensor that detects when our alarm is armed. Originally, it was a CDS cell covering the armed LED on one of the alarm keypads. The sensor was then connected to the CDS input of an X10 Hawkeye. It worked well 99% of the time, but once in a while, it would a miss detecting a change due to some RF collision. Not a major problem as the alarm is completely separate from the HA system, but annoying for automating events. So, I ran a pair of wires from the CDS cell at the keypad to the wiring closet. I terminated it on the X-Axis of the third gameport controller I've deployed. It works perfectly now.

I've gotten fairly adept at fishing wire with no special tools. For the CDS wire, I routed it from eyelevel where the keypad is to just above the baseboard. I used a string with bolts tied on and dropped it into the wall from an eyelevel hole. I drilled a small hole above the baseboard and used a vacuum to suck the string out. I then fished the wire through by taping the string to it.

I also added a 2nd HDHomerun (which also involved fishing wires - some Cat-5E and RG6.) I have it currently connected to an HD antenna in the attic.

I've been slowly deploying more of the UPB modules I got on clearance from Fry's. As my UPB network got bigger, I started to notice some limitations in my handling of it. I wrote my own code to handle UPB since my old TimeCommander+ does not have the capability. It resides in my xPL starCOMUltra bridge as described here. It's actually just a generic serial interface in the bridge. All of the actual code handling UPB is in the hosted JScript.

To make a long story short, I was having problems with retries and sending commands to the UPB PIM too fast. I solved this by adding JScript code to build a command queue and beef up the retry/busy/NAK logic. It uses the built in Queue structure, similar to JavaScript and described here.

I also bought a couple more HP thin clients off of eBay. I am now planning on installing .NET on them, so I've also purchased these 512MB flash disks so I have enough room for it (.NET needs about 150MB free on the C: drive). I also found some cheap 512MB RAM upgrades as well. One will be deployed at our other house for more minor automation projects and the second one will replace the current T5700, which functions as a networked contact closure device. I want to test out & phase in the new one before taking the existing one offline to upgrade and move elsewhere in the house.

Tuesday, June 9, 2009

Impressed With Our ISP Speeds

I haven't run a speed test since years ago when we first got Comcast HSI. Back then it must have peaked around 2 Mbps down and maybe 384 Kbps up. I just ran a test and I'm seeing 15 Mbps down and 9 Mbps up! Very nice!

EventGhost xPL Plugin Version 0.2

I made some suggested changes to the plugin to make it play better in EG. Get it here.

Edit: bumped to 0.2.1 download link updated

Monday, June 8, 2009

Deadbolt Monitoring

With a couple little kids going in & out of the house, they often forget to lock the doors when they come back in. So, I've been looking into ways to monitor the status of the deadbolts (and the sliding door lock). I have some limited options as I'm not putting in any new door frames, so the walls won't be open.

I looked at using plunger switches drilled into the door frames that would get pressed when the deadbolt was locked. I didn't really want to drill into the door frame to install it and have to figure out what to do with the wire on the other side of the door frame.

I opted for the typical magnetic reed switch solution. Fortunately, a couple doors had deadbolt holes deep enough to fit mini reed switches without interfering with the deadbolt. I was easily able to glue them into the deadbolt hole and route the wire to the bottom of the door frame and out to where I needed it to go. For the magnet end of things, I got some 10mm x 1mm rare earth magnet discs from eBay. I superglued these to the end of the deadbolt, so that when the deadbolt closed, the magnet would be close enough to cause the reed switch to close.

One deadbolt hole wasn't deep enough and I didn't feel like drilling deeper into the doorframe. Instead, I found some subminiature reed switches at a local electronics surplus store. They're very tiny with a glass casing, so you need to be careful installing them as they're easy to break. I etched out a place in the deadbolt hole so I could glue the reed switch in, making sure it was far enough away to not get crushed when the deadbolt closed.

The sliding door has a different locking mechanism so I had to be a little creative monitoring that. Again, I used a subminiature reed switch and mounted it on the door frame. I used half of a rare earth magnet and glued that to the lock latch. It took a few iterations to get the right position of the reed switch and some careful wire placement to run the wire, but I was able to get it monitored.

I have everything run to the gameport adapters that I used for contact closure monitoring. I'll post some pictures when I get the chance.

Thursday, June 4, 2009

Hibernating Sage Server & Waking Up HD Theaters

I've finally gotten around to optimizing the powered on time of the media server. To get started, I have Sage export its recording schedule to a network drive by setting this option in sage.properties: scheduler_export_file=. I just specify the path to the file I want it to dump to. It creates a tab delimited file containing the recording schedule for the coming week. I parse this file daily at 1AM and keep track of the earliest start time and latest end time for the day.

The server gets shut down sometime after we've gone to bed and after the last recording. It actually gets hibernated remotely from the HA server using psshutdown. I use the command psshutdown -h \\machine-name to initiate hibernate.

The problem with hibernate is that wake on lan will not work to bring the machine up, but it will work when the machine is shut down or in standby. I opted for hibernate since the machine comes up faster than from power off and uses less power than standby. I needed a way to automatically push the power button to turn on the server. I wired this relay to the power button, connected it to a 12v wall wart plugged into a UPB appliance module. Now, my HA server sends a UPB command to turn on the wall wart & then turn it off. This causes the relay to close and activate the power switch before the relay opens again.

Once Sage is awake, I have EventGhost macros that check to see if the server just came on or came out of hibernate. Those macros then kick off a python script that telnets to the HD Theaters and reboots them so they are powered up and waiting on the sage menu.

import telnetlib

tn = telnetlib.Telnet("")

tn.read_until("login: ")