คู่มือให้อาหารสัตว์เลี้ยงในบ้านอัจฉริยะ
action.devices.types.PETFEEDER
- การโต้ตอบกับเครื่องให้อาหารสัตว์เลี้ยงอาจรวมถึงการจ่ายอาหารหรือน้ำสัตว์เลี้ยงในปริมาณและค่าที่กำหนดล่วงหน้าที่หลากหลาย
ประเภทนี้บ่งชี้ว่าอุปกรณ์มีไอคอนเครื่องให้อาหารสัตว์เลี้ยง รวมถึงคำพ้องและชื่อแทนที่เกี่ยวข้อง
ความสามารถของอุปกรณ์
โปรดดูเอกสารลักษณะที่เกี่ยวข้องสำหรับรายละเอียดการติดตั้งใช้งาน เช่น แอตทริบิวต์และระบุว่าบริการควรรองรับ และวิธีสร้างการตอบกลับ EXECUTE และ QUERY
ลักษณะที่จำเป็น
คุณลักษณะและคำสั่งเหล่านี้จำเป็น (หากเกี่ยวข้องกับอุปกรณ์ของคุณ) หากอุปกรณ์ไม่รองรับลักษณะเหล่านี้ ให้ป้อนรหัสข้อผิดพลาดของ functionNotSupported
ในการตอบกลับ QUERY หรือ EXECUTE โปรดดูข้อมูลเพิ่มเติมที่ข้อผิดพลาดและข้อยกเว้น
ลักษณะที่แนะนำ
เราขอแนะนำให้ใช้ลักษณะเหล่านี้ หากเกี่ยวข้องกับอุปกรณ์ของคุณ อย่างไรก็ตาม คุณสามารถผสมผสานลักษณะเฉพาะที่มีอยู่ทั้งหมดให้ตรงกับฟังก์ชันการทำงานของผลิตภัณฑ์ที่มีอยู่มากที่สุดได้อย่างตรงจุด
ข้อกำหนดด้านคุณภาพ
- เวลาในการตอบสนอง: ต้องน้อยกว่าหรือเท่ากับ 800 มิลลิวินาที
- ความเสถียร: ต้องมากกว่าหรือเท่ากับ 97%
อุปกรณ์ตัวอย่าง: เครื่องให้อาหารสัตว์เลี้ยงแบบง่าย
ส่วนนี้ประกอบด้วยเพย์โหลด Intent ตัวอย่างที่แสดง "อุปกรณ์ให้อาหารสัตว์เลี้ยง" ทั่วไปโดยอิงตามประเภทอุปกรณ์และลักษณะข้างต้น หากคุณเพิ่มหรือนำลักษณะในการใช้งานออก ให้แก้ไขคำตอบให้สอดคล้องกับการเปลี่ยนแปลงเหล่านั้น
ตัวอย่างการตอบสนองการซิงค์
{ "requestId": "6894439706274654512", "inputs": [ { "intent": "action.devices.SYNC" } ] }
{ "requestId": "6894439706274654512", "payload": { "agentUserId": "user123", "devices": [ { "id": "123", "type": "action.devices.types.PETFEEDER", "traits": [ "action.devices.traits.Dispense" ], "name": { "name": "Simple pet feeder" }, "willReportState": true, "attributes": { "supportedDispenseItems": [ { "item_name": "cat_food_key", "item_name_synonyms": [ { "lang": "en", "synonyms": [ "Cat food", "Kibble" ] } ], "supported_units": [ "OUNCES", "CUPS" ], "default_portion": { "amount": 1, "unit": "CUPS" } } ], "supportedDispensePresets": [ { "preset_name": "cat_meal_key", "preset_name_synonyms": [ { "lang": "en", "synonyms": [ "Normal meal", "Dinner" ] } ] } ] }, "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, "dispenseItems": [ { "itemName": "cat_food_key", "amountRemaining": { "amount": 6, "unit": "CUPS" }, "amountLastDispensed": { "amount": 2.5, "unit": "CUPS" }, "isCurrentlyDispensing": false } ] } } } }
ตัวอย่างคำสั่ง EXECUTE
จ่าย
ดูรายละเอียดเพิ่มเติมเกี่ยวกับพารามิเตอร์คำสั่งได้ที่ข้อมูลอ้างอิง
action.devices.traits.Dispense
{ "requestId": "6894439706274654516", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.Dispense", "params": { "amount": 1, "unit": "CUPS", "item": "cat_food_key" } } ] } ] } } ] }
{ "requestId": "6894439706274654516", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "dispenseItems": [ { "itemName": "cat_food_key", "amountRemaining": { "amount": 5, "unit": "CUPS" }, "amountLastDispensed": { "amount": 1, "unit": "CUPS" }, "isCurrentlyDispensing": true } ] } } ] } }