Hacking

Making Nice Graphs from Nest Temperature Data

We got a Nest thermostat and I spent the better part of a couple days working on logging and displaying the data. I used the Nest API for thermostat information, Weather Underground API for weather information, MongoDB for storage, and D3 for visualization. There’s also a little PHP glue in there which I plan on replacing with something else (probably node.js).

Nest Temperature Log
Nest Temperature Log

The system is currently in cooling mode. The green line is inside temperature, the orange line is outside temperature, the pale green is the target temperature, and the green shaded areas represent times when the system was cooling.

Every 15 minutes the script hits both Weather Underground and Nest. Right now I just throw the whole response tree into Mongo so I can decide later what I want to use.

This is the first time I’ve used both D3 and Mongo so the code isn’t very clean or pretty. I’ll put it on github once I’ve had a chance to organize it a bit better.  I’m still struggling with formatting the time labels the way I want.

The weather icons are from Weather Underground and only appear when the weather conditions change. However while the URLs for ‘partly sunny’ and ‘partly cloudy’ are different the icons are the same so there are still some repeats.

Further improvements I’d like to add include a legend,humidity data, the ability to zoom/pan through the data, and the ability to show/hide some of the lines.

 

9 thoughts on “Making Nice Graphs from Nest Temperature Data”

    1. I am indeed using the official API, and I have been super delinquent about getting the code up on github because it’s sloppy and I need to strip out some identifying stuff. I’ll try to get to that this weekend, but in the interest of full disclosure I have said that before so feel free to give me a nudge in a couple weeks if I drop the ball again.

      1. I’m very interested in the source code too! Why invent the wheel twice, right?

        Although I’m not familiar with MongoDB.. Would it be hard to use MySQL?

Leave a Reply

Your email address will not be published. Required fields are marked *