स्मार्ट होम लाइट गाइड
action.devices.types.LIGHT
- हल्के रंग वाले डिवाइसों को चालू और बंद किया जा सकता है. इनमें अन्य सुविधाएं भी हो सकती हैं, जैसे कि स्क्रीन की रोशनी कम करना और रंग बदलना.
इससे पता चलता है कि डिवाइस को Light आइकॉन और इससे मिलते-जुलते कुछ समानार्थी शब्द और उपनाम मिले हैं.
डिवाइस की क्षमताएं
लागू करने के बारे में जानकारी के लिए, Trait से जुड़ा दस्तावेज़ देखें. जैसे, एट्रिब्यूट और यह जानकारी कि आपकी सेवा के साथ काम करना चाहिए. साथ ही, EXECUTE और QUERY रिस्पॉन्स बनाने का तरीका जानें.
ज़रूरी traits
अगर आपके डिवाइस पर लागू हो, तो ये विशेषताएं और निर्देश ज़रूरी हैं. अगर आपके डिवाइस में ये विशेषताएं काम नहीं करती हैं, तो QUERY या EXECUTE जवाब में
functionNotSupported
का गड़बड़ी कोड डालें. ज़्यादा जानकारी के लिए
गड़बड़ियां और अपवाद देखें.
सुझाए गए traits
अगर आपके डिवाइस पर लागू हो, तो इन विशेषताओं के इस्तेमाल का सुझाव दिया जाता है. हालांकि, अपने मौजूदा प्रॉडक्ट की सुविधाओं को अपने हिसाब से बनाने के लिए, आपको सभी उपलब्ध विशेषताओं को एक साथ मिलाने की सुविधा मिलती है.
क्वालिटी के लिए ज़रूरी शर्तें
- इंतज़ार का समय: 700 मि॰से॰ या उससे कम होना चाहिए.
- भरोसेमंद: 99% से ज़्यादा या इसके बराबर होना चाहिए.
डिवाइस का उदाहरण: सिंपल लाइट
इस सेक्शन में, ऐसे इंटेंट पेलोड के उदाहरण शामिल हैं जो सामान्य "लाइट" को दिखाता है. यह डिवाइस के टाइप और ऊपर बताई गई विशेषताओं के आधार पर होता है. अगर लागू करने की प्रक्रिया में कोई एट्रिब्यूट जोड़ा या हटाया जाता है, तो उन बदलावों को दिखाने के लिए अपने जवाबों में उसके हिसाब से बदलाव करें.
सिंक के जवाब का नमूना
{ "requestId": "6894439706274654512", "inputs": [ { "intent": "action.devices.SYNC" } ] }
{ "requestId": "6894439706274654512", "payload": { "agentUserId": "user123", "devices": [ { "id": "123", "type": "action.devices.types.LIGHT", "traits": [ "action.devices.traits.ColorSetting", "action.devices.traits.Brightness", "action.devices.traits.OnOff" ], "name": { "name": "Simple light" }, "willReportState": true, "attributes": { "colorTemperatureRange": { "temperatureMinK": 2000, "temperatureMaxK": 6500 } }, "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, "on": true, "brightness": 65, "color": { "temperatureK": 4000 } } } } }
EXECUTE के निर्देशों के उदाहरण
ColorAbsolute
कमांड पैरामीटर के बारे में ज़्यादा जानकारी के लिए,
action.devices.traits.ColorSetting
रेफ़रंस देखें.
{ "requestId": "6894439706274654520", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.ColorAbsolute", "params": { "color": { "name": "Warm White", "temperature": 3000 } } } ] } ] } } ] }
{ "requestId": "6894439706274654520", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "color": { "temperatureK": 3000 } } } ] } }
BrightnessAbsolute
कमांड पैरामीटर के बारे में ज़्यादा जानकारी के लिए,
action.devices.traits.Brightness
रेफ़रंस देखें.
{ "requestId": "6894439706274654518", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.BrightnessAbsolute", "params": { "brightness": 65 } } ] } ] } } ] }
{ "requestId": "6894439706274654518", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "brightness": 65 } } ] } }
OnOff
कमांड पैरामीटर के बारे में ज़्यादा जानकारी के लिए,
action.devices.traits.OnOff
रेफ़रंस देखें.
{ "requestId": "6894439706274654516", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.OnOff", "params": { "on": true } } ] } ] } } ] }
{ "requestId": "6894439706274654516", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "on": true } } ] } }