Overview

This page describes the process involved to integrate and use Alexa Video Skill Kit (VSK) with RDK4 client devices. Video Skill API are a set of APIs that enable control of video and streaming services using an Alexa device.

With the Video Skill API, you can build skills that let customers control their entire video experience by voice. Customers can control video devices and consume video content without invoking a specific skill.

This page will help in understanding the steps to enable the video skill in Alexa developer console, configuration of related AWS service required to process the directives & to communicate with the device using an separate channel & client end configuration requirements.

Enable VSK in Alexa developer account

To create a video skill for the RDK device, we need to configure it through the Amazon Developer Console. We need to provide the skill information from developer account & the skill code hosted as an AWS Lambda function.

AWS Lambda is an Amazon Web Service  that handles requests from the Video Skill API and communicates with a device or video streaming service.

To enable communication between Lambda function & client device, the cloud or service should support the OAuth 2.0 authorization code grant type. You will need information about the authentication endpoint, client ID, and client secret to complete the video skill registration.

Register as an Amazon Developer and Create a Skill

To configure a new video skill, you need an account on the Alexa Skills Kit (ASK) developer console. After registration is completed

  1. Open the ASK developer console and login.
  2. Click the Create Skill button.
  3. Enter the Skill name . Note that your skill's name must not indicate that its functionality is limited. For example, you should not use "basic", "reduced" or "simple" in the name of your skill.
  4. Select the Default language.
  5. Under the Choose a model to add to your skill page, select Video, which is a pre-built model.
  6. Click Create Skill.
  7. Copy Your Skill ID to the clipboard. The ID will be in a format similar to the following: amzn1.ask.skill.1a2b55555-c325-1234-d56e-1f234d5e6a78

For more information on how to use the developer console, see Manage Skills in the Developer Console.

Next, you will create a Lambda function so that you can configure the Video Skill Service endpoint.

Create a Lambda Function

The code for VSK is hosted as a Lambda function on AWS. AWS Lambda is a service that lets you run code in the cloud without managing servers. The Video Skill API sends your skill requests. Your code parses the request, takes any necessary actions, and responds.

You need an AWS Identity and Access Management (IAM) Role with the AWSLambdaBasicExecutionRole policy attached. If you don't have this, complete the steps for To create an IAM role before completing the steps to create a Lambda function. If you already have a role with this policy, skip to To create a Lambda function.

To create an IAM role

Navigate to the Identity and Access Management (IAM) console.

  • Choose Roles, Create role.
  • Choose AWS service, then Lambda. Choose Next: Permissions.
  • Type "basic" in the filter box, then select AWSLambdaBasicExecutionRole. Choose Next: Tags.
  • Choose Next: Review.
  • Type a role name to identify this role, then choose Create role.

To create a Lambda function

Navigate to the AWS Lambda console.

  1. In the upper-right corner of the console, make sure you've selected:

    • N.Virginia for English (US) skills.
    • EU (Ireland) for English (UK) or German skills.

    Choosing the correct region helps prevent latency issues.

  2. Choose Create function.
  3. Choose Author from scratch.
  4. For Basic information:
    1. Type a name for your function.
    2. For Runtime, choose NodeJS.
    3. For Existing role, chose the role that you created in the previous procedure.
    4. Choose Create function.
  5. On the Configuration page, under Designer, choose Alexa Smart Home.
  6. Under Configure triggers, in the Application ID box, paste your skill ID.
  7. Choose Add, Save.
  8. Navigate back to the AWS Lambda console list of functions.
  9. Choose the function that you just created.
  10. Scroll down to the Function code section.
  11. Write or copy/paste the code in code editor. A reference implementation can be requested from amazon:


    For more information on using the reference implementation jump to the AWS Service configuration section

    This code provides a basic implementation involving single device, it supports device discovery & handling different directives coming from Alexa

    After the modifications are done, choose Save.

  12. Above the code editor, for Handler, leave the default name lambda_function.lambda_handler. A function handler is the main entry point for a Lambda function, and you specify it with the format fileName.entryPointFunctionName. For this example, the file name is lambda_function and the lambda_handler function is the entry point in this code.
  13. At the top of the page, copy the ARN for your Lambda function. You will use this value to finish configuring the video skill in the Alexa Skills Kit developer console. The ARN should be similar to the following: arn:aws:lambda:us-east-1:123456789012:function:myVideoFunction.

