SDM API คือ REST API ที่มีเมธอดต่างๆ สำหรับ
ดูลักษณะและเรียกใช้คำสั่งลักษณะเพื่อจัดการ
อุปกรณ์ Google Nest ใช้โทเค็นเพื่อการเข้าถึงที่ได้รับในระหว่าง
กระบวนการให้สิทธิ์กับการเรียก API แต่ละครั้ง
ลักษณะ
SDM API ใช้โมเดลตามลักษณะสำหรับข้อมูลและฟังก์ชันการทำงานของอุปกรณ์
ดูคำแนะนำสำหรับอุปกรณ์แต่ละเครื่องเพื่อดูว่าอุปกรณ์นั้นมีลักษณะใดบ้าง
GET การเรียกจะแสดงการตอบกลับเดียวที่มีฟิลด์และค่าปัจจุบันสำหรับลักษณะทั้งหมด
ที่พร้อมใช้งานสำหรับโครงสร้างหรืออุปกรณ์ที่ user ได้รับอนุญาต และออบเจ็กต์ `parentRelations' ซึ่งแสดงถึงทรัพยากรหลัก
ของทรัพยากรปัจจุบัน ไม่ว่าจะเป็นโครงสร้างหรือห้อง
หากต้องการแสดงโครงสร้าง ห้อง หรืออุปกรณ์ทั้งหมดที่ได้รับอนุญาตภายใต้โทเค็นการเข้าถึงเดียว ให้เรียกใช้ GET กับปลายทางทรัพยากรที่เหมาะสม
GET /enterprises/project-id/structures
GET /enterprises/project-id/structures/structure-id/rooms
GET /enterprises/project-id/devices
การผสานรวม Google Assistant
เมื่ออุปกรณ์ได้รับอนุญาตสำหรับ SDM แล้ว Google จะรับทราบอุปกรณ์ใน Home
Graph และจัดการสถานะของอุปกรณ์โดยตรง หากคุณมีการผสานรวม Google Assistant
เป็นส่วนหนึ่งของข้อเสนอเชิงพาณิชย์
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-07-29 UTC"],[[["\u003cp\u003eThe SDM API is a REST API that lets you manage Google Nest devices by viewing their traits and executing commands.\u003c/p\u003e\n"],["\u003cp\u003eAll API calls should be made to the endpoint \u003ccode\u003ehttps://smartdevicemanagement.googleapis.com/v1\u003c/code\u003e with the provided access token.\u003c/p\u003e\n"],["\u003cp\u003eThe API uses a trait-based model, and specific traits available for each device type can be found in the provided links to individual device guides.\u003c/p\u003e\n"],["\u003cp\u003eYou can execute commands, get device information, and list structures, rooms, or devices using the methods detailed in the API Reference.\u003c/p\u003e\n"],["\u003cp\u003eNest devices authorized through the SDM API should not be synced to Home Graph for Google Assistant integrations to avoid conflicts.\u003c/p\u003e\n"]]],[],null,["The SDM API is a REST API that provides various methods to\nview traits and execute trait commands for management of\nGoogle Nest devices. Use the access token granted during the\nauthorization process with each API call.\n\n\u003cbr /\u003e\n\n| All calls to the SDM API should use the following endpoint: \n| `https://smartdevicemanagement.googleapis.com/v1`\n\n\u003cbr /\u003e\n\nTraits\n\nThe SDM API uses a trait-based model for device information\nand functionality. Check the individual device guides to see what traits are\navailable for a device:\n\n\u003cbr /\u003e\n\n- [Camera](/nest/device-access/api/camera)\n- [Camera (battery)](/nest/device-access/api/camera-battery)\n- [Camera with Floodlight](/nest/device-access/api/camera-floodlight)\n- [Camera (wired)](/nest/device-access/api/camera-wired)\n- [Display](/nest/device-access/api/display)\n- [Doorbell](/nest/device-access/api/doorbell)\n- [Doorbell (battery)](/nest/device-access/api/doorbell-battery)\n- [Doorbell (wired)](/nest/device-access/api/doorbell-wired)\n- [Thermostat](/nest/device-access/api/thermostat)\n\n\u003cbr /\u003e\n\nMethods\n\nSee the [API Reference](/nest/device-access/reference/rest) for complete details on\nall the methods available for the SDM API.\n\nexecuteCommand\n\nExecutes a command to an authorized device.\n\nUse a `POST` call to execute a command. For example, to change the thermostat\nmode: \n\n```\nPOST /enterprises/project-id/devices/device-id:executeCommand\n{\n \"command\" : \"sdm.devices.commands.ThermostatMode.SetMode\",\n \"params\" : {\n \"mode\" : \"HEAT\"\n }\n}\n```\n\nFurther examples of commands can be found in each individual trait reference\npage. See the complete [trait listing](/nest/device-access/traits#trait_categories)\nfor more information.\n\nget\n\nGets information about an authorized structure or device.\n\nA `GET` call returns a single response with current fields and values for all\ntraits available for a structure or device that the user has\nauthorized and a \\`parentRelations' object, which represents the parent resource\nof the current resource, either a structure or room.\n\nFor example, a Nest Thermostat might return the\nfollowing: \n\n```\nGET /enterprises/project-id/devices/device-id\n{\n \"name\" : \"enterprises/project-id/devices/device-id\",\n \"type\" : \"sdm.devices.types.THERMOSTAT\",\n \"assignee\" : \"enterprises/project-id/structures/structure-id/rooms/room-id\",\n \"traits\" : {\n \"sdm.devices.traits.Connectivity\" : {\n \"status\" : \"ONLINE\"\n },\n \"sdm.devices.traits.Fan\" : {\n \"timerMode\" : \"ON\",\n \"timerTimeout\" : \"2019-05-10T03:22:54Z\"\n },\n \"sdm.devices.traits.Humidity\" : {\n \"ambientHumidityPercent\" : 35.0\n },\n \"sdm.devices.traits.Info\" : {\n \"customName\" : \"My device\"\n },\n \"sdm.devices.traits.Settings\" : {\n \"temperatureScale\" : \"CELSIUS\"\n },\n \"sdm.devices.traits.Temperature\" : {\n \"ambientTemperatureCelsius\" : 23.0\n },\n \"sdm.devices.traits.ThermostatEco\" : {\n \"availableModes\" : [\"MANUAL_ECO\", \"OFF\"],\n \"mode\" : \"MANUAL_ECO\",\n \"heatCelsius\" : 20.0,\n \"coolCelsius\" : 22.0\n },\n \"sdm.devices.traits.ThermostatHvac\" : {\n \"status\" : \"HEATING\"\n },\n \"sdm.devices.traits.ThermostatMode\" : {\n \"availableModes\" : [\"HEAT\", \"COOL\", \"HEATCOOL\", \"OFF\"],\n \"mode\" : \"COOL\"\n },\n \"sdm.devices.traits.ThermostatTemperatureSetpoint\" : {\n \"heatCelsius\" : 20.0,\n \"coolCelsius\" : 22.0\n }\n },\n \"parentRelations\" : [\n {\n \"parent\" : \"enterprises/project-id/structures/structure-id/rooms/room-id\",\n \"displayName\" : \"Lobby\"\n }\n ]\n}\n```\n\nlist\n\nLists authorized structures, rooms, or devices.\n\nTo list all structures, rooms, or devices authorized under a single access\ntoken, make a `GET` call against the appropriate resource endpoint: \n\n```\nGET /enterprises/project-id/structures\n``` \n\n```\nGET /enterprises/project-id/structures/structure-id/rooms\n``` \n\n```\nGET /enterprises/project-id/devices\n```\n\nGoogle Assistant integrations **Warning:** Nest devices in the SDM API should not be synced to Home Graph as part of a Google Assistant integration.\n\nOnce a device is authorized for SDM, Google becomes aware of the device in Home\nGraph and manages its state directly. If you have Google Assistant integration\nas part of your Commercial offering:\n\n- Do not send [Request Sync\n requests](/assistant/smarthome/develop/request-sync) for SDM devices\n- Omit SDM devices from any responses to a [SYNC\n intent](/assistant/smarthome/develop/process-intents#SYNC)\n\n\nErrors\n\nSee the [API Error Code Reference](/nest/device-access/reference/errors/api) for\nthe full list of API error codes.\n\n\u003cbr /\u003e"]]