geek

Pachube and the wifi thermostat

Posted in geek, thingaday on February 1st, 2012 by larcher – Be the first to comment

A few months ago, I installed a wifi-enabled thermostat. It connects to a service in the cloud ( my.radiothermostat.com ) 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.

Code

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

response = requests.get( 'http://192.168.1.123/temp' )
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) ] )
pachube.put()

Excuses

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.

Flickr screensaver for Linux

Posted in geek, pictures on January 6th, 2009 by larcher – 7 Comments

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 …

read more »

Dorkbot Austin!

Posted in austin, geek, hardware, science on July 14th, 2006 by larcher – 1 Comment

Natalie and I went out dorking tonight :) The dorkbot made it’s second appearance in Austin tonight at Cafe Mundi. There was some great geeking going on .. I think we missed the first presentation though (got there around 8:30).

First one we saw was Joel Greenberg showing off his nifty homemade mic zeppelin. According to my del.icio.us links, I read about this back in April, but didn’t realize he was from Austin. (Note to self: checkout his podcast )

Next up was Rich LeGrand and his Lego-bot with a Gameboy brain. Basically, he put an FPGA and some flash memory on a card that fits in the Gameboy Advance cartridge slot, which lets the GBA brain talk to sensors and motor controllers and cameras and all kinds of roboty goodness. For a demo, the bot spotted a loose lego piece, wheeled itself over, grabbed the piece, and moved it to the other side of the table. It was also able to learn and repeat and little dance — you push the thing around the table, and it senses the movement through the motors, records it, and plays it back. ( video! )

The Austin Robot Group had the last two presentations: Eric Lundquist explained the Babbling Head and had it sing a few songs, and Vern Graner demoed the controller board/prototype of a funky spin-art game-type-thing they’re making for the next First Night Austin.

All kinds of Neat Stuff[tm] .. we’ll have to go back next month. (I heard they had a homemade Tesla coil last month!) I managed to catch part of the evening with the voice recorder on my iAudio. I’ll try to clean it up and stick it online sometime in the next few days.

[tags] austin, austintx, geek, dorkbot, dorkbotaustin, nerd, robots, robotics[/tags]