راهنمای آلاچیق خانه هوشمند
action.devices.types.PERGOLA - Pergolas (an outdoor garden structure) can be opened and closed, potentially in more than one direction. For example, some pergolas with a canvas may open either to the LEFT or RIGHT.
این نوع نشان میدهد که دستگاه نماد Pergola و برخی مترادفها و نامهای مستعار مرتبط را دریافت میکند.
قابلیتهای دستگاه
برای جزئیات پیادهسازی، مانند ویژگیها و حالتهایی که سرویس شما باید پشتیبانی کند، و نحوه ساخت پاسخهای EXECUTE و QUERY، به مستندات مربوط به ویژگیها مراجعه کنید.
صفات مورد نیاز
این ویژگیها و دستورات، در صورت وجود برای دستگاه شما، الزامی هستند. اگر دستگاه شما از این ویژگیها پشتیبانی نمیکند، کد خطای functionNotSupported را در یک پاسخ QUERY یا EXECUTE وارد کنید. برای اطلاعات بیشتر به بخش خطاها و استثنائات مراجعه کنید.
ویژگیهای توصیهشده
این ویژگیها، در صورت وجود، برای دستگاه شما توصیه میشوند. با این حال، شما میتوانید از بین تمام ویژگیهای موجود، آنها را با هم ترکیب و تطبیق دهید تا به بهترین شکل با عملکرد محصول فعلی شما مطابقت داشته باشد.
دستگاه نمونه: آلاچیق ساده
This section contains example intent payloads representing a common "Pergola" based on the device type and traits above. If you add or remove traits in your implementation, modify your responses accordingly to reflect those changes.
نمونه پاسخ SYNC
{
"requestId": "6894439706274654512",
"inputs": [
{
"intent": "action.devices.SYNC"
}
]
}{ "requestId": "6894439706274654512", "payload": { "agentUserId": "user123", "devices": [ { "id": "123", "type": "action.devices.types.PERGOLA", "traits": [ "action.devices.traits.OpenClose", "action.devices.traits.Rotation" ], "name": { "name": "Simple pergola" }, "willReportState": true, "attributes": { "openDirection": [ "LEFT", "RIGHT" ], "supportsDegrees": false, "supportsPercent": true }, "deviceInfo": { "manufacturer": "smart-home-inc", "model": "hs1234", "hwVersion": "3.2", "swVersion": "11.4" } } ] } }
نمونه پاسخ QUERY
{ "requestId": "6894439706274654514", "inputs": [ { "intent": "action.devices.QUERY", "payload": { "devices": [ { "id": "123" } ] } } ] }
{ "requestId": "6894439706274654514", "payload": { "devices": { "123": { "status": "SUCCESS", "online": true, "openState": [ { "openPercent": 30, "openDirection": "LEFT" }, { "openPercent": 50, "openDirection": "RIGHT" } ], "rotationPercent": 30 } } } }
نمونه دستورات اجرایی
باز کردنبستن
برای جزئیات بیشتر در مورد پارامترهای دستور، به مرجع action.devices.traits.OpenClose مراجعه کنید.
{ "requestId": "6894439706274654516", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.OpenClose", "params": { "openPercent": 10, "openDirection": "LEFT" } } ] } ] } } ] }
{ "requestId": "6894439706274654516", "payload": { "commands": [ { "ids": [ "123" ], "status": "PENDING", "states": { "online": true, "openState": [ { "openPercent": 10, "openDirection": "LEFT" }, { "openPercent": 50, "openDirection": "RIGHT" } ] } } ] } }
باز کردنبستن نسبی
برای جزئیات بیشتر در مورد پارامترهای دستور، به مرجع action.devices.traits.OpenClose مراجعه کنید.
{ "requestId": "6894439706274654518", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.OpenCloseRelative", "params": { "openRelativePercent": 10, "openDirection": "LEFT" } } ] } ] } } ] }
{ "requestId": "6894439706274654518", "payload": { "commands": [ { "ids": [ "123" ], "status": "PENDING", "states": { "online": true, "openState": [ { "openPercent": 40, "openDirection": "LEFT" }, { "openPercent": 50, "openDirection": "RIGHT" } ] } } ] } }
چرخش مطلق
برای جزئیات بیشتر در مورد پارامترهای دستور، به مرجع action.devices.traits.Rotation مراجعه کنید.
{ "requestId": "6894439706274654520", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.RotateAbsolute", "params": { "rotationPercent": 50 } } ] } ] } } ] }
{ "requestId": "6894439706274654520", "payload": { "commands": [ { "ids": [ "123" ], "status": "PENDING", "states": { "online": true, "rotationPercent": 50 } } ] } }