स्मार्ट होम ग्रिल के लिए गाइड
action.devices.types.GRILL - ग्रिल इस्तेमाल करते समय, उन्हें चालू और बंद किया जा सकता है, शुरू और बंद किया जा सकता है, टाइमर सेट किया जा सकता है, कुकिंग मोड और फ़ूड प्रीसेट में बदलाव किया जा सकता है, और नॉन-कुकिंग मोड की सेटिंग को बदला भी जा सकता है.
इस टाइप से पता चलता है कि डिवाइस को ग्रिल का आइकॉन और उससे जुड़े कुछ मिलते-जुलते शब्द और उपनाम मिलते हैं.
डिवाइस की क्षमताएं
इन्हें लागू करने के बारे में ज़्यादा जानकारी के लिए, इनसे जुड़ी खास जानकारी वाला दस्तावेज़ देखें. जैसे, वे एट्रिब्यूट और स्टेट जिन्हें आपकी सेवा को सपोर्ट करना चाहिए. साथ ही, EXECUTE और QUERY के जवाब कैसे बनाएं.
ज़रूरी ट्रेट
अगर ये ट्रेट और निर्देश आपके डिवाइस पर लागू होते हैं, तो इनका इस्तेमाल करना ज़रूरी है. अगर आपका डिवाइस इन ट्रेट को सपोर्ट नहीं करता है, तो QUERY या EXECUTE के जवाब में, functionNotSupported का गड़बड़ी कोड डालें. ज़्यादा जानकारी के लिए,
गड़बड़ियां और अपवाद देखें.
सुझाए गए ट्रेट
अगर ये ट्रेट आपके डिवाइस पर लागू होते हैं, तो इनका इस्तेमाल करने का सुझाव दिया जाता है. हालांकि, अपने मौजूदा प्रॉडक्ट की सुविधाओं के हिसाब से, सभी उपलब्ध ट्रेट को मिलाकर इस्तेमाल किया जा सकता है.
डिवाइस का उदाहरण: सामान्य ग्रिल
इस सेक्शन में, डिवाइस के टाइप और ऊपर बताए गए ट्रेट के आधार पर, सामान्य "ग्रिल" को दिखाने वाले इंटेंट पेलोड के उदाहरण दिए गए हैं. अगर आपने लागू करने के दौरान, ट्रेट जोड़े या हटाए हैं, तो उन बदलावों को दिखाने के लिए, अपने जवाबों में ज़रूरी बदलाव करें.
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 } } ] } }