Saturday, June 8, 2013

SmartThings to ThingSpeak Python Script

So, I have been meaning to do this for a really long time. In fact, I purchased all the XBee radios, temperature sensors, and various breakout boards to be able to do this project and have yet to get around to it!
To make things a little easier, back in August, I backed a project on Kickstarter that would give me a base for measuring temperature throughout the house. It was the SmartThings project.
It's a great home automation setup and although I'm basically using only motion sensors and temperatures sensors for most things, it still got the basic network set up in the house. Their app for iOS works really well and I'm beta testing their Android app, which works well for a beta.
The only gripe is that I can't really see the history of the data, just the real-time information, which is good at a glance, but I want to be able to log and see what's going on. Their developer website allows me to see that information but it's just a bunch of numbers. Not only that, I have to log in each time, go to each device, and then do a few more clicks to see what I want.
I finally decided I had had enough and jumped in and learned how to write a script in Python that would allow me to grab that information. Not only could I grab it, I could also post it to a website that will track it all for me at ThingSpeak!
I'm not sure the best way to post the file so I made my first git repository! It's probably way overkill but I didn't want to put something in my DropBox, make it public, and then post it up.
Here's the link.
I also made a video showing a little bit of the information. The YouTube video is here.

Enjoy and let me know what you think for those 1 or 2 people that may actually read this!