nest.class.php
public function setEcoMode($mode, $serial_number = NULL) {
        $serial_number = $this->getDefaultSerial($serial_number);
        $data = array();
        $data['mode'] = $mode;
        $data['touched_by'] = 4;
        $data['mode_update_timestamp'] = time();
        $data = json_encode(array('eco' => $data));
        return $this->doPOST("/v2/put/device." . $serial_number, $data);
    }
public function setEcoMode($mode, $serial_number = NULL) {
        $serial_number = $this->getDefaultSerial($serial_number);
        $data = array();
        $data['mode'] = $mode;
        $data['touched_by'] = 4;
        $data['mode_update_timestamp'] = time();
        $data = json_encode(array('eco' => $data));
        return $this->doPOST("/v2/put/device." . $serial_number, $data);
    }
public function setEcoMode ( $ mode , $ serial_number = NULL ) { $ serial_number = $ this -> getDefaultSerial ( $ serial_number ) ; $ data = array ( ) ; $ data [ 'mode' ] = $ mode ; $ data [ 'touched_by' ] = 4 ; $ data [ 'mode_update_timestamp' ] = time ( ) ; $ data = json_encode ( array ( 'eco' => $ data ) ) ; return $ this -> doPOST ( "/v2/put/device." . $ serial_number , $ data ) ; }
Set the thermostat to use ECO mode ($mode = ECO_MODE_MANUAL) or not ($mode = ECO_MODE_SCHEDULE).

@param string $mode          One of the ECO_MODE_* constants.
@param string $serial_number The thermostat serial number. Defaults to the first device of the account.

@return stdClass|bool The object returned by the API call, or FALSE on error.
Set the thermostat to use ECO mode ( $mode = ECO_MODE_MANUAL ) or not ( $mode = ECO_MODE_SCHEDULE ) .