nest.class.php
public function setAway($away_mode, $serial_number = NULL, $eco_when_away = TRUE) {
        $serial_number = $this->getDefaultSerial($serial_number);
        $data = json_encode(array('away' => $away_mode, 'away_timestamp' => time(), 'away_setter' => 0));
        $structure_id = $this->getDeviceInfo($serial_number)->location;
        if ($away_mode == AWAY_MODE_ON && $eco_when_away) {
            $this->setEcoMode(ECO_MODE_MANUAL, $serial_number);
        } else {
            $this->setEcoMode(ECO_MODE_SCHEDULE, $serial_number);
        }
        return $this->doPOST("/v2/put/structure." . $structure_id, $data);
    }
public function setAway($away_mode, $serial_number = NULL, $eco_when_away = TRUE) {
        $serial_number = $this->getDefaultSerial($serial_number);
        $data = json_encode(array('away' => $away_mode, 'away_timestamp' => time(), 'away_setter' => 0));
        $structure_id = $this->getDeviceInfo($serial_number)->location;
        if ($away_mode == AWAY_MODE_ON && $eco_when_away) {
            $this->setEcoMode(ECO_MODE_MANUAL, $serial_number);
        } else {
            $this->setEcoMode(ECO_MODE_SCHEDULE, $serial_number);
        }
        return $this->doPOST("/v2/put/structure." . $structure_id, $data);
    }
public function setAway ( $ away_mode , $ serial_number = NULL , $ eco_when_away = TRUE ) { $ serial_number = $ this -> getDefaultSerial ( $ serial_number ) ; $ data = json_encode ( array ( 'away' => $ away_mode , 'away_timestamp' => time ( ) , 'away_setter' => 0 ) ) ; $ structure_id = $ this -> getDeviceInfo ( $ serial_number ) -> location ; if ( $ away_mode == AWAY_MODE_ON && $ eco_when_away ) { $ this -> setEcoMode ( ECO_MODE_MANUAL , $ serial_number ) ; } else { $ this -> setEcoMode ( ECO_MODE_SCHEDULE , $ serial_number ) ; } return $ this -> doPOST ( "/v2/put/structure." . $ structure_id , $ data ) ; }
Change the location (structure) to away or present. Can also set the specified thermostat to use ECO temperatures, when enabling Away mode.

@param string $away_mode     AWAY_MODE_ON or AWAY_MODE_OFF
@param string $serial_number The thermostat serial number. Defaults to the first device of the account.
@param bool   $eco_when_away Specify if you want to use Eco temperatures or not, when using AWAY_MODE_ON. Default to TRUE.

@return stdClass|bool The object returned by the API call, or FALSE on error.
Change the location ( structure ) to away or present . Can also set the specified thermostat to use ECO temperatures when enabling Away mode .