Finish Registering Your Skill in the Developer Console

  1. Navigate back to the Alexa Skills Kit developer console, then open your video skill.
  2. Under Video Skill Service endpoint, for Default endpoint box, paste the ARN from the Lambda function you created, then choose Save.

Provide Account Linking Information

Account linking is required in order to use the video skill from any client device, please refer below section to know about account linking (Step 1 & 2 should be enough to complete the account linking process).

https://developer.amazon.com/blogs/post/Tx3CX1ETRZZ2NPC/Alexa-Account-Linking-5-Steps-to-Seamlessly-Link-Your-Alexa-Skill-with-Login-wit

Test Your Skill

When your implementation is complete, and you've tested your Lambda function, you can functionally test your smart home skill.

  1. Make sure you have a smart home trigger added and enabled. To check this, go to the Lambda console, select your skill, and make sure you have an Alexa Smart Home trigger.
  2. Sign in to the Alexa app (available on Android, IOS or the web at https://alexa.amazon.com) with the same credentials as your developer account.
  3. Find your skill in the Alexa app. To do this, go to Skills, and tap Your Skills in the upper right corner of the All Skills page. Scroll to DEV SKILLS and find your skill.
  4. Click the ENABLE button to enable the skill, and you will be directed to account-link the skill to a device cloud account. If you are unable to complete account linking, make sure you are using valid credentials for the device cloud. Otherwise, it is likely there is an issue with account-linking information you provided in the developer console. For help with this, see Alexa: Debugging account linking in the developer forums. If you want to remove account linking later, you should disable your skill in the Skills tab.
  5. Return to the developer console, open your skill and on the Test page, move the slider to Yes. Use the Alexa Simulator to give Alexa commands using the utterances based on capabilities your skill supports. Make sure and test the skill with valid utterances and invalid ones, and in a variety of conditions, such as with a target device powered off. For a list of utterances and recommended test cases, see the Testing Guide. The test cases provided contain tests very similar to the tests used during skill certification testing. Running these tests and addressing issues before submitting for certification is an important step to get your skill published and available to customers as fast as possible. When issues are found during self-testing, usually they are much easier to fix, and you are more likely to pass certification the first time.
  6. When you are satisfied with your smart home skill's performance, you can, provide it for beta testing or submit it for certification.

Provide Launch Information

Without configuring the distribution pat, we would not be able to enable the skill from Alexa App or from Alexa web console.

Next move to the Distribution page. The information you provide here displays with your skill in the Alexa app and is required unless noted as optional.

  • Select Distribution, and on the English (US) Store Preview page, specify:

    • Public Name.
    • One Sentence Description
    • Detailed Description
    • Example Phrases
    • Small Skill Icon
    • Large Skill Icon
    • Keywords
    • Privacy Policy URL
    • Terms of Use URL.
  • Click Save and Continue

On the Privacy and Compliance page, answer the questions provided. For Testing Instructions, provide test account credentials.

  • Click Save and Continue
  • On the Availability page, check whether your skill is public, or for use by Alexa for Business Organizations.
  • Select the countries and regions you would like to distribute your skill
  • Click Save and Continue

Necessary AWS services for demo implementation

A reference code can be availed on request from Alexa Vimeo Demo code

The example using SQS (simple queue service) for communication between CPE and lambda service. AWS modules configuration gives brief overview on how to create and use SQS queues.


Client side configuration

Below configuration needed in the RDK device end for establishing the communication between CPE and cloud.

Configure the SQS service

Communication between lambda and CPE device is handled through SQS with current implementation, same SQS URL need to be configured in lambda as well as in the RDK client device.

$ vi /home/root/Alexa_SDK/Integration/VSKConfig.json
- Change the SQS URL that was configured in previous section

Configure AWS credentials

In order to use the AWS services, the access & secret should be configured from the client side. Current implementation is done by keeping the credentials from a well known location

$ vi /home/root/.aws/credentials
- Replace the values with your Access key Id & Secret.


References

https://developer.amazon.com/en-US/docs/alexa/video/understand-the-video-skill-api.html


  • No labels