Here is a simple way to connect to your NEST thermostats. I got a few of those last week end.
They are quite easy to interface in Mathematica.
In a follow up post, I will try to provide a full dashboard.
Enjoy,
First, just set the value to userEmail and password that you used for the site www.nest.com
Luc
loginData = ImportString[ URLFetch["https://home.nest.com/user/login/?username="<>userEmail<>"&password="<>password],"JSON" ];
user= "user"/.loginData;
userId = "userid"/.loginData;
accessToken = ("access_token"/.loginData);
authorization = ("Basic "<>accessToken);
transportURL = Last[ StringSplit[("transport_url"/.("urls"/.loginData)),"//"]];
dataSet = ImportString[URLFetch["https://"<>transportURL<>"/v2/mobile/"<>user,"Headers"->{
"Host"->transportURL,
"User-Agent"->"Nest/1.1.0.10 CFNetwork/548.0.4",
"Authorization"->authorization,
"X-nl-protocol-version"->"1",
"X-nl-user-id"->userId,
"Accept-Language"->"en-us",
"Connection"->"keep-alive",
"Accept"->"*/*"
}],"JSON" ];
deviceIdList=First /@ ("device"/.dataSet);
DisplayNest[ID_,dataSet_]:=Module[{name,temp,humidity, targetTemp,sharedData,time,deviceData,heating},
deviceData=ID/.("device"/.dataSet);
sharedData=ID/.("shared"/.dataSet);
{name,temp, targetTemp, time,heating}={"name","current_temperature","target_temperature","$timestamp","hvac_ac_state"}/.sharedData;
Column[{AngularGauge[{temp,targetTemp},{9,32},GaugeFaceStyle->Black,GaugeFrameStyle->Black,GaugeFrameSize->.6,GaugeLabels->Placed[Style[Round[targetTemp],White,40],Center],GaugeMarkers->"Sector",GaugeStyle->White,
ScaleDivisions->None,ScaleOrigin->{\[Pi]+\[Pi]/4,-\[Pi]/4}
],Style[name,20]},Alignment->Center]
];
DisplayNest[#,dataSet]& /@ deviceIdList