ThermostatMode Schema

Nest Thermostat 

sdm.devices.traits.ThermostatMode

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

Fields

Field Description Data Type
availableModes List of supported thermostat modes. array(string)
Value: ["HEAT", "COOL", "HEATCOOL", "OFF"]
mode The current thermostat mode. string
Values: "HEAT", "COOL", "HEATCOOL", "OFF"

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.ThermostatMode" : {
      "availableModes" : ["HEAT", "COOL", "HEATCOOL", "OFF"],
      "mode" : "COOL"
    }
  }
}

Commands

SetMode

Change the thermostat mode.

SetMode request and response

Request

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

Response

{}

SetMode request fields

Field Description Data Type
mode The mode to change the thermostat to. string
Values: "HEAT", "COOL", "HEATCOOL", "OFF"

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 trait. The thermostat mode must be changed to HEAT, COOL, or HEATCOOL prior to changing the Eco mode.

See the API Error Code Reference for the full list of API error codes.