文档

Amazon Alexa语音平台接入配置指导

更新时间:
一键部署

本文档介绍如何接入Amazon Alexa语音平台,并配置Alexa Skill服务。

Amazon Alexa

一、厂商账号/资源准备

alexa控制台账号:https://developer.amazon.com/alexa/console/ask

amazon云账号:https://console.aws.amazon.com/lambda/home 需要填写注册信息、绑定银行卡(可尝试中国内地或VISA信用卡绑定)。

image.png

控制台前期准备:请参考自有App定制Amazon Alexa技能

飞燕控制台申请的appKey:android、ios。

alexa请求白名单域名(在授权、控制、查询请求阶段访问三方云服务的各域名白名单):

  • 如果是自有账号体系在控制台"自有账号体系"tab填写oAuth相关配置,需要提供oAuth相关的域名,如果厂商提供的oAuth域名在厂商内部有多级域名跳转需要提供多级域名,如提供oAuth功能的a域名内部跳转到b a->b->c 需要同时提供a、b、c。

app英文名:厂商app英文名如 Cloud Intelligent。

app icon图标链接:矢量图,需提供图标URL链接,如无法提供请联系阿里同学。

厂商三方账号:厂商app的登录账号、密码,在测试阶段需要关联alexa测试,厂商提供的账号需要绑定设备用于测试。

二、console控制台填写

1、创建skill

image.png
  1. 注册Alexa账号,并登录Alexa开发控制台

  2. 创建新的SKILL,输入名称之后选择SmartHome,Skill name建议使用app英文名称。

2、skill基本信息填写

image.png
  1. 选择V3版本的payload版本。

  2. 填写AWS Lambda函数的ARN: 需要先完成lambda函数的创建再返回来填写此处,default endpoint建议填弗吉尼亚区域的lambda函数。

2、MODELS信息

image.png

3、填写AccountLlink信息

image.png
  1. Alexa获取飞燕平台authCode。

https://open-living.iot.aliyun.com/account/oauth2/authorize
  1. Alexa获取access_token、refresh_token。

https://open-living.iot.aliyun.com/account/oauth2/token

image.png
  1. 飞燕AppKey:填写自有app 安卓的appkey。

  2. 飞燕AppKey对应的密钥:填写对应的APPsecret。

  3. 选择身份凭证来源:必须选择 "Credentials in request body"。

  4. scope: 默认值alexa。

  5. 域名白名单,包括两部分:

    1. 如果厂商为自有账号体系,还要提供厂商域名列表,包括账号认证相关的域名。

    2. 阿里飞燕平台域名列表,包括如下:

open-living-beta.iot.aliyun.com
open-living-sh.aliyuncs.com
open-living-sg.aliyuncs.com
open-living-eu.aliyuncs.com
open-living-eus.aliyuncs.com
openaccount-login.aliyun.com
openaccount-sg.aliyun.com
openaccount-frankfurt.aliyun.com
openaccount-us-easth1.aliyun.com
open-living.iot.aliyun.com
openaccount-os30.aliyun.com

image.png
  1. 超时时间,默认值可以填7200。

  2. Alexa提供的三方访问Alexa的域名,记录下来备用,飞燕平台请求时会通过此名单过滤。

4、PERMISSION信息

记录下Alexa平台生成的ClientId、ClientSecret备用。

image.png

三、lambda函数计算填写

1、部署Alexa lambda函数

    1. 登录AWS 进入 lambda (弗吉尼亚北(北美), 俄勒冈(远东),爱尔兰(欧洲) 三个区域)https://console.aws.amazon.com/lambda/home

    2. 在三个区域各创建一个Lambda函数,运行时选择Nodejs 任意版本,建议创建的lambda函数名以app名+区域命名,如:XXXXXXVirginiaLambda 。

      图片.png
    3. 解压附件中的lambda函数三个区域的各自的部署包,上传部署包脚本。

      图片.png
    4. 添加Alexa触发器,填写进入skillId(从Alexa url 中或者 SKILL 界面中可以获取到),需要添加两个触发器,Alexa Smart Home 和Alexa Skills Kit。

image.pngimage.pngimage.png图片.png

e. 启用触发器: 触发器添加后默认是启动状态,请保持启动状态。

2、 学会查看lambda函数日志

  1. 登录到lambda函数日志查看控制台https://console.aws.amazon.com/cloudwatch/home

image.png

  1. 选择对应区域查看对应区域日志文件,alexa访问就近分配到三个不同的区域,请查看对应区域日志。

  2. 进入CloudWatch Logs页面搜索详情。

    image.png

