คู่มือเตาย่างสมาร์ทโฮม
action.devices.types.GRILL - การโต้ตอบกับเตาย่างอาจรวมถึงการเปิดและปิด การเริ่มและหยุด การตั้งเวลา การปรับโหมดการทำอาหารและค่าที่ตั้งล่วงหน้าของอาหาร รวมถึงการปรับการตั้งค่าโหมดที่ไม่ใช่การทำอาหารต่างๆ
ประเภทนี้บ่งบอกว่าอุปกรณ์จะได้รับไอคอนเตาย่าง รวมถึงคำพ้องความหมายและนามแฝงที่เกี่ยวข้อง
ความสามารถของอุปกรณ์
โปรดดูรายละเอียดการใช้งาน เช่น แอตทริบิวต์และสถานะที่บริการควรรองรับ รวมถึงวิธีสร้างการตอบกลับ EXECUTE และ QUERY ได้ในเอกสารประกอบลักษณะการทำงานที่เกี่ยวข้อง
ลักษณะการทำงานที่จำเป็น
คุณต้องใช้ลักษณะการทำงานและคำสั่งเหล่านี้หากอุปกรณ์ของคุณรองรับ หากอุปกรณ์ไม่รองรับลักษณะการทำงานเหล่านี้ ให้ป้อนรหัสข้อผิดพลาด functionNotSupported ในการตอบกลับ QUERY หรือ EXECUTE ดูข้อมูลเพิ่มเติมได้ที่
ข้อผิดพลาดและการยกเว้น
ลักษณะการทำงานที่แนะนำ
เราขอแนะนำให้ใช้ลักษณะการทำงานเหล่านี้หากอุปกรณ์ของคุณรองรับ อย่างไรก็ตาม คุณสามารถผสมและจับคู่ลักษณะการทำงานทั้งหมดที่มีอยู่เพื่อให้เหมาะกับฟังก์ชันการทำงานของผลิตภัณฑ์ที่มีอยู่มากที่สุด
ตัวอย่างอุปกรณ์: เตาปิ้งย่างแบบง่าย
ส่วนนี้มีเพย์โหลดของ Intent ตัวอย่างที่แสดงถึง "เตาย่าง" ทั่วไปตามประเภทอุปกรณ์และลักษณะการทำงานด้านบน หากคุณเพิ่มหรือนำลักษณะการทำงานออกในการใช้งาน ให้แก้ไขการตอบกลับตามนั้นเพื่อให้สอดคล้องกับการเปลี่ยนแปลง
ตัวอย่างการตอบกลับ SYNC
{
"requestId": "6894439706274654512",
"inputs": [
{
"intent": "action.devices.SYNC"
}
]
}{ "requestId": "6894439706274654512", "payload": { "agentUserId": "user123", "devices": [ { "id": "123", "type": "action.devices.types.GRILL", "traits": [ "action.devices.traits.Cook", "action.devices.traits.OnOff", "action.devices.traits.Timer", "action.devices.traits.StartStop" ], "name": { "name": "Simple grill" }, "willReportState": true, "attributes": { "supportedCookingModes": [ "COOK", "GRILL" ], "foodPresets": [ { "food_preset_name": "chicken_key", "supported_units": [ "POUNDS", "OUNCES" ], "food_synonyms": [ { "synonym": [ "Chicken", "Chicken breast", "Chicken thigh" ], "lang": "en" } ] }, { "food_preset_name": "hamburger_key", "supported_units": [ "POUNDS", "OUNCES" ], "food_synonyms": [ { "synonym": [ "Hamburger", "Burger", "Burger patty" ], "lang": "en" } ] } ], "maxTimerLimitSec": 1200, "pausable": 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, "on": true, "isRunning": true, "isPaused": false, "timerRemainingSec": 120, "currentCookingMode": "GRILL", "currentFoodPreset": "chicken_key" } } } }
ตัวอย่างคำสั่ง EXECUTE
ทำอาหาร
ดูรายละเอียดเพิ่มเติมเกี่ยวกับพารามิเตอร์คำสั่งได้ที่
ดู
action.devices.traits.Cook
ข้อมูลอ้างอิง
{ "requestId": "6894439706274654516", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.Cook", "params": { "start": false, "cookingMode": "GRILL" } } ] } ] } } ] }
{ "requestId": "6894439706274654516", "payload": { "commands": [ { "ids": [ "123" ], "status": "PENDING", "states": { "online": true, "currentCookingMode": "NONE", "currentFoodPreset": "NONE" } } ] } }
OnOff
ดูรายละเอียดเพิ่มเติมเกี่ยวกับพารามิเตอร์คำสั่งได้ที่
ดู
action.devices.traits.OnOff
ข้อมูลอ้างอิง
{ "requestId": "6894439706274654532", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.OnOff", "params": { "on": true } } ] } ] } } ] }
{ "requestId": "6894439706274654532", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "on": true } } ] } }
TimerStart
ดูรายละเอียดเพิ่มเติมเกี่ยวกับพารามิเตอร์คำสั่งได้ที่
ดู
action.devices.traits.Timer
ข้อมูลอ้างอิง
{ "requestId": "6894439706274654522", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.TimerStart", "params": { "timerTimeSec": 120 } } ] } ] } } ] }
{ "requestId": "6894439706274654522", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "timerRemainingSec": 120 } } ] } }
TimerAdjust
ดูรายละเอียดเพิ่มเติมเกี่ยวกับพารามิเตอร์คำสั่งได้ที่
ดู
action.devices.traits.Timer
ข้อมูลอ้างอิง
{ "requestId": "6894439706274654524", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.TimerAdjust", "params": { "timerTimeSec": -10 } } ] } ] } } ] }
{ "requestId": "6894439706274654524", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "timerRemainingSec": 110 } } ] } }
TimerPause
ดูรายละเอียดเพิ่มเติมเกี่ยวกับพารามิเตอร์คำสั่งได้ที่
ดู
action.devices.traits.Timer
ข้อมูลอ้างอิง
{ "requestId": "6894439706274654526", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.TimerPause" } ] } ] } } ] }
{ "requestId": "6894439706274654526", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "timerRemainingSec": 120, "timerPaused": true } } ] } }
TimerResume
ดูรายละเอียดเพิ่มเติมเกี่ยวกับพารามิเตอร์คำสั่งได้ที่
ดู
action.devices.traits.Timer
ข้อมูลอ้างอิง
{ "requestId": "6894439706274654528", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.TimerResume" } ] } ] } } ] }
{ "requestId": "6894439706274654528", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "timerRemainingSec": 120, "timerPaused": false } } ] } }
TimerCancel
ดูรายละเอียดเพิ่มเติมเกี่ยวกับพารามิเตอร์คำสั่งได้ที่
ดู
action.devices.traits.Timer
ข้อมูลอ้างอิง
{ "requestId": "6894439706274654530", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.TimerCancel" } ] } ] } } ] }
{ "requestId": "6894439706274654530", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "timerRemainingSec": -1 } } ] } }
StartStop
ดูรายละเอียดเพิ่มเติมเกี่ยวกับพารามิเตอร์คำสั่งได้ที่
ข้อมูลอ้างอิง
action.devices.traits.StartStop
{ "requestId": "6894439706274654518", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.StartStop", "params": { "start": true } } ] } ] } } ] }
{ "requestId": "6894439706274654518", "payload": { "commands": [ { "ids": [ "123" ], "status": "PENDING", "states": { "online": true, "isRunning": true, "isPaused": false } } ] } }
PauseUnpause
ดูรายละเอียดเพิ่มเติมเกี่ยวกับพารามิเตอร์คำสั่งได้ที่
ข้อมูลอ้างอิง
action.devices.traits.StartStop
{ "requestId": "6894439706274654520", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.PauseUnpause", "params": { "pause": true } } ] } ] } } ] }
{ "requestId": "6894439706274654520", "payload": { "commands": [ { "ids": [ "123" ], "status": "PENDING", "states": { "online": true, "isRunning": false, "isPaused": true } } ] } }