คู่มือเครื่องดูดฝุ่นในบ้านอัจฉริยะ
action.devices.types.VACUUM - เครื่องดูดฝุ่นอาจมีฟังก์ชันต่างๆ เช่น เริ่ม หยุด และหยุดชั่วคราวการทำความสะอาด จอดเทียบท่า ตรวจสอบรอบการทำความสะอาดปัจจุบัน ค้นหาเครื่องดูดฝุ่น หรือปรับโหมดต่างๆ เครื่องดูดฝุ่นบางรุ่นอาจรองรับการทำความสะอาดโซนที่เฉพาะเจาะจงในบ้าน
ประเภทนี้บ่งบอกว่าอุปกรณ์จะได้รับไอคอนเครื่องดูดฝุ่น รวมถึงคำพ้องความหมายและนามแฝงที่เกี่ยวข้อง
ความสามารถของอุปกรณ์
โปรดดูรายละเอียดการใช้งาน เช่น แอตทริบิวต์และสถานะที่บริการของคุณควรรองรับ รวมถึงวิธีสร้างการตอบกลับ EXECUTE และ QUERY ในเอกสารประกอบลักษณะการทำงานที่เกี่ยวข้อง
ลักษณะการทำงานที่จำเป็น
คุณต้องใช้ลักษณะการทำงานและคำสั่งเหล่านี้หากอุปกรณ์ของคุณรองรับ หากอุปกรณ์ไม่รองรับลักษณะการทำงานเหล่านี้ ให้ป้อนรหัสข้อผิดพลาด functionNotSupported ในการตอบกลับ QUERY หรือ EXECUTE ดูข้อมูลเพิ่มเติมได้ที่
ข้อผิดพลาดและข้อยกเว้น
ลักษณะการทำงานที่แนะนำ
เราขอแนะนำให้ใช้ลักษณะการทำงานเหล่านี้หากอุปกรณ์ของคุณรองรับ อย่างไรก็ตาม คุณสามารถเลือกใช้ลักษณะการทำงานที่มีทั้งหมดเพื่อจับคู่กับฟังก์ชันการทำงานของผลิตภัณฑ์ที่มีอยู่ให้ดีที่สุด
-
action.devices.traits.Dock -
action.devices.traits.EnergyStorage -
action.devices.traits.Locator -
action.devices.traits.OnOff -
action.devices.traits.RunCycle
ตัวอย่างอุปกรณ์: เครื่องดูดฝุ่นแบบง่าย
ส่วนนี้มีเพย์โหลดของ Intent ตัวอย่างที่แสดงถึง "เครื่องดูดฝุ่น" ทั่วไปตามประเภทอุปกรณ์และลักษณะการทำงานข้างต้น หากคุณเพิ่มหรือนำลักษณะการทำงานออกในการใช้งาน ให้แก้ไขการตอบกลับตามนั้นเพื่อแสดงการเปลี่ยนแปลง
ตัวอย่างการตอบสนองการซิงค์
{
"requestId": "6894439706274654512",
"inputs": [
{
"intent": "action.devices.SYNC"
}
]
}{ "requestId": "6894439706274654512", "payload": { "agentUserId": "user123", "devices": [ { "id": "123", "type": "action.devices.types.VACUUM", "traits": [ "action.devices.traits.Dock", "action.devices.traits.EnergyStorage", "action.devices.traits.StartStop" ], "name": { "name": "Simple vacuum" }, "willReportState": true, "attributes": { "queryOnlyEnergyStorage": true, "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, "isRunning": false, "isPaused": false, "isDocked": true, "descriptiveCapacityRemaining": "HIGH", "capacityRemaining": [ { "unit": "SECONDS", "rawValue": 36000 }, { "unit": "PERCENTAGE", "rawValue": 90 } ] } } } }
ตัวอย่างคำสั่ง EXECUTE
ตรึง
ดูรายละเอียดเพิ่มเติมเกี่ยวกับพารามิเตอร์คำสั่งได้ที่
ข้อมูลอ้างอิง
action.devices.traits.Dock
{ "requestId": "6894439706274654516", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.Dock" } ] } ] } } ] }
{ "requestId": "6894439706274654516", "payload": { "commands": [ { "ids": [ "123" ], "status": "PENDING", "states": { "online": true, "isDocked": true } } ] } }
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 } } ] } }