Giản đồ mẫu và bản sao thiết bị
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Mẫu thiết bị
Mẫu thiết bị được xác định bởi các trường trong phần này.
Trường mẫu thiết bị chỉ có thể chứa chữ cái, số và các thông tin sau
ký hiệu: dấu chấm (.), dấu gạch nối (-), dấu gạch dưới (_), dấu cách ( ) và dấu cộng
(+). Ký tự đầu tiên của một trường phải là một chữ cái hoặc số.
{
"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"]
}
{
"project_id": string,
"device_model_id": string,
"manifest": {
"manufacturer": string,
"product_name": string,
"device_description": string
},
"device_type": string,
"traits": [ string ]
}
project_id
: (Chuỗi) Bắt buộc. Mã dự án trên Google Cloud Platform
của dự án Bảng điều khiển Actions để liên kết với mẫu thiết bị này.
Một dự án có thể chứa nhiều mẫu thiết bị.
device_model_id
: (Chuỗi) Bắt buộc. Giá trị nhận dạng duy nhất trên toàn cầu
cho mẫu thiết bị này; sử dụng project_id
làm
một tiền tố để giúp tránh xung đột trên phạm vi của tất cả dự án. Đã dùng
về các chỉ số và trong quá trình đăng ký thiết bị.
manifest
: (đối tượng(Tệp kê khai)) Bắt buộc. Siêu dữ liệu mô tả
mẫu thiết bị và nhà sản xuất. Nội dung này có thể được nêu trong SDK (sắp ra mắt)
bảng điều khiển, trang tổng quan chỉ số và các giao diện trực quan khác có liên quan.
manifest.manufacturer
: (Chuỗi) Bắt buộc. Tên thiết bị
của nhà sản xuất.
manifest.product_name
: (Chuỗi) Bắt buộc. Dành cho người tiêu dùng
tên sản phẩm cho mẫu thiết bị này.
manifest.device_description
: (Chuỗi) Không bắt buộc. Nội dung mô tả
mẫu thiết bị này.
device_type
: (Chuỗi) Bắt buộc. Loại phần cứng thiết bị. Chọn
từ các nguồn sau:
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>) Không bắt buộc. Danh sách trait của thiết bị
Google Cloud. Đặc điểm bao gồm các lệnh, thuộc tính và trạng thái của
thiết bị. Bạn không cần xác định Gói hành động
để sử dụng
tính năng tích hợp sẵn.
Phiên bản thiết bị
Thực thể thiết bị được xác định bằng các trường trong phần này.
Trường thực thể thiết bị phải bắt đầu bằng một chữ cái hoặc số. Mã thiết bị
chỉ có thể chứa chữ cái, số và các ký hiệu sau: dấu chấm (.),
dấu gạch nối (-), dấu gạch dưới (_) và dấu cộng (+). Biệt hiệu của thiết bị chỉ có thể
chứa số, chữ cái và ký hiệu dấu cách ( ).
{
"id": "my_led_1",
"model_id": "my-devices-project-prototype-light-v1",
"nickname": "My Assistant Light",
"client_type": "SDK_LIBRARY"
}
{
"id": string,
"model_id": string,
"nickname": string,
"client_type": string
}
id
: (Chuỗi) Bắt buộc. Giá trị nhận dạng của thiết bị thử nghiệm. Phải
duy nhất trong tất cả các thiết bị được đăng ký trong cùng một Google
Dự án của nhà phát triển.
model_id
: (Chuỗi) Bắt buộc. Mã nhận dạng của mẫu thiết bị; phải
giống với device_model_id
liên kết với thiết bị thử nghiệm này. Mẫu thiết bị phải được đăng ký
trước đây.
nickname
: (Chuỗi) Không bắt buộc. Biệt hiệu cho thiết bị. Tên này
sẽ được dùng để tham chiếu đến thiết bị trong giao diện trực quan như
Cài đặt Trợ lý.
client_type
: (Chuỗi) Bắt buộc. Loại thiết bị khách. Phải
SDK_SERVICE
hoặc SDK_LIBRARY
.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[[["\u003cp\u003eDevice 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.\u003c/p\u003e\n"],["\u003cp\u003eDevice instances represent individual devices, linking to a specific model with a unique ID, an optional nickname, and client type (SDK service or library).\u003c/p\u003e\n"],["\u003cp\u003eDevice model and instance IDs can contain letters, numbers, and specific symbols, ensuring proper formatting for identification within the Google ecosystem.\u003c/p\u003e\n"],["\u003cp\u003eA device model's \u003ccode\u003etraits\u003c/code\u003e field determines its functionalities and capabilities, allowing developers to define its behavior and interaction with the Google Assistant.\u003c/p\u003e\n"],["\u003cp\u003eDevice 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.\u003c/p\u003e\n"]]],["Device models are defined by fields such as `project_id`, `device_model_id`, `manifest`, `device_type`, and `traits`. Fields can contain letters, numbers, and specific symbols. `Manifest` describes the device's manufacturer, product name, and description. Device instances have fields like `id`, `model_id`, `nickname`, and `client_type`, which specify unique identifiers, associated device models, nicknames, and client types. The device `id` and `model_id` are required.\n"],null,["# Device Model and Instance Schemas\n\nDevice model\n------------\n\nThe device model is defined by the fields in this section.\n\n\nDevice model fields can only contain letters, numbers, and the following\nsymbols: period (.), hyphen (-), underscore (_), space ( ) and plus\n(+). The first character of a field must be a letter or number.\nExample \n\n```carbon\n{\n \"project_id\": \"my-devices-project\",\n \"device_model_id\": \"my-devices-project-prototype-light-v1\",\n \"manifest\": {\n \"manufacturer\": \"Assistant SDK developer\",\n \"product_name\": \"Assistant SDK light\",\n \"device_description\": \"Assistant SDK light device\"\n },\n \"device_type\": \"action.devices.types.LIGHT\",\n \"traits\": [\"action.devices.traits.OnOff\"]\n}\n```\nSchema \n\n```carbon\n{\n \"project_id\": string,\n \"device_model_id\": string,\n \"manifest\": {\n \"manufacturer\": string,\n \"product_name\": string,\n \"device_description\": string\n },\n \"device_type\": string,\n \"traits\": [ string ]\n}\n```\n\n- **`project_id`:** (String) Required. Google Cloud Platform project [ID](https://support.google.com/cloud/answer/6158840) of the Actions Console project to associate with this device model. A project can contain multiple device models.\n- **`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.\n- **`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.\n - **`manifest.manufacturer`:** (String) Required. Name of the device manufacturer.\n - **`manifest.product_name`:** (String) Required. Consumer-facing product name for this device model.\n - **`manifest.device_description`:** (String) Optional. Description of this device model.\n- **`device_type`:** (String) Required. The type of device hardware. Select from the following:\n - `action.devices.types.CAMERA`\n - `action.devices.types.DISHWASHER`\n - `action.devices.types.DRYER`\n - `action.devices.types.LIGHT`\n - `action.devices.types.OUTLET`\n - `action.devices.types.PHONE`\n - `action.devices.types.REFRIGERATOR`\n - `action.devices.types.SCENE`\n - `action.devices.types.SOUNDBAR`\n - `action.devices.types.SPEAKER`\n - `action.devices.types.SWITCH`\n - `action.devices.types.THERMOSTAT`\n - `action.devices.types.TV`\n - `action.devices.types.VACUUM`\n - `action.devices.types.WASHER`\n- **`traits`:** (Array\\\u003cString\\\u003e) 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](/assistant/conversational/action-package/reference/rest/Shared.Types/ActionPackage) to use [built-in traits](/assistant/sdk/reference/traits).\n\nDevice instance\n---------------\n\nThe device instance is defined by the fields in this section.\n\n\nDevice instance fields must start with a letter or number. The device ID\ncan only contain letters, numbers, and the following symbols: period (.),\nhyphen (-), underscore (_), and plus (+). The device nickname can only\ncontain numbers, letters, and the space ( ) symbol.\nExample \n\n```carbon\n {\n \"id\": \"my_led_1\",\n \"model_id\": \"my-devices-project-prototype-light-v1\",\n \"nickname\": \"My Assistant Light\",\n \"client_type\": \"SDK_LIBRARY\"\n }\n```\nSchema \n\n```carbon\n {\n \"id\": string,\n \"model_id\": string,\n \"nickname\": string,\n \"client_type\": string\n }\n```\n\n- **`id`:** (String) Required. Identifier for the test device. Must be unique within all of the devices registered under the same Google Developer project.\n- **`model_id`:** (String) Required. Identifier of the device model; must be the same as the [`device_model_id`](#device_model_json) associated with this test device. The device model must have been registered previously.\n- **`nickname`:** (String) Optional. Nickname for the device. This name will be used to refer to the device in visual interfaces like the Assistant settings.\n- **`client_type`:** (String) Required. The type of client device. Must be either of the following: `SDK_SERVICE` or `SDK_LIBRARY`."]]