Saturday, December 31, 2011

Home Automation 2011

Since I wrote about 2011 downloads, I thought I'd write about the automation & related projects I worked on this year.

1) The biggest effort for the year was the Chumby/Infocast project that resulted in Panel Builder, xPLChumbyTTS, and the xPLChumby Python script. I learned how to program ActionScript/Flash and ended up with these awesome, low power and cheap touch panels that make great picture frames and TTS clients. I also totally revamped Panel Builder with a V2 but never finished it up enough to release. Built screens to control every aspect of the HA system, a lot of the screens automatically generated by PHP scripts populating from from existing MySQL databases. The Infocasts also got updated to run Chumby 8 firmware.

2)Integration of the OBi110 VOIP adapter with our existing Asterisk and MagicJack setup. Wrote a syslog Perl script (the main parts are available here) to monitor all sorts of events from the Obi, including touch tones, line status & caller ID. It also does caller ID lookups from our MySQL db of contacts sending results via xPL. Also migrated Asterisk from a Dockstar to the SageTV server.

3) Upgraded SageTV server from Server 2003 to Win 7 Pro & wrote a new xPL Sage app to replace my xPL Plugin. Also paid for and upgraded SageTV to V7 just weeks before they were acquired by Google and gave away the V7 upgrade for free >8(

4) Built an xPL Facebook app with a scripting engine and created a Doghouse Labs page where certain random events are posted on the fb feed via the app.

5) Did a bit of upgrading my Jab2Twit Jabber-Twitter connector. It's the main way I interact with Twitter since GMail/GTalk is always on my PC or phone. It's great getting an IM whenever Amazon's Appstore announces their free app of the day - no need to start another app or check their webpage to find out.

6) Upgraded all my IM client apps, including Jab2Twit, from using the Jabber-NET library to agsXMPP, which is much more robust.

7) Wet my feet with Android development building in tweaks to gtalksms.

8) Did a lot of tuning & tweaking w/ BlueBlabber, my bluetooth-Jabber connector, which I have running on my work PC so my automation system knows when I'm in my office. I just need to publish the latest version. As you can tell, I love using IM as a communication protocol. It's great for bridging remote networks - no need for firewall holes - plus it has the added security of SSL encryption. You can also encode your messages your own way as well to make things more obscure.

9) Added Z-Wave to the HA system, hacking xPL into the open-zwave demo app. I'm really liking Z-Wave, even more than UPB.

10) Lucked out & got a couple of $99 HP Touchpads in the first wave. Installed CM7 on them & have been extremely pleased. The kids & wife love using them.

11) Got the kids (8 & 10) AKA spoiled brats ;) their own Sandy Bridge based laptops, loaded them with Ubuntu & Google Chrome running AdBlock and WOT extensions, and configured with OpenDNS Family Shield so they can surf safely and smartly. Copied the xPLChumby Python script to their laptops so I can send text-to-speech and on-screen messages to their laptops. Added them to my host monitoring so that every 20 minutes of uptime, they are sent a reminder to get up and walk around to rest their eyes and stretch their legs.

12) Hacked pyrocket to put USB rocket launcher on a Seagate Dockstar and use as an xPL controllable pan-tilt webcam.

13) Wrote an extension of xPLGameport to work with cheap 12 button gamepads, obviously named xPLGamepad.

14) Replaced our public webserver (NSLU2) with Seagate Dockstar and picked up a cheap Pogoplug as a backup for the 3 Dockstars that are deployed. The Pogo's been loaded up with Arch Linux.

15) Finally deployed the WebControl I bought nearly 2 years ago. For now, just using the analog inputs and some CdS sensors to detect light levels in rooms. Of course, it's using xPLWebControl - which got a new feature - a fake SMTP server that the WebControl can send an email to, which will be converted to an xPL message.

16) Wrote a Perl script to screen scrape Yahoo Sports and send TTS over our whole house speaker system so I can listen to play-by-play of football games that aren't on TV while I'm debugging the house.

17) Added IP control of our Samsung TV and Blu-ray player via a Python script.

18) Installed 2 new outdoor bullet cams to upgrade the coverage in front of our house.

19) Rooted and installed a custom ROM on my Galaxy S phone in order to fix GPS that Samsung broke with the Gingerbread update and get rid of the Carrier IQ crapware. Been automating my phone lately with Llama and android scripting.

