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.

 

Filed under: Hacking

9 thoughts on “Making Nice Graphs from Nest Temperature Data

  1. Looks great. Are you using the official nest API? Do you have the code available on github perchance?

    1. Kelly says:

      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. Awesome.. I look forward to checking it out!

      2. Osiris says:

        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?

      3. danimal4326 says:

        Ping!! Hi, just checking in if you made any progress??

  2. scoop says:

    Another ping! Would love to create my own graphs!

  3. PaulH says:

    Any updates on a github release?

    1. danimal4326 says:

      Baby = I don’t think we’re going to see it for a while..

      Kelly, hope you’re getting some sleep…

  4. Kelly says:

    I haven’t had any time to put into this, but I did manage to sanitize the personal data out of my code and barf it onto github. Use at your own risk!

    https://github.com/kellbot/nestgraph

Leave a Reply

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