Graphing temperatures from 1-Wire sensors and the Nest Thermostat in rrdtool


Background, and adding temperature graphing

A couple of years back I added additional attic insulation into my home, bring the insulation up from R-19 to R-38. I also added a radiant barrier in the attic as well, in an attempt to reduce the heat rise in the attic during the summer months especially since the air conditioning ductwork is located up there.

Since I was curious how hot it actually gets in the attic, I installed a ControlByWeb temperature module to monitor the temps. The module provides 4 temperature inputs, using 1-Wire sensors, and uses its built-in web server to output data on a web page or in XML format. It came with 1 temperature sensor, but it was easy to fabricate 3 more using Cat-6 cable and some shrink wrap tubing.

I put two of the temperature sensors in the attic: one near the center, and another near the rear of the attic right above the master bedroom. The remaining two sensors were placed in the garage and outside of the the eaves on the shaded (north-facing) side of the home.

I wrote a short PHP script that parses the temperature module’s XML page and set up a cron job to run every 5 minutes to poll it + pipe it to rrdupdate. A separate bash script calls rrdtool graph and updates the actual rrd graph every couple of minutes via cron and voila, graphs:

Sending temperatures to Weather Underground

Since I am tracking exterior temperature 24/7, I figured it would be cool to create a Weather Underground Personal Weather Station. That same PHP script that polls the temperature also sends the exterior temp to Weather Underground, via their simple upload protocol.

Adding the Nest Thermostat to the mix

I also installed a Nest Thermostat into the mix, and since it was network-enabled like the ControlByWeb temperature module, it would be great to add its temperature reading to my graphs as well. I could have just repurposed one of the 1-Wire sensors to track indoor temps, but that would have required potentially drilling through some drywall and poking out a sensor somewhere in my house, which would have been unsightly. What better than to just use the reading from the thermostat?

Sadly, Nest doesn’t provide a public API to access its data (at least not yet, until the Nest Developer Program is publicly available), but some enterprising folks have figure out the API that the Nest uses to communicate with the mothership. One such package is nest-api. The package is easy to use, and after a few minutes configuring it, I was able to get the temperature reading of my thermostat. It was more work adding the new data source to the rrd than get nest-api integrated.

The Nest’s temperature graphed in my temperature graph:

Download the files

Go to my project on github to get the source files.


1) Since nest-api basically gives me all the data on the Nest, like if the A/C or furnace are on, it would be nice add to the graph a visualization of that.

2) Also, once I get a Nest Protect, and assuming that it has a built-in temperature sensor, it would be nice to integrate its temperature reading into the graphs as well.

Downloading earlier versions of iPhone OS


If you’re ever in need of downloading an earlier version on the iPhone OS, iClarified has a list of iPhone firmware files for download from Apple’s servers. This is great if say you need to downgrade your iPhone 3G from iOS 4 back to iOS 3.1.3.

Grain of sand: 0, Canon SD800 IS: 1


Our trusty Canon PowerShot SD800 IS locked up the other day in the lens open position and whenever it powered up a “Lens error, restart camera” error message appeared on the LCD screen and the camera would then shut off.

Ends up that there was a single grain of sand that was stuck in between the gears that open/retract the lens. The cover is secured by a few tiny screws so it’s actually pretty easy to open up. Once I got the little bugger out from in between the gears (simply by manually turning the gears by hand), I fired up the camera again and the lens started working again!

Here are some disassembly pics, with the gears that control the opening/retracting of the lens circled in yellow.

Swapping out the hard drive in your DirecTV DVR with a larger one, and copying your content over


We have DirecTV’s HD DVR service at home but we were beginning to outgrow the stock 320GB drive in our HR21-700 receiver as it is chronically under 10% free capacity. I decided to pick up a Western Digital 1TB Green drive (model WD10EADS) to replace it.

This forum post on DBSTalk.com contains a pretty detailed walk though with photos detailing the removal procedure. Although the photos are of a slightly earlier version of the HR2* series receivers, the steps are pretty much the same.

You can simply swap the drives without copying your existing shows to the new drive, but I decided to copy over my old shows. The directions posted on using GParted worked like a charm. Be prepared for the data to copy from drive to drive though…it took about 2 hours and 15 minutes for me.

Resurrecting an IBM “Deathstar” Deskstar 75GXP hard drive


I have a bunch of hard drives from old PCs that I’ve kept around since I’m a pack rat. I really should just burn what I need to keep onto DVD and recycle of all these tiny-by-today’s-standards 10-40GB hard drives. It’s amazing to think of how much more data you can cram into the same physical drive now a days — a few weeks ago I loaded 4-750 GB drives in our NAS at work. Even my dinky USB thumb drive can hold 4GB. Anybody remember 5.25″ floppies (I was a bit too young to experience the 8″ floppies)? +10,000 points if you had colored floppies, even.

Anyways, I had an old 40GB 7200RPM IBM 75GXP Deskstar , which later came to be known as the IBM 75GXP Deathstar due to their high failure rates. I somehow lucked out and didn’t have one fail on me when it was the primary drive in my PC at the time. Fast forward to the present, and I hooked up the drive to an external USB enclosure to try and find a Word doc that I couldn’t locate elsewhere. The drive spun up but wouldn’t mount in XP. I thought great, it turned into a Deathstar.

I spent hours trying a bunch of different things to get the drive to mount, but no luck. I finally googled around and came across some eBay pages where people were selling the logic board to this drive. Ok, so replacing the logic board was an option. Awesome.

I flipped the drive upside down and took a look at how hard it would be to swap out logic boards. It was then that I noticed that one of the solders connecting the the IDE pins to the logic board was bad & wasn’t making a solid connection. I hooked the drive back up to the enclosure and pressed down on the loose pin (actually the entire row of pins) with the edge of a credit card, and lo and behold the drive mounted. Even better, I was able to find what I was looking for on that drive. :)

Page 1 of 212
Go to Top