20) Finally unplugged the last Rio Receivers, which were in the kids' rooms. The kids got migrated to Squeezeboxes and I shut down MediaNet, which, with its predecessor xPLRioNet, have been in use with the Rio's since the early 2000s. Those servers first introduced me to xPL and really opened my eyes to a lot of what can be done with home automation.

21) Lots of minor things:
- hardwiring sensors that were once connected to DS10A's now connected to a distributed network of gamepads/gameports residing on Dockstars, thin clients & servers.
- script to import Android contacts into MySQL DB for caller ID lookups
- constantly refining the 4800 line script that runs in starCOMUltra (my main automation engine) and the 2500+ lines of code running in my xPL scripting engine
- did some natural langugage parsing for the system's IM interface - allowing better voice control via IM using the speech input feature of Android & Google Talk - before people got all hot & bothered about Siri & home automation
- integration of reading Google Voice SMS's based on this

I think that's a pretty good summary of my HA work in 2011. What about you?


Thursday, December 29, 2011

Most Downloaded of 2011

Here is our annual list of popular downloads:

1. EventGhost xPL Plugin - 101 times
2. xScript - 67
3. BlueTrackerScript - 54
4. xPLChumby - 51
5. xPLSerial - 21
5. xPLWebControl - 21
7. BlueTrackerScript - 16
8. xPLChumbyTTS - 16
9. xPLGVoice - 16
10. xPLWav - 10

Surprisingly, the EG plugin led the way yet again, but overall downloads were lower than last year. I admit, I haven't been as prolific turning out apps this year. The whole Chumby/Infocast effort was really draining and I don't I think ever recovered from it. It took a lot of the fun out of developing. We do use the Infocasts all the time though. The real interest in Chumby wasn't seen in the download numbers since Panel Builder gets served off of Chumby.com. I did see over 1200 unique IP addresses previewing Panel Builder - although I don't how many actually installed it.

Saturday, October 8, 2011

Power Savings and Prepping for an EV

Last week, I had some free time to reassess what devices I have running and whether or not I still use them at all. This was born out of some preliminary research into purchasing an electric vehicle (EV). Nissan Leafs are actually available now to those without reservations. That's the more realistic choice, but I really like the Telsa Model S. I've been missing a sporty car since my Honda roadster was totaled last year.

Taking the Nissan Leaf as an example, with its 24 kWH battery and 100 mile range and my current commute of about 30 miles roundtrip, I could drive 3 days per full charge. I would drive one of our other cars one day a week, so that would leave about 16 days/month on the EV. Rounding it to 15 days, I'd need 5 full charges or an additional 5*24kWH = 120 kWH of electricity per month.

Fortunately, we had solar panels installed 18 months ago. Since then, we've been able to stay in the lower 2 tiers of electricity costs for 11 out of the first 12 months we've had them. Those lower tiers are now 12.2 cents/kWH and 13.9 cents/kWH. The 3rd tier jumps to over 30 cents/kWH and the 4th and 5th tiers more costly. In December 2010, we used 73 kWH of tier 3 electricity. The 2nd worst month was January 2011, but we were 60 kWH below tier 3. The other 10 months we were 150-500 kWH below tier 3.

So if nothing changes, it would be "expensive" to drive an EV in December. The 120 kWH of electricity to charge the EV would all come in tier 3 at a cost of about $36 for 450 miles. That ends up being more than the $33 it would cost to drive our Prius the same distance (assuming $3.70/gallon for gas), but less than the $70 it costs our Subaru. It would cost about $26 in January. April to October would be all tier 1 electricity and cost about $14.50. February, March and November would be about half tier 1 and half tier 2, or about a buck more per month than April-October.

These are hardly savings compared to a hybrid - maybe $150/year. Compared to our non-hybrid, it's more significant - $550/year. When the economy improves, those savings will go up as gas prices will rise. For me, the real savings will be not sending as much of our hard earned money to big oil companies or countries that want to destroy the American lifestyle.

Political statements out of the way, there are some special options our electric utility has for EV owners. One is a time-of-use option where they charge a high rate during peak periods and less during the late night-early morning. This wouldn't work out well for us because of all the HA related servers, electronics, etc running 24x7. Another option is the installation of a 2nd electric meter specifically for charging the EV, but that's at least $2000. A third option would be to install an additional 6 solar panels on the west facing portion of our roof. It's not an optimal position and I haven't priced it out - but I figure it would be around $4000. I could do some of the work myself as I did an install with SunWork before. Of course, the obvious option is to cut our electricity usage - specifically the things that run 24x7.

