简体   繁体   English

如何在我的智能灯泡上添加对Google Home应用的支持?

[英]How to add support for google home app to my smart bulb?

We have built a smart bulb which we want to control using the Google Assistant as well(apart from our Android and iOS apps). 我们已经构建了一个智能灯泡,除了我们的Android和iOS应用之外,我们还希望使用Google助手进行控制。 I searched for this and figured out that we need to implement Google Weave protocol on our bulbs for it to be controllable via Google Assistant. 我进行了搜索,发现需要在灯泡上实现Google Weave协议,才能通过Google Assistant对其进行控制。 What I don't understand is how can I add this to Home app so that users can add it as smart bulb to Home app and control via Google Assistant? 我不知道如何将其添加到家庭应用程序中,以便用户可以将其作为智能灯泡添加到家庭应用程序并通过Google助手进行控制?

You can make the link between home and your system via api.ai 您可以通过api.ai在家庭和系统之间建立链接

The key concepts are here . 关键概念在这里 This site creates JSON files which are loaded into the Google Actions API. 该网站创建了JSON文件,这些文件已加载到Google Actions API中。 Once approved you have a keyword or phrase which when said into Google home opens interactions with your system via webhooks. 获得批准后,您将拥有一个关键字或短语,当您在Google主页中说出这些关键字或短语时,便可以通过网络钩子与您的系统进行交互。

For anyone facing the same problem, found my answer here: https://developers.google.com/actions/smarthome/ 对于遇到相同问题的任何人,请在这里找到我的答案: https : //developers.google.com/actions/smarthome/

At the time I posted my question, this page either did not exist or I did not find it. 在我发布问题时,此页面不存在或找不到。

This page points to sample implementation for smart home device. 此页面指向智能家居设备的示例实现。 Here is the link to github repo: https://github.com/actions-on-google/actionssdk-smart-home-nodejs It also has detailed instructions on how to run the code. 这是指向github存储库的链接: https : //github.com/actions-on-google/actionssdk-smart-home-nodejs它还包含有关如何运行代码的详细说明。

To summarize, we need provide following actions.json(which points to our server which fulfills 3 intents SYNC, QUERY and EXECUTE) file as our Action Package. 总而言之,我们需要提供以下action.json(指向我们的服务器,该服务器满足SYNC,QUERY和EXECUTE 3个意图)文件作为Action Package。

{
  "actions": [{
    "name": "actions.devices",
    "deviceControl": {
    },
    "fulfillment": {
      "conversationName": "automation"
    }
  }],
  "conversations": {
    "automation" :
    {
      "name": "automation",
      "url": "https://<our server which provides fulfillment for SYNC, QUERY and EXECURE intents>"
    }
  }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM