स्मार्ट होम फ़ॉसेट गाइड
action.devices.types.FAUCET - फ़ॉसेट, अलग-अलग मात्रा और प्रीसेट में लिक्विड दे सकते हैं. नल में कई मोड हो सकते हैं और हर मोड की अपनी सेटिंग होती है. ये फ़ॉसेट के हिसाब से तय किए जाते हैं और इन्हें सामान्य तौर पर समझा जाता है.
इस टाइप से पता चलता है कि डिवाइस को फ़ॉसेट आइकॉन और इससे जुड़े कुछ समानार्थी शब्द और उपनाम मिलते हैं.
डिवाइस की क्षमताएं
लागू करने से जुड़ी जानकारी के लिए, संबंधित ट्रेट का दस्तावेज़ देखें. जैसे, आपकी सेवा को किन एट्रिब्यूट और स्थितियों के साथ काम करना चाहिए और EXECUTE और QUERY के जवाब कैसे बनाने चाहिए.
सुझाई गई विशेषताएं
अगर ये सुविधाएं आपके डिवाइस पर काम करती हैं, तो हम इन्हें इस्तेमाल करने का सुझाव देते हैं. हालांकि, आपके पास उपलब्ध सभी विशेषताओं को मिलाकर, अपने मौजूदा प्रॉडक्ट की सुविधाओं से सबसे ज़्यादा मेल खाने वाली विशेषताएं चुनने का विकल्प होता है.
-
action.devices.traits.Dispense -
action.devices.traits.StartStop -
action.devices.traits.TemperatureControl
डिवाइस का उदाहरण: सामान्य नल
इस सेक्शन में, डिवाइस के टाइप और ऊपर दी गई विशेषताओं के आधार पर, "नल" के सामान्य उदाहरण वाले इंटेंट पेलोड दिए गए हैं. अगर आपने लागू करने के तरीके में कोई नई विशेषता जोड़ी है या कोई विशेषता हटाई है, तो उन बदलावों को दिखाने के लिए, अपनी प्रतिक्रियाओं में बदलाव करें.
सिंक के जवाब का उदाहरण
{
"requestId": "6894439706274654512",
"inputs": [
{
"intent": "action.devices.SYNC"
}
]
}{ "requestId": "6894439706274654512", "payload": { "agentUserId": "user123", "devices": [ { "id": "123", "type": "action.devices.types.FAUCET", "traits": [ "action.devices.traits.Dispense", "action.devices.traits.TemperatureControl", "action.devices.traits.OnOff" ], "name": { "name": "Simple faucet" }, "willReportState": true, "attributes": { "supportedDispenseItems": [ { "item_name": "water_key", "item_name_synonyms": [ { "lang": "en", "synonyms": [ "Water" ] }, { "lang": "es", "synonyms": [ "Agua" ] }, { "lang": "fr", "synonyms": [ "Eau" ] } ], "supported_units": [ "TEASPOONS", "TABLESPOONS", "FLUID_OUNCES", "CUPS", "PINTS", "QUARTS", "GALLONS", "MILLILITERS", "LITERS", "DECILITERS" ], "default_portion": { "amount": 2, "unit": "CUPS" } } ], "supportedDispensePresets": [ { "preset_name": "cat_water_bowl_key", "preset_name_synonyms": [ { "lang": "en", "synonyms": [ "Cat water bowl", "Cat water dish", "Cat water cup" ] }, { "lang": "es", "synonyms": [ "Plato de agua para gato", "Bebedero para gato" ] }, { "lang": "fr", "synonyms": [ "Bol d'eau de chat", "Bac \u00e0 eau pour chat", "Tasse d'eau de chat" ] } ] } ], "temperatureRange": { "minThresholdCelsius": 25, "maxThresholdCelsius": 100 }, "temperatureUnitForUX": "F" }, "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": false, "temperatureSetpointCelsius": 30, "dispenseItems": [ { "itemName": "water_key", "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": "water_key" } } ] } ] } } ] }
{ "requestId": "6894439706274654516", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "dispenseItems": [ { "itemName": "water_key", "amountLastDispensed": { "amount": 1, "unit": "CUPS" }, "isCurrentlyDispensing": true } ] } } ] } }
SetTemperature
कमांड पैरामीटर के बारे में ज़्यादा जानकारी के लिए,
action.devices.traits.TemperatureControl
रेफ़रंस देखें.
{ "requestId": "6894439706274654518", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.SetTemperature", "params": { "temperature": 65 } } ] } ] } } ] }
{ "requestId": "6894439706274654518", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "temperatureSetpointCelsius": 65 } } ] } }
OnOff
कमांड पैरामीटर के बारे में ज़्यादा जानकारी के लिए,
action.devices.traits.OnOff
रेफ़रंस देखें.
{ "requestId": "6894439706274654520", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.OnOff", "params": { "on": true } } ] } ] } } ] }
{ "requestId": "6894439706274654520", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "on": true } } ] } }