I have to admit, having solar, I've been lazy about conserving. Rather than run a long Cat-5 cable, I plug in another Ethernet switch. Instead of using an extension cord to get to a UPS already installed, I add another UPS. When security cameras get updated, I keep the old ones plugged in pointing somewhere else - not really someplace necessary. Last weekend, I fixed all that. I pulled 4 UPS's, 4 Ethernet switches, 2 cameras, 3 modulators, one Squeezebox and 1 Slingbox. I disabled Connect24 on our Wii so it can idle at 1W instead of 9W. I unplugged a clock radio in the garage that used 10W. The end result is I cut about 3 kWH/day or 90 kWH/month. That's almost as much as the 120 kWH/month an EV would require!! This was by far the cheapest option. You can really see the results in a chart. In the 5 full days since my unplug-fest, our usage has never exceeded 20 kWH/day.


Now, we have headroom for an EV - I just need to decide whether I'm ready to plunk down all the cash for one.

Monday, September 5, 2011

Random Bits

I just finished my first week at my new startup and I'm already buried. New designs & new methodologies to learn and I need to know it by yesterday. I've spent a lot of time this 3 day weekend going over some training material I got from a co-worker. I did, however, get around to some minor automation stuff.

I finally hardwired some contact closures which were connected to DS10As. I just needed a little more accuracy for these sensors and sometimes I would get collisions with other X10 wireless devices which would cause status updates not to be received. I've wired these sensors to a USB gamepad connected to the thin client that interfaces to our Brultech power monitor. My xPLGamepad app relays the closure state via xPL.

This weekend I also upgraded to the kids from Rio Receivers to Squeezeboxes and turned off Medianet for good. It was a good run, but most of the house was running Squeezeboxes so it was time to consolidate to one music server. Medianet really helped push me deeper into home automation. Years ago, while searching for alternate servers for the Rio Receivers, I stumbled onto Medianet's predecessor, xPLRioNet. Installing it not only gave new life to the Receivers, but introduced me to xPL which has become such an intricate component of our HA system.

Finally, we've got these chef's mats on our kitchen floor, which are pretty thick. The Roomba will go up one of the mats, but will never go down due to its cliff sensors. This makes for one very clean mat, but that's about it. The cliff sensors work by bouncing IR off the ground and if it's not reflected back strong enough, the Roomba thinks it's on an edge and won't continue in that direction. I never use the Roomba upstairs so I chose to disable the cliff sensors. Fortunately, I had some aluminum tape from some HVAC work I did and used it to tape over the cliff sensors. The aluminum works perfectly and reflects the IR back to the cliff sensor and our kitchen floor is now clean again.

Wednesday, August 31, 2011

So Where's That Health Care Reform?

It's been a while since I've blogged as I've been busy tying up some loose ends at work. This post qualifies in the "random stuff" category, but it's still a post ;)

It was a little over a year ago that my employer shut down our group and laid off most of the hardware engineers. I ended up trying out contracting for a year, having never done it before in my career. One of the big issues for contractors is health insurance - actually obtaining it and then paying for it. We didn't have any issues getting coverage - other than one of our grade school children having mild asthma. That one minor condition triggers all sorts of warning bells at health insurance companies. Our son had to be listed on his own separate policy, which means he couldn't be under our family plan and we had to pay additional premiums for a 2nd policy. It also meant he would have his own deductible, and since we opted for a high deductible plan ($5000 family, $2500 individual - anything else would have completely unreasonable premium), we were unable to pool our expenses together to meet one family deductible. What a joke.

Over the course of the year, our insurance premiums went from reasonable to ridiculous. The family premium for myself, my wife and daughter started at $244/month, jumped to $373 the next month and in January it spiked to $509. Just 4 months later, it rose to $516. In July, we received notice of yet another increase in rates to $593 effective October 1st. We did also have to pay for our son's policy, which started around $40/month, gapped up to $70/month then to over $100/month in January. It too, will be having a rate increase in October, jumping to $115/month.

In the course of 15 months, our family plan premiums would have risen 243%!!! The two policies combined started off around $300 in July of last year and in October will run $708!!! Our son's mild asthma ended up being a 20% rate increase from our family plan rate every month.

Fortunately, I've returned back to a full time position with employer provided healthcare. Healthcare insurance is a scam. Nothing justifies a 243% increase in the course of 15 months. Health Net you suck.