四、飞燕平台功能配置(请联系阿里同学完成)

填写完上述参数之后还需要联系阿里同学完成飞燕平台的功能配置。

请提供上述"厂商账号/资源准备"中的内容给阿里同学完成配置。

五、测试验证

1、添加测试用alexa白名单账号

  1. 下载Amazon Alexa app:以安卓为例,需要准备一台可以下载Google应用商店Google Play的手机,搜索Amazon Alexa App 下载Alexa应用程序。

  2. 使用邮箱注册alexa app账号。

  3. 添加alexa技能测试白名单:登录alexa控制台 https://developer.amazon.com/alexa/console/ask 在Distribution-->Availability-->Beta Test 下添加你的Alexa App账号,收到invite URL后用测试账号注册并登录到Alexa控制台完成确认。

  4. 通过飞燕自有app绑定设备。

  5. 用测试账号登录Amazon Alexa App 搜索创建的新技能,完成技能账号关联。

  6. 在alexa app上发现设备列表,观察是否能发现账号下的设备列表。

  7. 通过app控制设备,观察是否能完成对应的指令。

  8. 通过app或者Alexa音响语音控制设备,观察是否能完成对应的指令,如"Alexa,Trun On Light"。

六、填写厂商审核信息

1、厂商完成审核前资料填写

1. 填写所有的运营发行文案

说明

下文中是以云智能app为例填写的,public Name和文中云智能“Cloud Intelligence”应该修改为各自的应用英文名。

image.png

Public Name(云智能Cloud Intelligence为例):

Cloud Intelligence

One Sentence Description:

With the Cloud Intelligence skill for Alexa, you can control a wild range of smart devices with your voice.

Detailed Description:

With the Cloud Intelligence skill for Alexa, you can control a wild range of smart devices with your voice, including lights, switches, sockets,   humidifiers and so on.
Here's a step by step guide:
1. Download Cloud Intelligence app from Google Play or App Store.
2. Turn on your smart devices and connect them with "Cloud Intelligence" app. Rename your device, such as my light.
3. Type in or search "Cloud Intelligence" in Alexa app. Click ENABLE TO USE and login to link your Cloud Intelligence account..
4. Say: "Alexa, discover devices". Keep waiting utill you hear "Discover is completed".
5. Now, you can control your smart devices with your voice.
You can say:
Alexa, turn on the light.
Alexa, turn off the light.
Alexa, dim the light.
Alexa, brighten the light.
Alexa, set the light to 50 percent.
Alexa, set the light to red.
Alexa, set the light warm white.

image.png

Example Phrases:

More:保持原样

Alexa, turn on the light.

Alexa, turn off the light.

Alexa, dim the light.

上传小图标

上传大图标

Smart Home

image.png

Keywords:smart,home,life,lightskill

Privacy Policy URL:

说明

协议的文件URL需要用户自行提供不能直接用下面的链接,下面的链接仅作为内容参考。

https://g.alicdn.com/ilop-fe/service-agreement/legal-statement-and-privacy-right-policy-en.html

Terms of Use URL:

说明

协议的文件URL需要用户自行提供不能直接用下面的链接,下面的链接仅作为内容参考。

https://g.alicdn.com/ilop-fe/service-agreement/software-license-and-service-agreement-en.html

2. 填写所有隐私信息

image.png

勾选的内容可根据各厂商实际情况勾选。

image.png

Testing Instructions(仅作为参考),Cloud Intelligence-->需要替换为厂商appName:

Here’s a setup guide:
1. Download 'Cloud Intelligence' app on Google Play or iOS App Store.
2. Connect your smart device with 'Cloud Intelligence' app, and give your device a nick name, like 'my light'.
3. Search and enable the 'Smart Home' Skill in 'Alexa' app, with your username and password of 'Cloud Intelligence' app. 
(test account login id is "ilop****@163.com", password is "tb1234")
4. Say 'Alexa, discover devices', to let Alexa find all your smart devices.
5. Till now, setup is done. You can start your smart home experience now! You can try: 

"Alexa, turn on/off my light"
"Alexa, brighten/dim my light"
"Alexa, set my light to warm white"

3. 填写发行区域,一般选择默认全部区域

image.png

4. 检查是否有遗漏

image.png

2、提交审核

1. 确认已完成测试验证

参考"测试验证"步骤。

2. 提交审核

提交审核:

image.png

附录

lambda代码部署包。

aigo.zip

  • 本页导读 (0)
文档反馈