स्मार्ट होम पेट फ़ीडर गाइड
action.devices.types.PETFEEDER - पालतू जानवरों को खाना खिलाने वाले डिवाइसों के साथ इंटरैक्ट करने के लिए, अलग-अलग मात्रा और प्रीसेट में पालतू जानवरों को खाना या पानी दिया जा सकता है.
इस टाइप से पता चलता है कि डिवाइस को Pet Feeder का आइकॉन और इससे जुड़े कुछ समानार्थी शब्द और अन्य नाम मिलते हैं.
डिवाइस की क्षमताएं
लागू करने से जुड़ी जानकारी के लिए, संबंधित ट्रेट का दस्तावेज़ देखें. जैसे, आपकी सेवा को किन एट्रिब्यूट और स्थितियों के साथ काम करना चाहिए और EXECUTE और QUERY के जवाब कैसे बनाने चाहिए.
ज़रूरी ट्रेट
अगर ये आपके डिवाइस पर लागू होती हैं, तो इन ट्रेट और कमांड का इस्तेमाल करना ज़रूरी है. अगर आपके डिवाइस पर ये सुविधाएं काम नहीं करती हैं, तो QUERY या EXECUTE रिस्पॉन्स में functionNotSupported का गड़बड़ी कोड डालें. ज़्यादा जानकारी के लिए, गड़बड़ियां और अपवाद देखें.
सुझाई गई खासियतें
अगर ये सुविधाएं आपके डिवाइस पर काम करती हैं, तो हम इन्हें इस्तेमाल करने का सुझाव देते हैं. हालांकि, आपके पास मौजूदा प्रॉडक्ट की सुविधाओं से सबसे ज़्यादा मेल खाने वाली सभी उपलब्ध विशेषताओं को मिलाकर इस्तेमाल करने का विकल्प होता है.
डिवाइस का उदाहरण: पालतू जानवरों को खाना देने वाली सामान्य मशीन
इस सेक्शन में, डिवाइस के टाइप और ऊपर बताई गई सुविधाओं के आधार पर, "पालतू जानवरों को खाना खिलाने वाले डिवाइस" के सामान्य इंटेंट पेलोड का उदाहरण दिया गया है. अगर आपने अपने इंटिग्रेशन में कोई नई विशेषता जोड़ी है या किसी विशेषता को हटाया है, तो उन बदलावों को दिखाने के लिए, अपनी प्रतिक्रियाओं में बदलाव करें.
सिंक के जवाब का उदाहरण
{
"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", "action.devices.traits.StartStop" ], "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" } } ] } }
क्वेरी के जवाब का उदाहरण
{ "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 } ], "isRunning": true, "isPaused": 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": "PENDING", "states": { "online": true, "dispenseItems": [ { "itemName": "cat_food_key", "amountRemaining": { "amount": 5, "unit": "CUPS" }, "amountLastDispensed": { "amount": 1, "unit": "CUPS" }, "isCurrentlyDispensing": 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 } } ] } }