Pachube and the wifi thermostat

A few months ago, I installed a wifi-enabled thermostat. It connects to a service in the cloud ( ) and from there you can connect to it from its Android and iOS apps, or directly from the Web. And I was pretty excited (maybe inordinately so) to find out it has an open REST API with some pretty decent documentation. This thermostat speaks JSON.

Literally within an hour of finding the API docs, I had a Python script grabbing temperature readings from the thermostat and pumping them intro a Pachube feed. It took longer to get the thing attached to the A/C and reliably connected to wifi.


I used the requests module for retrieving the JSON. Here’s the short version (config variables have been hardcoded and error checking removed for brevity ;).

response = requests.get( '' )
indoor_temp = json.loads( response.content )['temp']

It helped speed things along significantly having the Pachube part mostly taken care of by the eeml module. Adding that temperature as a new datapoint to my feed goes something like this.

import eeml
pachube = eeml.Pachube( PACHUBE_API_URL, PACHUBE_API_KEY )
# This particular feed has named datastreams -- if you're posting to one with a numerical ID instead, enter that here.
datastream = 'temp'
pachube.update( [ eeml.Data(datastream, indoor_temp) ] )


I was about to wrap this up with a list of reasons I haven’t posted the entire chunk of code on github yet. But like many unpublished personal software projects, it really comes down to some combination of perfectionism and (perceived) lack of free time. “The perfect is the enemy of the good enough” and all that. The right way would be to just post it already – having code out there publicly means other people can spend their free time to help me make it perfect. 😉

Maybe next weekend.

I made a thing


Making a lamp out of a bottle is pretty straightforward, but for fun I thought I’d document how this one was thrown together.


  • a bottle (save the cap) – empty (depending on how you empty it, best not to do this all at once)
  • filler – I used green sand. The hobby store had sand in many colors, $2 for a 1.5 pound plastic jar. It only took half the jar to fill this 750 mL liquor bottle. So, roughly 1 pound of sand per liter of volume you’re filling.
  • a lamp kit – includes the fixture, wire, harp, etc
  • a lamp shade – It seems not many places sell green ones. Finally stumbled on this one at Ikea. SKIMRA. It was sold as a shade for pendant light.
  • a light bulb
  • a house, apartment, or other building – this should have some sort of power outlet, where you’ll plug in your lamp

Assembly Notes
The basic process is this: make an extra hole in the bottle; string the bottle onto the lamp wire; close the extra hole (hot glue!); fill the bottle with sand; assemble the bottle cap (with a new hole in it) and all the lamp parts and screw it into the top of the bottle; plug it in.

Some tips:

  • When drilling the hole in the glass, remember that glass would rather be sand again, and will try to break to accomplish this. Drill slowly.
  • After feeding the wire through the bottle, the plug end should be dangling out the back of the bottle. If the plug end is coming out the mouth of the bottle, you did something wrong.
  • If the wire and plug are inside the bottle, you may be using a Klein bottle. Re-orient yourself and the bottle and start again.
  • Don’t forget to clean up your mess!

Flickr screensaver for Linux

The TV in the kitchen is wired up to the MythTV box (which sits in a closet in another room).  If the TV is left on after a recorded show ends, the MythTV menus are not so pretty to look at.   The standard “Pictures folder” screensaver is nice, but I got tired of manually copying and managing pictures on the Myth box.  Why not use Flickr as the automated source of the pictures?

I poked around for “flickr screensaver linux” on Google and was a bit disappointed. Most of the results a) discuss Mac- or Windows-only solutions, b) link to programs that no longer exist, or c) are more complicated than what I need.

Well, it is Linux … time to roll my own. Maybe this solution is so obvious that no one bothered to document it, but this is what I came up with.  Maybe it will save time for someone else.  Besides, I need a new post to break in the new theme on this blog. 😉

The basic formula: RSS feed from Flickr + podcast downloader + cron +  “Pictures folder” screensaver.
Read on for the details …

Continue reading “Flickr screensaver for Linux”


Just finished reading a book for a class, and it made me realize my parents’ house had a “usability bug” when they bought it. The front entrance is a set of double doors. On the inside, there were two doorknobs. Only the right of the two doors opened, so only righthand doorknob would let you out if you turned it. And this knob only worked if you turned it clockwise. Didn’t confuse us expert users who lived there, but it took some explaining to guests (“try the other one. No, turn it the other way.”). Anyway, just had to capture this example somewhere. ‘Bout time I took down the Christmas decorations on this blog, too.

So I’m in my second semester studying information. Classes this semester are

About those “links” links: for fun (and reference) I’ve been tagging class-related links on with the course number. Which brings me to my other point: if you get bored watching this space and its non-updated-ness, try the super-duper feedburner feed which includes those delicious links and my flickr photos, as well as the main nonsense here. But wait there’s more! I threw together a Yahoo! Pipes feed that comes with all that, plus the amazing Twitter feed!

That is all. See you in May?

 update 2/22/2008: a)The title of this post was inspired by this OK/Cancel comic from 2004. b) This post is now the 3rd google hit for the term “usamajility.”