<br />

# ThermostatEco Schema

[Nest Thermostat](https://developers.google.com/nest/device-access/api/thermostat)

`sdm.devices.traits.ThermostatEco`

This trait belongs to device types of THERMOSTAT that support ECO modes.

<br />

## Fields


| Field | Description | Data Type |
|---|---|---|
| `availableModes` | List of supported Eco modes. | `array(string)` Value: \["MANUAL_ECO", "OFF"\] |
| `mode` | The current Eco mode of the thermostat. | `string` Values: "MANUAL_ECO", "OFF" |
| `heatCelsius` | Lowest temperature in Celsius at which the thermostat begins heating in Eco mode. | `number` Example: 20.0 |
| `coolCelsius` | Highest temperature in Celsius at which the thermostat begins cooling in Eco mode. | `number` Example: 22.0 |

<br />

<br />

#### Sample GET request and response

### Request

```
GET /enterprises/project-id/devices/device-id
```

### Response

    {
      "name" : "enterprises/project-id/devices/device-id",
      "traits" : {
        "sdm.devices.traits.ThermostatEco" : {
          "availableModes" : ["MANUAL_ECO", "OFF"],
          "mode" : "MANUAL_ECO",
          "heatCelsius" : 20.0,
          "coolCelsius" : 22.0
        }
      }
    }

<br />

## Commands

<br />

### SetMode

Change the thermostat Eco mode.

<br />

To change the thermostat mode to HEAT, COOL, or HEATCOOL, use the [SetMode](https://developers.google.com/nest/device-access/traits/device/thermostat-mode#setmode) command of the ThermostatMode trait.

<br />

<br />

This command impacts other traits, based on the current status of, or changes to, the Eco mode:

- If Eco mode is OFF, the thermostat mode will default to the last standard mode (HEAT, COOL, HEATCOOL, or OFF) that was active.
- If Eco mode is MANUAL_ECO:
  - Commands for the [ThermostatTemperatureSetpoint](https://developers.google.com/nest/device-access/traits/device/thermostat-temperature-setpoint) trait are rejected.
  - Temperature setpoints are not returned by the [ThermostatTemperatureSetpoint](https://developers.google.com/nest/device-access/traits/device/thermostat-temperature-setpoint) trait.

<br />

> [!NOTE]
> Some thermostat models do not support changing the Eco mode when the thermostat mode is OFF, according to the [ThermostatMode](https://developers.google.com/nest/device-access/traits/device/thermostat-mode) trait. The thermostat mode must be changed to HEAT, COOL, or HEATCOOL prior to changing the Eco mode.

#### SetMode request and response

### Request

    POST /enterprises/project-id/devices/device-id:executeCommand
    {
      "command" : "sdm.devices.commands.ThermostatEco.SetMode",
      "params" : {
        "mode" : "MANUAL_ECO"
      }
    }

### Response

```
{}
```

#### SetMode request fields

| Field | Description | Data Type |
|---|---|---|
| `mode` | The Eco mode to change the thermostat to. | `string` Values: "MANUAL_ECO", "OFF" |

<br />


## Errors

The following error code(s) may be returned in relation to this trait:

| Error Message | RPC | Troubleshooting |
|---|---|---|
| Command not allowed in current thermostat mode. | `FAILED_PRECONDITION` | Some thermostat models do not support changing the Eco mode when the thermostat mode is OFF, according to the [ThermostatMode](https://developers.google.com/nest/device-access/traits/device/thermostat-mode) trait. The thermostat mode must be changed to HEAT, COOL, or HEATCOOL prior to changing the Eco mode. |
| Command not allowed when thermostat in MANUAL_ECO mode. | `FAILED_PRECONDITION` | The temperature setpoint cannot be set when the thermostat is in manual Eco mode. |

See the [API Error Code Reference](https://developers.google.com/nest/device-access/reference/errors/api) for
the full list of API error codes.

<br />