स्मार्ट होम कुकटॉप गाइड

action.devices.types.COOKTOP - कुकटॉप इस्तेमाल करते समय, उन्हें चालू और बंद किया जा सकता है, खाना बनाना शुरू और बंद किया जा सकता है, टाइमर सेट किया जा सकता है, खाना बनाने के मोड और फ़ूड प्रीसेट को अपने हिसाब से सेट किया जा सकता है. साथ ही, खाना बनाने के अलावा अन्य मोड की सेटिंग को बदला भी जा सकता है.

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

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

इन्हें लागू करने के बारे में ज़्यादा जानकारी के लिए, इनसे जुड़े ट्रेट का दस्तावेज़ देखें. जैसे, वे एट्रिब्यूट और स्टेट जिन्हें आपकी सेवा को सपोर्ट करना चाहिए. साथ ही, 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.COOKTOP",
        "traits": [
          "action.devices.traits.Cook",
          "action.devices.traits.StartStop",
          "action.devices.traits.Timer",
          "action.devices.traits.OnOff"
        ],
        "name": {
          "name": "Simple cooktop"
        },
        "willReportState": true,
        "attributes": {
          "supportedCookingModes": [
            "COOK",
            "BOIL",
            "SAUTE"
          ],
          "foodPresets": [
            {
              "food_preset_name": "chicken_key",
              "supported_units": [
                "POUNDS",
                "OUNCES"
              ],
              "food_synonyms": [
                {
                  "synonym": [
                    "Chicken",
                    "Chicken breast",
                    "Chicken thigh"
                  ],
                  "lang": "en"
                }
              ]
            },
            {
              "food_preset_name": "bacon_key",
              "supported_units": [
                "POUNDS",
                "OUNCES"
              ],
              "food_synonyms": [
                {
                  "synonym": [
                    "Bacon",
                    "Bacon strips"
                  ],
                  "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": "COOK",
        "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": true,
                  "cookingMode": "BOIL"
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
जवाब
{
  "requestId": "6894439706274654516",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "PENDING",
        "states": {
          "online": true,
          "currentCookingMode": "BOIL",
          "currentFoodPreset": "NONE"
        }
      }
    ]
  }
}

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": "SUCCESS",
        "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": "SUCCESS",
        "states": {
          "online": true,
          "isRunning": false,
          "isPaused": 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": 300
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
जवाब
{
  "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
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
जवाब
{
  "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
        }
      }
    ]
  }
}

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
        }
      }
    ]
  }
}

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

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