<br />

A **trait** in the SDM API comprises **fields** , **commands** , and **events**.

> [!NOTE]
> All calls to the SDM API should use the following endpoint:  
> `https://smartdevicemanagement.googleapis.com/v1`

## Fields

Fields are values with common data types, such as a number or a string. For example, a field
might contain a the current mode or the ambient humidity of a Google Nest Thermostat.

Traits and fields can be viewed with a `GET` call to the desired API endpoint:

```
GET /enterprises/project-id/devices/device-id
{
  "name" : "enterprises/project-id/devices/device-id",
  "type" : "sdm.devices.types.device-type",
  "traits" : { ... },
  "parentRelations" : [
    {
      "parent" : "enterprises/project-id/structures/structure-id/rooms/room-id",
      "displayName" : "Lobby"
    }
  ]
}
```

### Device types

The `sdm.devices.types.device-type` returned by the SDM API should not be used
to deduce or infer functionality of the actual device it is assigned to. There is no guarantee
that a device type will remain stable for a specific device as more features are added to the SDM
API. Instead, use the returned traits for the device.

### parentRelations

The `parentRelations` object represents the parent resource of the current resource, either a structure or room. Display name corresponds to the `customName` field of the [Info trait](https://developers.google.com/nest/device-access/traits/structure/info) for devices with a structure parent or the [RoomInfo trait](https://developers.google.com/nest/device-access/traits/structure/room-info) for devices with a room parent.

## Commands

Commands are requests associated with a trait. For example, changing the current mode or
temperature setpoint on a Google Nest Thermostat.

A command is sent by an `executeCommand` API call:

```
POST /enterprises/project-id/devices/device-id:executeCommand
{
  "command" : "command-name",
  "params" : {
    "field" : "value"
  }
}
```

Most responses to a command are a simple success or failure. See the individual trait guides for
specific command usage examples.

## Events

Events are asynchronous and managed by Google Cloud Pub/Sub in a single topic per
Project ID.

Events are sent by default for any change in the value of a trait field. They can also be sent in
response to specific device actions or changes in resource assignments. See
[Events](https://developers.google.com/nest/device-access/api/events)
for more information.

## Trait categories


### Structure

Traits [Info](https://developers.google.com/nest/device-access/traits/structure/info) `sdm.structures.traits.Info` This trait belongs to any structure for structure-related information. [RoomInfo](https://developers.google.com/nest/device-access/traits/structure/room-info) `sdm.structures.traits.RoomInfo` This trait belongs to any room for room-related information.

### Device

Traits [Connectivity](https://developers.google.com/nest/device-access/traits/device/connectivity) `sdm.devices.traits.Connectivity` This trait belongs to any device that has connectivity information. [Fan](https://developers.google.com/nest/device-access/traits/device/fan) `sdm.devices.traits.Fan` This trait belongs to any device that has the system ability to control the fan. [Humidity](https://developers.google.com/nest/device-access/traits/device/humidity) `sdm.devices.traits.Humidity` This trait belongs to any device that has a sensor to measure humidity. [Info](https://developers.google.com/nest/device-access/traits/device/info) `sdm.devices.traits.Info` This trait belongs to any device for device-related information. [Settings](https://developers.google.com/nest/device-access/traits/device/settings) `sdm.devices.traits.Settings` This trait belongs to any device for device-related settings information. [Temperature](https://developers.google.com/nest/device-access/traits/device/temperature) `sdm.devices.traits.Temperature` This trait belongs to any device that has a sensor to measure temperature.

### Thermostat

Traits [ThermostatEco](https://developers.google.com/nest/device-access/traits/device/thermostat-eco) `sdm.devices.traits.ThermostatEco` This trait belongs to device types of THERMOSTAT that support ECO modes. [ThermostatHvac](https://developers.google.com/nest/device-access/traits/device/thermostat-hvac) `sdm.devices.traits.ThermostatHvac` This trait belongs to device types of THERMOSTAT that can report HVAC details. [ThermostatMode](https://developers.google.com/nest/device-access/traits/device/thermostat-mode) `sdm.devices.traits.ThermostatMode` This trait belongs to device types of THERMOSTAT that support different thermostat modes. [ThermostatTemperatureSetpoint](https://developers.google.com/nest/device-access/traits/device/thermostat-temperature-setpoint) `sdm.devices.traits.ThermostatTemperatureSetpoint` This trait belongs to device types of THERMOSTAT that support setting target temperature and temperature range.

### Camera

Traits [CameraClipPreview](https://developers.google.com/nest/device-access/traits/device/camera-clip-preview) `sdm.devices.traits.CameraClipPreview` This trait belongs to any device that supports the download of a clip preview. [CameraEventImage](https://developers.google.com/nest/device-access/traits/device/camera-event-image) `sdm.devices.traits.CameraEventImage` This trait belongs to any device that supports generation of images from events. [CameraImage](https://developers.google.com/nest/device-access/traits/device/camera-image) `sdm.devices.traits.CameraImage` This trait belongs to any device that supports taking images. [CameraLiveStream](https://developers.google.com/nest/device-access/traits/device/camera-live-stream) `sdm.devices.traits.CameraLiveStream` This trait belongs to any device that supports live streaming. [CameraMotion](https://developers.google.com/nest/device-access/traits/device/camera-motion) `sdm.devices.traits.CameraMotion` This trait belongs to any device that supports motion detection events. [CameraPerson](https://developers.google.com/nest/device-access/traits/device/camera-person) `sdm.devices.traits.CameraPerson` This trait belongs to any device that supports person detection events. [CameraSound](https://developers.google.com/nest/device-access/traits/device/camera-sound) `sdm.devices.traits.CameraSound` This trait belongs to any device that supports sound detection events.

### Doorbell

Traits [DoorbellChime](https://developers.google.com/nest/device-access/traits/device/doorbell-chime) `sdm.devices.traits.DoorbellChime` This trait belongs to any device that supports a doorbell chime and related press events.

<br />