تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
واجهة برمجة التطبيقات SDM هي واجهة REST API توفّر طرقًا مختلفة
لعرض السمات وتنفيذ أوامر السمات لإدارة
أجهزة Google Nest. استخدِم رمز الدخول الذي تم منحه خلال عملية التفويض مع كل طلب بيانات من واجهة برمجة التطبيقات.
السمات
تستخدِم واجهة برمجة التطبيقات SDM نموذجًا مستندًا إلى السمات للحصول على معلومات الجهاز ووظائفه. راجِع أدلة الأجهزة الفردية لمعرفة السمات المتوفّرة لكل جهاز:
يمكنك الاطّلاع على المزيد من الأمثلة على الأوامر في كل صفحة مرجعية خاصة بكل سمة. يمكنك الاطّلاع على قائمة السمات الكاملة
للحصول على مزيد من المعلومات.
الحصول على
للحصول على معلومات حول بنية أو جهاز معتمَدَين
تعرض مكالمة GET ردًا واحدًا يتضمّن الحقول والقيم الحالية لجميع السمات المتاحة لبنية أو جهاز سمح لهما user ، بالإضافة إلى عنصر `parentRelations' الذي يمثّل المرجع الرئيسي للمرجع الحالي، سواء كان بنية أو غرفة.
على سبيل المثال، قد يعرض جهاز Nest Thermostat ما يلي:
تعرض هذه السمة قائمة بالبُنى أو الغرف أو الأجهزة المصرّح بها.
لعرض جميع المباني أو الغرف أو الأجهزة التي تم منحها إذن الوصول بموجب رمز مميّز واحد، عليك إجراء طلب GET إلى نقطة نهاية المورد المناسبة:
GET /enterprises/project-id/structures
GET /enterprises/project-id/structures/structure-id/rooms
GET /enterprises/project-id/devices
عمليات الدمج مع "مساعد Google"
بعد منح الإذن لجهاز بالوصول إلى SDM، ستتعرّف Google على الجهاز في قاعدة بيانات Home Graph وستدير حالته مباشرةً. إذا كنت توفّر ميزة الدمج مع "مساعد Google" كجزء من العرض التجاري:
تاريخ التعديل الأخير: 2025-07-29 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\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,["# Smart Device Management API\n\nThe 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------\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-------\n\nSee the [API Reference](/nest/device-access/reference/rest) for complete details on\nall the methods available for the SDM API.\n\n### executeCommand\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\n### get\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\n### list\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\n-----------------------------\n\n| **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------\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"]]