स्मार्ट होम ऐक्शन बनाने का तरीका सीखने के लिए, Google Home डेवलपर सेंटर में आपका स्वागत है. ध्यान दें: आप Actions कंसोल में कार्रवाइयां बनाना जारी रखेंगे.
संग्रह की मदद से व्यवस्थित रहें अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.

स्मार्ट होम स्ट्रीमिंग बॉक्स गाइड

action.devices.types.STREAMING_BOX - यह डिवाइस, मीडिया और संगीत के लिए स्ट्रीमिंग सेवाएं चालू करता है. इनका इस्तेमाल अक्सर टीवी जैसे डिसप्ले के साथ किया जाता है. ये डिवाइस, डिसप्ले डिवाइस से अलग किसी कॉन्सटेंट से चलते हैं.

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

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

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

ज़रूरी विशेषताएं

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

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

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

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

उदाहरण डिवाइस: सरल स्ट्रीमिंग बॉक्स

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

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

अनुरोध
{
  "requestId": "6894439706274654512",
  "inputs": [
    {
      "intent": "action.devices.SYNC"
    }
  ]
}
जवाब दें
{
  "requestId": "6894439706274654512",
  "payload": {
    "agentUserId": "user123",
    "devices": [
      {
        "id": "123",
        "type": "action.devices.types.STREAMING_BOX",
        "traits": [
          "action.devices.traits.AppSelector",
          "action.devices.traits.MediaState",
          "action.devices.traits.OnOff",
          "action.devices.traits.TransportControl",
          "action.devices.traits.Volume"
        ],
        "name": {
          "name": "Simple streaming box"
        },
        "willReportState": true,
        "attributes": {
          "availableApplications": [
            {
              "key": "youtube",
              "names": [
                {
                  "name_synonym": [
                    "YouTube"
                  ],
                  "lang": "en"
                }
              ]
            }
          ],
          "transportControlSupportedCommands": [
            "NEXT",
            "PREVIOUS",
            "PAUSE",
            "STOP",
            "RESUME"
          ],
          "volumeMaxLevel": 11,
          "volumeCanMuteAndUnmute": true,
          "supportActivityState": true,
          "supportPlaybackState": 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,
        "currentApplication": "youtube",
        "currentVolume": 10,
        "isMuted": false,
        "activityState": "ACTIVE",
        "playbackState": "PAUSED"
      }
    }
  }
}

EXECUTE निर्देशों का नमूना

ऐप्लिकेशन इंस्टॉल

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

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

ऐप्लिकेशन खोज

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

अनुरोध
{
  "requestId": "6894439706274654520",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.appSearch",
                "params": {
                  "newApplication": "youtube"
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
जवाब दें
{
  "requestId": "6894439706274654520",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "currentApplication": "youtube"
        }
      }
    ]
  }
}

ऐप्लिकेशन चुनें

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

अनुरोध
{
  "requestId": "6894439706274654522",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.appSelect",
                "params": {
                  "newApplication": "youtube"
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
जवाब दें
{
  "requestId": "6894439706274654522",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "currentApplication": "youtube"
        }
      }
    ]
  }
}

बंद है

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

mediaबंद कैप्शनिंग बंद

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

अनुरोध
{
  "requestId": "6894439706274654524",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mediaClosedCaptioningOff"
              }
            ]
          }
        ]
      }
    }
  ]
}
जवाब दें
{
  "requestId": "6894439706274654524",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "playbackState": "PLAYING"
        }
      }
    ]
  }
}

mediaClosedcaptioningचालू

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

अनुरोध
{
  "requestId": "6894439706274654526",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mediaClosedCaptioningOn",
                "params": {
                  "closedCaptioningLanguage": "en"
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
जवाब दें
{
  "requestId": "6894439706274654526",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "playbackState": "PLAYING"
        }
      }
    ]
  }
}

MediaNext

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

अनुरोध
{
  "requestId": "6894439706274654528",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mediaNext"
              }
            ]
          }
        ]
      }
    }
  ]
}
जवाब दें
{
  "requestId": "6894439706274654528",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "playbackState": "FAST_FORWARDING"
        }
      }
    ]
  }
}

MediaPause

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

अनुरोध
{
  "requestId": "6894439706274654530",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mediaPause"
              }
            ]
          }
        ]
      }
    }
  ]
}
जवाब दें
{
  "requestId": "6894439706274654530",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "playbackState": "PAUSED"
        }
      }
    ]
  }
}

मीडिया पिछला

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

अनुरोध
{
  "requestId": "6894439706274654532",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mediaPrevious"
              }
            ]
          }
        ]
      }
    }
  ]
}
जवाब दें
{
  "requestId": "6894439706274654532",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "playbackState": "REWINDING"
        }
      }
    ]
  }
}

MediaResume

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

अनुरोध
{
  "requestId": "6894439706274654534",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mediaResume"
              }
            ]
          }
        ]
      }
    }
  ]
}
जवाब दें
{
  "requestId": "6894439706274654534",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "playbackState": "PLAYING"
        }
      }
    ]
  }
}

MediaStop

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

अनुरोध
{
  "requestId": "6894439706274654536",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mediaStop"
              }
            ]
          }
        ]
      }
    }
  ]
}
जवाब दें
{
  "requestId": "6894439706274654536",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "playbackState": "STOPPED"
        }
      }
    ]
  }
}

म्यूट करें

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

अनुरोध
{
  "requestId": "6894439706274654540",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.mute",
                "params": {
                  "mute": true
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
जवाब दें
{
  "requestId": "6894439706274654540",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "currentVolume": 10,
          "isMuted": true
        }
      }
    ]
  }
}

सेट वॉल्यूम

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

अनुरोध
{
  "requestId": "6894439706274654538",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.setVolume",
                "params": {
                  "volumeLevel": 11
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
जवाब दें
{
  "requestId": "6894439706274654538",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "currentVolume": 11,
          "isMuted": false
        }
      }
    ]
  }
}

डिवाइस की गड़बड़ियां

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