2

I'm considering the purchase of a Nest and have some thoughts in relation to the API capabilities. I have a intruder/security alarm with PIRs around the house. What I intend to do is to develop an interface between this system and Nest via the API.

My reasoning for this is to use the motion detection from the alarms PIR sensors to 'inform' Nest that someone is still on the premises (due to their movement) and hence prevent Nest switching to its Auto-Away state when the house is inhabited.

Also when the house is armed in away-mode I would want Nest to enter Auto-Away state immediately.

So what I'd like to know is whether it's possible to do the following via the API:

1) Keep/switch Nest in/to the Home 2) Place Nest in the Auto-Away state

Cheers Ian

Heathy65
  • 21
  • 1

2 Answers2

1

You can switch Nest to Away, or to Home, but you cannot control Auto-Away. In my experience Auto-Away is probably not what you want anyway, as Nest seems to drop out of Auto-Away mode every time it crosses a scheduled heating/cooling etc event.

This is exactly how I use the API - to set the Nest to Away whenever the alarm is set, and to Home whenever the alarm is unset.

thesimm
  • 774
  • 3
  • 12
  • I would add that Auto-Away is more than a simple switch, see the Nest article on it here: http://support.nest.com/article/What-is-Auto-Away – David W. Keith Sep 05 '14 at 02:54
0

I came across this with the same question about using my security alarm motion detector (which I already have a monitor for) to let the Nest know someone is home. It seems Nest partners with other companies which can feed Nest activity data but there is nothing about this in the API.

I also have a script which sets Nest to away mode as soon as the alarm is armed, it is easily doable with the published API.

Here is my REST JavaScript function to set Nest to home/away mode, excuse my poor JavaScript (I'm a noob).

// Turn on/off away mode based on true/false parameter
function setAway(doAway) {
  var url = "https://developer-api.nest.com/structures/"+myNest.struct+"?auth="+myNest.auth;
  if (doAway) {
    var newState = "away";
  } else {
    var newState = "home";
  }
  var nowAway = isAway();

  var options = {
    method: "put",
    contentType: "application/json",
    accept: "application/json",
    payload: '{"away":"'+newState+'"}'
  };

  // only update if state changed
  if (doAway != nowAway) {
    var response = UrlFetchApp.fetch(url, options);
    var data = JSON.parse(response);
  }
}