स्मार्ट होम अवन के बारे में गाइड

action.devices.types.OVEN - ओवन के साथ इंटरैक्ट करने का मतलब है कि ओवन को किसी तापमान पर बेक या ब्रॉइल करने की सुविधा उपलब्ध है. अवन के गर्म होने पर, उसके अंदर का तापमान अलग-अलग होता है. इसलिए, इस पर भी नज़र रखी जा सकती है. ओवन में खाना पकाने का समय तय होता है. इससे बेकिंग की अवधि सीमित हो जाती है.

इस टाइप से पता चलता है कि डिवाइस को ओवन का आइकॉन और इससे जुड़े कुछ समानार्थी शब्द और अन्य नाम मिलते हैं.

ओवन के लिए, action.devices.traits.OnOff और action.devices.traits.TemperatureControl के लिए टाइप के हिसाब से व्याकरण तय किया गया है:
  • अगर डिवाइस पर OnOff की सुविधा काम करती है, तो ओवन को पहले से गरम करो कहने पर, action.devices.commands.OnOff का निर्देश भेजा जाएगा.
  • अगर डिवाइस पर TemperatureControl की सुविधा काम करती है, तो ओवन को 350 डिग्री पर प्रीहीट करो निर्देश देने पर, ओवन को उस तापमान पर सेट करने का निर्देश भेजा जाएगा.

डिवाइस की क्षमताएं

लागू करने से जुड़ी जानकारी के लिए, संबंधित ट्रेट का दस्तावेज़ देखें. जैसे, आपकी सेवा को किन एट्रिब्यूट और स्थितियों के साथ काम करना चाहिए और EXECUTE और QUERY के जवाब कैसे बनाने चाहिए.

ज़रूरी ट्रेट

अगर आपके डिवाइस पर ये सुविधाएं और कमांड लागू होती हैं, तो इनका इस्तेमाल करना ज़रूरी है. अगर आपका डिवाइस इन सुविधाओं के साथ काम नहीं करता है, तो QUERY या EXECUTE के जवाब में functionNotSupported का गड़बड़ी कोड डालें. ज़्यादा जानकारी के लिए, गड़बड़ियां और अपवाद देखें.

अगर ये सुविधाएं आपके डिवाइस पर काम करती हैं, तो हम इन्हें इस्तेमाल करने का सुझाव देते हैं. हालांकि, आपके पास उपलब्ध सभी विशेषताओं को मिलाकर, अपने मौजूदा प्रॉडक्ट की सुविधाओं से सबसे ज़्यादा मेल खाने वाली विशेषताएं चुनने का विकल्प होता है.

डिवाइस का उदाहरण: साधारण ओवन

इस सेक्शन में, डिवाइस के टाइप और ऊपर दी गई विशेषताओं के आधार पर, "ओवन" के लिए सामान्य इंटेंट पेलोड का उदाहरण दिया गया है. अगर आपने लागू करने के तरीके में कोई नई विशेषता जोड़ी है या कोई विशेषता हटाई है, तो उन बदलावों को दिखाने के लिए, अपनी प्रतिक्रियाओं में बदलाव करें.

सिंक के जवाब का उदाहरण

अनुरोध
{
  "requestId": "6894439706274654512",
  "inputs": [
    {
      "intent": "action.devices.SYNC"
    }
  ]
}
Response
{
  "requestId": "6894439706274654512",
  "payload": {
    "agentUserId": "user123",
    "devices": [
      {
        "id": "123",
        "type": "action.devices.types.OVEN",
        "traits": [
          "action.devices.traits.Cook",
          "action.devices.traits.OnOff",
          "action.devices.traits.TemperatureControl",
          "action.devices.traits.Timer",
          "action.devices.traits.StartStop"
        ],
        "name": {
          "name": "Simple oven"
        },
        "willReportState": true,
        "attributes": {
          "supportedCookingModes": [
            "BAKE",
            "CONVECTION_BAKE",
            "ROAST"
          ],
          "maxTimerLimitSec": 3600,
          "temperatureRange": {
            "minThresholdCelsius": 65,
            "maxThresholdCelsius": 288
          },
          "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"
          }
        ]
      }
    }
  ]
}
Response
{
  "requestId": "6894439706274654514",
  "payload": {
    "devices": {
      "123": {
        "status": "SUCCESS",
        "online": true,
        "on": true,
        "isRunning": true,
        "temperatureSetpointCelsius": 175,
        "currentCookingMode": "BAKE",
        "timerRemainingSec": -1
      }
    }
  }
}

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": true,
                  "cookingMode": "ROAST"
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Response
{
  "requestId": "6894439706274654516",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "currentCookingMode": "ROAST"
        }
      }
    ]
  }
}

OnOff

कमांड पैरामीटर के बारे में ज़्यादा जानकारी के लिए, action.devices.traits.OnOff रेफ़रंस देखें.

अनुरोध
{
  "requestId": "6894439706274654518",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.OnOff",
                "params": {
                  "on": true
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Response
{
  "requestId": "6894439706274654518",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "on": true
        }
      }
    ]
  }
}

SetTemperature

कमांड पैरामीटर के बारे में ज़्यादा जानकारी के लिए, action.devices.traits.TemperatureControl रेफ़रंस देखें.

अनुरोध
{
  "requestId": "6894439706274654520",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.SetTemperature",
                "params": {
                  "temperature": 200
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Response
{
  "requestId": "6894439706274654520",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "temperatureSetpointCelsius": 200,
          "temperatureAmbientCelsius": 100
        }
      }
    ]
  }
}

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": 300
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Response
{
  "requestId": "6894439706274654522",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "timerRemainingSec": 300
        }
      }
    ]
  }
}

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
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Response
{
  "requestId": "6894439706274654524",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "timerRemainingSec": 290
        }
      }
    ]
  }
}

TimerPause

कमांड पैरामीटर के बारे में ज़्यादा जानकारी के लिए, action.devices.traits.Timer रेफ़रंस देखें.

अनुरोध
{
  "requestId": "6894439706274654526",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.TimerPause"
              }
            ]
          }
        ]
      }
    }
  ]
}
Response
{
  "requestId": "6894439706274654526",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "timerRemainingSec": 300,
          "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"
              }
            ]
          }
        ]
      }
    }
  ]
}
Response
{
  "requestId": "6894439706274654528",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "timerRemainingSec": 300,
          "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"
              }
            ]
          }
        ]
      }
    }
  ]
}
Response
{
  "requestId": "6894439706274654530",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "timerRemainingSec": -1
        }
      }
    ]
  }
}

StartStop

कमांड पैरामीटर के बारे में ज़्यादा जानकारी के लिए, action.devices.traits.StartStop रेफ़रंस देखें.

अनुरोध
{
  "requestId": "6894439706274654532",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.StartStop",
                "params": {
                  "start": true
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Response
{
  "requestId": "6894439706274654532",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "isRunning": true
        }
      }
    ]
  }
}

डिवाइस से जुड़ी गड़बड़ियां

गड़बड़ियों और अपवादों की पूरी सूची देखें.