Harvesting Nest Thermostat Data For Fun And Profit

This is an old post!

This post is over 2 years old. Solutions referenced in this article may no longer be valid. Please consider this when utilizing any information referenced here.

Okay, no profit in this, but it certainly is fun!

I have two Nest thermostats in my house and, after some teething pains (yay the life of an early adopter) they have been pretty solid. But they’re also black boxes that I know little about. I know they’re collecting mountains of data and sending it back to the Google mothership. Wouldn’t it be nice to get at some of that data and build my own reports?

The more practical reason, however, is that I have a house that is heated and cooled by electric heat pumps, with heat strips as an auxiliary backup. Those things pull 50 amps when they are in use. I might as well light dollar bills on fire. So anything that I can do to reduce my use of aux heating I try to do.

Unfortunately, Nest’s reports are delayed by a day so I can’t make realtime adjustments to my usage. Furthermore, Nest’s reports don’t give me any data more granular than * (heat|cool) was used (in 15 minute increments) today” and look at a timeline and kinda see where it was used, but that’s it.

This may be fine for a normal person. But I’m an engineer, not a normal person. :) I want data!

So when I came across this unofficial API, I instantly thought of how neat it would be to use it to grab that data and do something with it. Rather than write my own analytics on top of it, I decided instead to just stuff the data into a time-series database (InfluxDB), off which I could use any platform I wanted to build reports or alerting.

So I created Nest Watch, which does exactly that.

In addition to reporting the outside weather conditions, which Nest obtains from the Weather Underground, it also pulls the following datapoints:

  • auto_cool
  • auto_heat
  • temperature
  • humidity
  • ac
  • heat
  • alt_heat
  • fan
  • auto_away
  • manual_away
  • structure_away
  • leaf
  • battery_level
  • active_stages.heat.stage1
  • active_stages.heat.stage2
  • active_stages.heat.stage3
  • active_stages.heat.alt
  • active_stages.heat.alt_stage2
  • active_stages.heat.aux
  • active_stages.heat.emergency
  • active_stages.cool.stage1
  • active_stages.cool.stage2
  • active_stages.cool.stage3
  • network.online

With this data going into InfluxDB, you can build Grafana dashboards using this data. Here’s a sample dashboard I build using some of my data:

You could also use a tool like Kapacitor or even Nagios to perform alerts based on the data.

Last year I had an issue with my upstairs heat pump that caused it to safety shut off. When this happens it shuts off power to the thermostats. We didn’t find out about the safety shut off for about 2 days until the battery finally wore down and the Nest shut off. Meanwhile, it was 95 degrees upstairs. I didn’t find out about any of this until my wife called me while I was traveling in California and told me it was 95 in my daughter’s room and the thermostat was broken.

Wouldn’t it have been nice to have some alerting about that, so I would have known sooner that there was an issue?

This is a wholly unofficial project. It might stop working at any time. Do not rely on this for life-critical stuff. I am not responsible for what you do with it.

And if anyone at Nest is reading this, it would be really cool if you had an open API for your users to build their own solutions. I know about the “official API”, but it is clearly business oriented and certainly not maker-friendly given all the hoops you have to jump through just to get access to it. I just want to draw neat graphs and know when something is broken, not change the world. Please let us have access to our data.

Comments (0)

Interested in why you can't leave comments on my blog? Read the article about why comments are uniquely terrible and need to die. If you are still interested in commenting on this article, feel free to reach out to me directly and/or share it on social media.

Contact Me
Share It
Release Announcements
As you can tell from the last few posts, I’ve been having a lot of fun with collectd and instrumenting my systems. But I had one glaring hole until recently: my Ubiquti Unifi AP access points. Well no longer!
Read More
Release Announcements
Launched two new pieces of open source code in the last couple of months. PlayerControls PlayerControls is a macOS Cocoa framework that creates a View containing playback controls for media like videos or sounds. It is written in pure Swift 4 and has no dependencies. SearchParser SearchParser is a parser that converts a freeform query into an intermediate object, that can then be converted to query many backends (SQL, ElasticSearch, etc). It includes translators for SQL (using PDO) and Laravel Eloquent ORM. It supports a faceted language search as commonly found on many sites across the web. It is written in modern PHP. Both are licensed under the MIT license. Go check them out on Github.
Read More
Release Announcements
petfeedd users, I am proud to announce the beta release of petfeedd 1.0.1. This release has no major changes in it and is solely about addressing security issues in many of the underlying libraries used by petfeedd. To install it or upgrade from previous versions, you can simply run: docker pull peckrob/petfeedd:latest
Read More