其中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.com/r/xxxx
其中xxxx对应的是Google Home Action Project ID
其中Testing instructions需要填写亚马逊登录账号
Action 的相关设置已经完成,每修改一些设置需要重新TEST ,完成之后在Google Assistant -> Home control -> Devices 中添加刚刚设置的Action。
这里并没有详细介绍Firebase 中部署的函数,里面主要是AWS IOT的东西,可以详细看下文档。