admin管理员组

文章数量:1530842

1. 开发过程阅读的文档
  • Integrating Smart Home Devices with the Google Assistant , 视频介绍了整个开发Google Assistant Action的过程

  • 参考谷歌官方提供的 Smart Home Washer,可以尝试把Demo跑起来,熟悉下整个流程。其中涉及到Firebase服务,其实和AWS Lambda类似,而Firebase更强大,集成了更多功能。

    其他的一些和aws结合的资料

  • Developing-a-smart-home-application-for-Google-Assistant 该文章描述了Google Assistant 如何集成 AWS IOT

  • Make use of an AWS Lambda function as a fulfillment for a Google Assistant enabled device

  • Host your Google Action on AWS Lambda

    Google IOT Smart Home 文档

  • google iot 官方文档

  • iot-smart-home 官方Demo

  • actions smarthome文档

  • Smart Home Washer

  • Firebase CLI 参考 , 必须用VPN专线,才可以

  • Actions on google - account linking StackFlow 上的答案

  • 注册谷歌云服务,需要注意的是没有开通中国区,添加信用卡的时候必须是单标单币信用卡才可以

2. 创建Smart Home Action


其中fulfillment URL

https://<your-cloud-functions-url>/fulfillment
而your-cloud-functions-ur是 Firebase 中可以看到的 

Firebase -> Functions ->Dashboard 可以看到your-cloud-functions-url

fulfillment和Firebase中部署的函数相关,比如部署index.js函数的入口

exports.smarthome = functions.https.onRequest(app);

其中fulfillment指的就是smarthome

Firebase 部署的函数主要是调用AWS IOT实现和第三方从设备的控制,协议主要是MQTT。

然后进行firebase部署,必须进行路由器翻墙才可以部署成功

firebase init  // 初始化,一般不需要

firebase login // 账号登录

firebase use --add  // 选择部署到的项目

firebase deploy  //部署到云端

Account linking


这里主要和亚马逊的账号关联,需要在Login with Amazon中新建Profile,然后可以看到 Client ID 和 Client Secret

然后需要设置下Allowed Return URLs,由https://oauth-redirect.googleusercontent/r/xxxx

其中xxxx对应的是Google Home Action Project ID

其中Testing instructions需要填写亚马逊登录账号

Action 的相关设置已经完成,每修改一些设置需要重新TEST ,完成之后在Google Assistant -> Home control -> Devices 中添加刚刚设置的Action。

这里并没有详细介绍Firebase 中部署的函数,里面主要是AWS IOT的东西,可以详细看下文档。

总结
  1. 介绍Action中一些常用设置的参数,需要注意的是 fulfillment / Authorization URL / Token URL参数的设置
  2. Firebase 部署必须路由器翻墙才可以,电脑翻墙行不通
  3. Google Assistant Action 和 Amazon Alexa Skill 有与异曲同工之处,而Google的文档并没有Amazon 详细,遇到问题可以参考下Amazon文档

本文标签: AssistantGoogleActionLight