This post was originally posted on Nest Thermostat and R – Creating a Shiny dashboard.
If you are an SAP Employee, please follow us on Jam.
At the d-shop we’re always looking forward to play with the latest technologies…a while the Nest Thermostat is not really “new”, we’re in the process of getting one.
For now, we are happy to be able to play a little bit with Nest Home Simulator available on the Google Chrome Store.
In this blog, we’re going to use the Nest Home Simulator, the Statistics Programming Language R and the Shiny package, which allows us to create awesome web interfaces to manage data. Also, we’re going to need the RJson package.
First step will be to create an account on the Nest Developer Program and the install the Nest Home Simulator.
Wen we log into the Simulator, we are going to be able to create a Thermostat to start playing around with the current and target temperatures…
The second important thing, is that when we are log into the Nest Developer Program we’re going to be able to create a client which will access our thermostat and also, we will going to able to generate a unique number to communicate with it.
We need to just copy and paste the URL from the Authorization URL and after accepting the conditions a number will be presented…we need this number for our R code…but keep in mind that once the connection is closed, we will need to generate a new number…
Now, we’re ready to add some code to the mix…when working with R, is always better to use RStudio…so copy and paste this code…and remember to replace the code variable with your own number…also you will need to replace the Client ID and Client Secret with the information from your Nest Developer Program Client code…
Target_Temperature=info$target_temperature_f,Times=timeframe,stringsAsFactors = F)
This code will get 10 readings until it refreshes itself to get 10 new ones. So we can update the Current and Target Temperature values in order to see the Dashboard changing…