Saturday, June 25, 2011

Various Updates

I've been working on a number of projects off & on the last few weeks. A few weeks ago, I tweeted about this app called GTalkSMS. It has a lot of potential for automation. I played with it a while, downloaded the source and modified it. I wanted my HA system's Jabber interface to be able to interact with GTalkSMS. It was using Jabber-NET, but for some unknown reason, that package isn't able to communicate with GTalkSMS. I found another free Jabber library, agsXMPP, and tried that out. It was able to talk to GTalkSMS so I ripped Jabber-NET out and replaced it with agsXMPP. For the most part, it was easy to swap libraries.

Next, I decided to replace the Jabber-NET client in Jab2Twit with agsXMPP because it's not able to communicate when you chat with Google's talk gadget (like in Chromebooks). I also finished up IM'ing new tweets and tweet filters. That's about wrapped up and ready for release.

I did a little work with Kinect, eventually moving to Windows as I couldn't make much headway in Linux. That's been backburnered as Microsoft recently released their official beta SDK for Kinect. I haven't had time to really play with it.

We also had our annual pilgrimage to the Southern California theme parks and in preparation for our trip, I set up a mini mobile camera viewer. It's just a simple web page with JQuery and AJAX. Since the cameras are on different servers (or are IP cameras), rather than set up SSH tunnels to each IP address, I basically proxied them through Apache - so I only had to tunnel one port. I used this technique I've used before. One other issue I had was I couldn't view MJPEG streams of certain IP cams with the AJAX technique I implemented. I found this PHP code to return a single frame from a stream.

I also picked up a Kindle Special Offers because up all the deals they've been handing to owners (such as 20% off HDTVs!). It's the first e-reader we've had and I have to say it's pretty cool, whenever I can pry it out of my wife's hands.

One more thing I got was an Aeon Labs ZStick to use with the handful of closeout ZWave modules I scrounged from Radio Shack months ago. There's a particular area of our house where UBP and X10 just don't work reliably and I've given up trying to figure out the noise source that's causing problems. I figured the ZWave modules would be perfect in this situation and took a stab at using the Open ZWave project. It was really easy to build and I slapped an xPL interface onto the demo .NET app and was controlling the modules in about 15 minutes. ZWave is now fully integrated into our system - using this hacked app. Our needs for ZWave are simple, just turning on & off modules, no scenes or other complexities. Maybe if I can find more closeout modules, I might expand its features.

Finally, I picked up a couple Lepai T-Amps from Parts Express via Amazon.com - just $20 + S&H. These are nice little amps that I'm using in conjunction with a couple Squeezeboxes I have lying around. I'm starting to phase out our remaining 3 Rio Receivers with gen 1 Squeezeboxes and SliMP3s I've found on Craigslist.

My next project I plan on working on is expanding the capabilities of our system's IM interface. I would like to increase its capabilities of interpreting text into commands usable by the system. With all the voice capabilities built into Google apps and Android phones, this could be a simple way to have reliable pseudo voice control from anywhere. The idea is to use the voice to text features of our Android phones, for example, to dictate to the IM client. Then pressing send and let our system regex the text to extract useful commands and perform them. Easy enough right?

Wednesday, June 1, 2011

More Tweeting, Less Blogging?

I remember seeing an article some time ago about a guy who was a really prolific blogger. He posted about how Twitter has rendered blogging obsolete. I started on Twitter in July 2009 and the frequency of my blog posts has tailed off considerably. For me, Twitter let's me write about more useless things and things off the top of my head, things I wouldn't necessarily blog about. I think I'm less interested in writing much these days, but I can tweet little bits. Also, I tend to spend more time with blog posts, editing wording and grammar, but with Twitter I don't care about editing other than fitting in 140 characters, so it saves me time. I'll continue to blog when I feel the need to add more detail, but if you don't mind a bit of noise, you can follow me over on Twitter.

I've got a number of projects I'm working on at the same time, multi-tasking or ADD, depending on how you look at it ;) Too many to make any real progress on any one of them. I've been updating my Twitter clients (xPLTweet and Jab2Twit) and working on my Facebook bot/scripting engine. I also started Android development and have loaded my first app on my phone that just has 2 buttons and does nothing yet. Finally, my Kinect came yesterday and I spent last night configuring a Dockstar to get X windows running so I can play around with libfreenect. As a big hoops fan, the NBA finals are distracting me from making progress. It's good to be busy right?