स्मार्ट होम के बारे में पूरी जानकारी देने वाली गाइड

action.devices.types.BLANKET - स्मार्ट कंबल के साथ इंटरैक्शन में, उन्हें चालू और बंद करना, उनके तापमान को अडजस्ट करना, और/या अलग-अलग मोड और टॉगल सेट करना शामिल हो सकता है.

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

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

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

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

डिवाइस का उदाहरण: कंबल

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

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

अनुरोध
{
  "requestId": "6894439706274654512",
  "inputs": [
    {
      "intent": "action.devices.SYNC"
    }
  ]
}
Response
{
  "requestId": "6894439706274654512",
  "payload": {
    "agentUserId": "user123",
    "devices": [
      {
        "id": "123",
        "type": "action.devices.types.BLANKET",
        "traits": [
          "action.devices.traits.OnOff",
          "action.devices.traits.Modes",
          "action.devices.traits.Toggles"
        ],
        "name": {
          "name": "Blanket"
        },
        "willReportState": true,
        "attributes": {
          "availableModes": [
            {
              "name": "temp_mode",
              "name_values": [
                {
                  "name_synonym": [
                    "Temperature",
                    "Temp"
                  ],
                  "lang": "en"
                }
              ],
              "settings": [
                {
                  "setting_name": "hot_temp",
                  "setting_values": [
                    {
                      "setting_synonym": [
                        "Hot"
                      ],
                      "lang": "en"
                    }
                  ]
                },
                {
                  "setting_name": "warm_temp",
                  "setting_values": [
                    {
                      "setting_synonym": [
                        "Warm"
                      ],
                      "lang": "en"
                    }
                  ]
                }
              ]
            }
          ],
          "availableToggles": [
            {
              "name": "auto_off",
              "name_values": [
                {
                  "name_synonym": [
                    "Auto off"
                  ],
                  "lang": "en"
                }
              ]
            }
          ]
        },
        "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,
        "currentModeSettings": {
          "temp_mode": "warm_temp"
        },
        "currentToggleSettings": {
          "auto_off": true
        }
      }
    }
  }
}

EXECUTE कमांड के उदाहरण

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

SetModes

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

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

SetToggles

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

अनुरोध
{
  "requestId": "6894439706274654520",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.SetToggles",
                "params": {
                  "updateToggleSettings": {
                    "auto_off": false
                  }
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Response
{
  "requestId": "6894439706274654520",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "currentToggleSettings": {
            "auto_off": false
          }
        }
      }
    ]
  }
}

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

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