स्मार्ट होम ऐक्शन बनाने का तरीका जानने की नई जगह, Google Home डेवलपर सेंटर में आपका स्वागत है. ध्यान दें: Actions कंसोल में कार्रवाइयां बनाना जारी रहेगा.

स्मार्ट होम एयर कंडीशनिंग यूनिट गाइड

action.devices.types.AC_UNIT - एयर कंडिशनिंग यूनिट, थर्मोस्टैट की तरह ही काम करती हैं. हालांकि, ये हीटिंग के साथ काम नहीं करतीं और हो सकता है कि ये तापमान के सेट करने की सेटिंग के साथ काम न करें.

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

डिवाइस की काबिलियत

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

ज़रूरी बातें

अगर आपके डिवाइस पर ये विशेषताएं और निर्देश लागू होते हैं, तो वे ज़रूरी हैं.

क्वालिटी के लिए ज़रूरी शर्तें

  • इंतज़ार का समय: 1,000 मि॰से॰ से कम या उसके बराबर होना चाहिए.
  • विश्वसनीयता: 97% से ज़्यादा या उसके बराबर होना चाहिए.

उदाहरण डिवाइस: सामान्य एसी यूनिट

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

SYNC जवाब का नमूना

अनुरोध करें
{
  "requestId": "6894439706274654512",
  "inputs": [
    {
      "intent": "action.devices.SYNC"
    }
  ]
}
जवाब
{
  "requestId": "6894439706274654512",
  "payload": {
    "agentUserId": "user123",
    "devices": [
      {
        "id": "123",
        "type": "action.devices.types.AC_UNIT",
        "traits": [
          "action.devices.traits.FanSpeed",
          "action.devices.traits.OnOff",
          "action.devices.traits.TemperatureSetting"
        ],
        "name": {
          "name": "Simple AC unit"
        },
        "willReportState": true,
        "attributes": {
          "availableFanSpeeds": {
            "speeds": [
              {
                "speed_name": "low_key",
                "speed_values": [
                  {
                    "speed_synonym": [
                      "Low",
                      "Slow"
                    ],
                    "lang": "en"
                  }
                ]
              },
              {
                "speed_name": "high_key",
                "speed_values": [
                  {
                    "speed_synonym": [
                      "High",
                      "Speed 2"
                    ],
                    "lang": "en"
                  }
                ]
              }
            ],
            "ordered": true
          },
          "availableThermostatModes": [
            "off",
            "cool",
            "fan-only",
            "on"
          ],
          "thermostatTemperatureUnit": "C"
        },
        "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,
        "currentFanSpeedSetting": "low_key",
        "thermostatMode": "cool",
        "thermostatTemperatureAmbient": 25,
        "thermostatTemperatureSetpoint": 20
      }
    }
  }
}

EXECUTE कमांड का नमूना

सेटफ़ैनस्पीड

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

अनुरोध करें
{
  "requestId": "6894439706274654518",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.SetFanSpeed",
                "params": {
                  "fanSpeed": "high_key"
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
जवाब
{
  "requestId": "6894439706274654518",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "currentFanSpeedSetting": "high_key"
        }
      }
    ]
  }
}

बंद है

कमांड पैरामीटर के बारे में ज़्यादा जानने के लिए, 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
        }
      }
    ]
  }
}

थर्मोस्टैट का तापमानसेट करने की जगह

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

अनुरोध करें
{
  "requestId": "6894439706274654520",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.ThermostatTemperatureSetpoint",
                "params": {
                  "thermostatTemperatureSetpoint": 22
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
जवाब
{
  "requestId": "6894439706274654520",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "thermostatMode": "cool",
          "thermostatTemperatureSetpoint": 22,
          "thermostatTemperatureAmbient": 25.1
        }
      }
    ]
  }
}

थर्मोस्टैटसेट मोड

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

अनुरोध करें
{
  "requestId": "6894439706274654522",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.ThermostatSetMode",
                "params": {
                  "thermostatMode": "cool"
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
जवाब
{
  "requestId": "6894439706274654522",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "thermostatMode": "cool",
          "thermostatTemperatureSetpoint": 22,
          "thermostatTemperatureAmbient": 25.1
        }
      }
    ]
  }
}

डिवाइस में गड़बड़ी

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