Device Model and Instance Schemas

Device model
Device instance

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. Current types include:

    For more information, see Device Types.

  • 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 Actions on Google 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",
    "clientType": "SDK_LIBRARY"
  }
Schema
  {
    "id": string,
    "model_id": string,
    "nickname": string,
    "clientType": 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.
  • clientType: (String) Required. The type of client device. Must be either of the following: SDK_SERVICE or SDK_LIBRARY.