Device Model and Instance Schemas

  • Device models are defined with a unique ID, manufacturer details, device type, and supported traits, enabling the Google Assistant to understand and interact with the device.

  • Device instances represent individual devices, linking to a specific model with a unique ID, an optional nickname, and client type (SDK service or library).

  • Device model and instance IDs can contain letters, numbers, and specific symbols, ensuring proper formatting for identification within the Google ecosystem.

  • A device model's traits field determines its functionalities and capabilities, allowing developers to define its behavior and interaction with the Google Assistant.

  • Device instances are registered using their unique ID and associated with a pre-registered device model, enabling them to be recognized and controlled by the Google Assistant.

Device model

The device model is defined by the fields in this section.

Device model fields can only contain letters, numbers, and the following symbols: period (.), hyphen (-), underscore (_), space ( ) and plus (+). The first character of a field must be a letter or number.

Example
{
  "project_id": "my-devices-project",
  "device_model_id": "my-devices-project-prototype-light-v1",
  "manifest": {
    "manufacturer": "Assistant SDK developer",
    "product_name": "Assistant SDK light",
    "device_description": "Assistant SDK light device"
  },
  "device_type": "action.devices.types.LIGHT",
  "traits": ["action.devices.traits.OnOff"]
}
Schema
{
  "project_id": string,
  "device_model_id": string,
  "manifest": {
    "manufacturer": string,
    "product_name": string,
    "device_description": string
  },
  "device_type": string,
  "traits": [ string ]
}
  • project_id: (String) Required. Google Cloud Platform project ID of the Actions Console project to associate with this device model. A project can contain multiple device models.
  • device_model_id: (String) Required. Globally-unique identifier for this device model; use the project_id as a prefix to help avoid collisions over the range of all projects. Used in metrics and during device registration.
  • manifest: (object(Manifest)) Required. Metadata that describes the device model and manufacturer. This may be shown in the (upcoming) SDK console, metrics dashboards, and other related visual interfaces.
    • manifest.manufacturer: (String) Required. Name of the device manufacturer.
    • manifest.product_name: (String) Required. Consumer-facing product name for this device model.
    • manifest.device_description: (String) Optional. Description of this device model.
  • device_type: (String) Required. The type of device hardware. Select from the following:
    • action.devices.types.CAMERA
    • action.devices.types.DISHWASHER
    • action.devices.types.DRYER
    • action.devices.types.LIGHT
    • action.devices.types.OUTLET
    • action.devices.types.PHONE
    • action.devices.types.REFRIGERATOR
    • action.devices.types.SCENE
    • action.devices.types.SOUNDBAR
    • action.devices.types.SPEAKER
    • action.devices.types.SWITCH
    • action.devices.types.THERMOSTAT
    • action.devices.types.TV
    • action.devices.types.VACUUM
    • action.devices.types.WASHER
  • traits: (Array<String>) Optional. List of traits the device supports. Traits include the commands, attributes, and states for the device. You do not need to define an Action package to use built-in traits.

Device instance

The device instance is defined by the fields in this section.

Device instance fields must start with a letter or number. The device ID can only contain letters, numbers, and the following symbols: period (.), hyphen (-), underscore (_), and plus (+). The device nickname can only contain numbers, letters, and the space ( ) symbol.

Example
  {
    "id": "my_led_1",
    "model_id": "my-devices-project-prototype-light-v1",
    "nickname": "My Assistant Light",
    "client_type": "SDK_LIBRARY"
  }
Schema
  {
    "id": string,
    "model_id": string,
    "nickname": string,
    "client_type": string
  }
  • id: (String) Required. Identifier for the test device. Must be unique within all of the devices registered under the same Google Developer project.
  • model_id: (String) Required. Identifier of the device model; must be the same as the device_model_id associated with this test device. The device model must have been registered previously.
  • nickname: (String) Optional. Nickname for the device. This name will be used to refer to the device in visual interfaces like the Assistant settings.
  • client_type: (String) Required. The type of client device. Must be either of the following: SDK_SERVICE or SDK_LIBRARY.