Gracias por tu visita. Esta página solo está disponible en inglés.

Step 2: Enable your Video Skill on an Echo Device and Test (VSK FTV)

Now that you've set up a video skill and Lambda function, it's time to test your skill and observe the directives Alexa sends to your Lambda function. Ideally, use a real Echo Dot to test your skill. If you don't have an Echo Dot, you can also use the Alexa Skill Testing Tool (except in fr-FR, it-IT, and es-ES locales). Do not use a Fire TV Cube to test your skill.

Sample App Instructions

Even if you're working with the sample Fire TV app, you must still complete all the tasks described in this topic.

Step 2.1: Enable Your Skill on an Alexa Device

To test your skill on an Alexa-enabled device:

  1. Set up and register your Echo device using the same developer account you used to create your video skill. For info on setting up an Echo Dot, see Set Up Your Echo Dot. You will need the Alexa app on your smartphone to set up an Echo device. Note: Make sure both your Alexa smartphone app and Echo Dot are on the same wifi network.

    If you don't have an Echo device, log in to the Alexa Skill Testing Tool using the same developer account you used to create your video skill. Simply logging into this tool will create a virtual Echo device ("echosim_BETA") in the list of Amazon devices associated with your account.

  2. Open the Alexa smartphone app on your phone and sign in with the same developer account.
  3. Tap Devices Devices button in Alexa app in the bottom navigation bar and then select All Devices. Confirm that your Echo device appears in your app. (If you logged into the Alexa Skill Testing tool, the device will be called something like "echosim_BETA.")

    Your list of devices in the Alexa smartphone app
    Your list of devices in the Alexa smartphone app
  4. From the app's home screen, tap the menu button (upper-left corner) Menu button in Alexa app , then tap Settings, then tap TV & Video. Scroll down the list and identify any skills that say "Enabled" below them. If a skill says "Enabled," click on that skill and then click Disable Skill, so that no TV & Video skills are enabled.

    Disabling video skills
    Disabling video skills
  5. On the same screen shown above, tap Fire TV and ensure that the phrase "Link Your Alexa Device" appears on the firetv screen (this indicates that your device is not linked to a Fire TV). If your device is linked to a Fire TV, click Manage Devices and then Unlink Devices.

    Making sure your FireTV isn't already linked to any video skills
    Making sure your FireTV isn't already linked to any video skills

    Then click the back arrow at the top to return to the list of TV & Video skills.

  6. Scroll down the list and look for the video skill you created earlier (e.g., "Streamz"). It will appear at the bottom. Click the plus button next to your video skill.

    Video skills in the Alexa app
  7. After clicking your skill to view its details, click Enable Skill. A new page opens up in your browser that indicates your skill has been successfully linked.

    Enabling your video skill
    Enabling your video skill
  8. Close this notification window by clicking the X in the upper-left corner of your app. When you close the window, you will see another window noting that the Alexa app is looking for devices. Your Echo Dot's light ring will also start circulating in blue color.

    Alexa looking for devices
    Alexa looking for devices

    You should be prompted to link the skill to VSKTV. If so, go to the next step.

    If the Alexa app can't discover the video-skill-enabled device, see the Troubleshooting section below.

  9. Select the VSKTV radio button and click Continue.

    Linking your video skill to a device
    Linking your video skill to a device.

    "VSKTV" stands for "Video Skills Kit TV." (Video Skills Kit is another name used to refer to video skills for Fire TV apps.) VSKTV is the endpoint name the video skill API uses to deliver information to your Lambda function. You'll see this same in the directive code from Alexa, explained in a later step, View the Directives Sent to Cloudwatch, expressed as "endpointId": "VSKTV".

  10. The devices associated with your account appear. (If you logged in to Alexa Skill Testing Tool, you should see "echosim_BETA" as a device.) Select the check box next to your Echo device name and then click LINK DEVICES.

    Enabling the video skill on the Echo device
    Enabling the video skill on the Echo device

    After you link to your skill, you will see a screen (shown below) that says "Your linked Devices" — but it won't list any devices. There's currently a bug in the Alexa app that doesn't show the linked devices. In reality, your device is actually linked, and you will confirm this in the next step.

    Empty screen shown after linking a device
    Empty screen shown after linking a device

    You're done with configurations in the Alexa smartphone app. You can click the home button or just close the app.

  11. Now turn to your Echo (or if you're using the Alexa Skill Testing Tool, go to Alexa Skill Testing Tool and click and hold down the microphone button) and say, "Alexa, find Bosch" (or some other TV show or movie).

    Alexa responds, "Getting Bosch from [your skill name]."

    For example, if your skill name is "Streamz," Alexa will respond, "Getting Bosch from Streamz."

    Right now, you can search for any media listed on Gracenote. In later stages of the Video Skill API integration, you will customize the Lambda function to look specifically at your app's catalog rather than all of Gracenote.

    You're done with the skill setup in the Alexa app. You can click the Home button to go to the Home screen, or simple close the app.

Step 2.2: View the Directives Sent to Cloudwatch

When you say phrases to your Alexa-enabled device, these phrases get parsed for their meaning (through Alexa natural language services) and converted into directives. Directives are information blocks (formatted in JSON) sent to your Lambda for processing.

You can view the directives that Alexa sends to your Lambda function through Cloudwatch. Cloudwatch is an AWS service that collects monitoring and operational data for Lambda (and other services) in the form of logs, metrics, and events. Each time your Lambda function receives directives from Alexa, you can view the directives and other logs in Cloudwatch.

The core task in configuring a video skill is in understanding the directives Alexa sends and the expected actions Alexa expects your app to implement.

To view the directives received by your Lambda function in Cloudwatch:

  1. Navigate to Cloudwatch and click Logs in the left sidebar. By default, a log appears named after your Lambda function.
  2. Select the log containing your Lambda function. Then select the latest Log Stream for your logs. (Streams are just groupings for your logs, listed with the most recent on top.)
  3. In the previous section (Step 2.1: Enable Your Skill on an Alexa Device), you did a search for "Bosch." If you didn't do this search yet, do so now (so that you can view the directive in the logs).
  4. In the Lambda logs, to make the logs more scannable, you can select the Text radio button. Look for a log message that contains the Play directive as shown in the screenshot below. The directive should contain a payload with the name of the media title you searched for.

    Cloud Watch Log
    Cloud Watch Log

    The directive is expressed in JSON format. Here's the full code shown in the previous screenshot.

    {
      "directive": {
        "payload": {
          "entities": [
            {
              "type": "Video",
              "uri": "entity:\/\/provider\/program\/amzn1.p11cat.merged-video.858df979-c070-5533-9b1f-ecae15e9f139",
              "value": "Bosch",
              "externalIds": {
                "avc_vending_de": "amzn1.dv.gti.e0a9f6b7-ca7e-dc0c-c80e-f5801c580da8",
                "ENTITY_ID": "amzn1.p11cat.merged-video.858df979-c070-5533-9b1f-ecae15e9f139",
                "avc_vending_us": "amzn1.dv.gti.56a9f78c-4cfe-36f0-663d-9104c6dd6595",
                "asin_row_na": "B01M32CYV3",
                "asin_row_fe": "B01MCYRKGY",
                "avc_vending_jp": "amzn1.dv.gti.fea9f575-39fd-7a77-622b-a400f9b511f8",
                "asin_us": "B00S45ZDVE",
                "avc_vending": "amzn1.dv.gti.8cac011f-78c3-114b-b3f8-246a48f23ec0",
                "asin_roe_eu": "B01MCYRQHG",
                "imdb": "tt3502248",
                "ontv": "SH018737530000",
                "asin_gb": "B00IGQC64I",
                "asin_row_eu": "B01MDRHYR2",
                "asin_jp": "B014QF5HMU",
                "avc_vending_gb": "amzn1.dv.gti.10a9f690-1c9c-8c4e-5f67-2007ea0c5ceb",
                "tms": "SH018737530000",
                "cravetv": "m32254",
                "asin_de": "B00ZWBWZXW",
                "gti": "amzn1.dv.gti.10a9f690-1c9c-8c4e-5f67-2007ea0c5ceb",
                "ontv_de": "SH026719310000"
              }
            },
            {
              "type": "Video",
              "uri": "entity:\/\/provider\/program\/amzn1.p11cat.merged-video.a63315af-c728-56bc-90bb-0b8cbdcdad86",
              "value": "Bosch",
              "externalIds": {
                "ENTITY_ID": "amzn1.p11cat.merged-video.a63315af-c728-56bc-90bb-0b8cbdcdad86",
                "imdb": "tt2773036"
              }
            },
            {
              "type": "Video",
              "uri": "entity:\/\/provider\/program\/amzn1.p11cat.merged-video.d9ceb2e4-4802-557d-9461-24e19a438aad",
              "value": "Bosch",
              "externalIds": {
                "gvd": "GN2EAWZBASRC1PJ",
                "ENTITY_ID": "amzn1.p11cat.merged-video.d9ceb2e4-4802-557d-9461-24e19a438aad"
              }
            },
            {
              "type": "Video",
              "uri": "entity:\/\/provider\/program\/amzn1.p11cat.merged-video.75f0a242-6a4c-5912-97be-a06a3a0d5e05",
              "value": "Bosch",
              "externalIds": {
                "ENTITY_ID": "amzn1.p11cat.merged-video.75f0a242-6a4c-5912-97be-a06a3a0d5e05",
                "tms": "SH018739470000",
                "ontv_gb": "SH018739470000"
              }
            },
            {
              "type": "Video",
              "uri": "entity:\/\/provider\/program\/amzn1.p11cat.merged-video.ca646a58-8e1d-55f3-acc7-30245f8ac202",
              "value": "Bosch",
              "externalIds": {
                "gvd": "GN794XKHCHGKGJZ",
                "ENTITY_ID": "amzn1.p11cat.merged-video.ca646a58-8e1d-55f3-acc7-30245f8ac202"
              }
            }
          ]
        },
        "header": {
          "payloadVersion": "3",
          "messageId": "20d83e2d-6b20-4590-92ee-f252c2f607a9",
          "namespace": "Alexa.RemoteVideoPlayer",
          "name": "SearchAndPlay",
          "correlationToken": "cf662810-879e-4d8f-afb7-7488b778cd35"
        },
        "endpoint": {
          "cookie": {
    
          },
          "endpointId": "VSKTV",
          "scope": {
            "token": "452d41e7-8e4a-71ed-e8fb-dd31b126bf2e",
            "type": "BearerToken"
          }
        }
      }
    }
    
  5. Try several other searches for media titles and look in your Lambda logs for the results. Later, when you customize the Lambda code, your Lambda function will be able to act on the directives.

Note that your Lambda function also sends back a response to Alexa. Look for a row that says "Sending Discover response back to Alexa." The basic Lambda function sends back a confirmation response to Alexa that looks like this:

{
    "event": {
        "header": {
            "messageId": "5eb7cde5-023d-4022-aa12-458fd85f9a63",
            "name": "Discover.Response",
            "namespace": "Alexa.Discovery",
            "payloadVersion": "3"
        },
        "payload": {
            "endpoints": [
                {
                    "capabilities": [
                        {
                            "interface": "Alexa.RemoteVideoPlayer",
                            "type": "AlexaInterface",
                            "version": "1.0"
                        },
                        {
                            "interface": "Alexa.PlaybackController",
                            "type": "AlexaInterface",
                            "version": "1.0"
                        },
                        {
                            "interface": "Alexa.SeekController",
                            "type": "AlexaInterface",
                            "version": "1.0"
                        },
                        {
                            "interface": "Alexa.ChannelController",
                            "type": "AlexaInterface",
                            "version": "1.0"
                        }
                    ],
                    "endpointId": "VSKTV",
                    "description": "VSKTV is the default device used for video skills developed for Fire TV integrations",
                    "friendlyName": "VSKTV",
                    "manufacturerName": "Amazon"
                }
            ]
        }
    }
}

Although your Lambda function sends a response back to Alexa, your Lambda will never provide any voice feedback that would be directed to the user. For example, you can't customize the responses that Alexa says after a user says "Play Bosch." Alexa handles this communication exclusively. The only action you can perform is to find and play the media in your app (or take another appropriate action in your app.)

Notes on Directives

As noted, the general Lambda code returns results for all of Gracenote. If you search for the TV show "Supernatural," for example, you'll see the many different vendors where that media is available:

{
    "directive": {
        "payload": {
            "entities": [
                {
                    "type": "Video",
                    "uri": "entity://provider/program/amzn1.p11cat.merged-video.123456789",
                    "value": "Supernatural",
                    "externalIds": {
                        "avc_vending_de": "123456789",
                        "ENTITY_ID": "123456789",
                        "avc_vending_us": "123456789",
                        "provider1": "123456789",
                        "provider2": "123456789",
                        "provider3": "123456789",
                        "provider4": "123456789",
                        "imdb": "123456789",
                        "provider5": "123456789",
                        "ontv": "123456789",
                        "provider6": "123456789",
                        "provider7": "SHOW-supernatural",
                        "tms": "123456789",
                        "avc_vending_gb": "123456789",
                        "gti": "123456789",
                        "provider8": "123456789",
                        "provider9": "123456789"
                    }
                }
                ...
              ]
            }
          }
          }

(Note that in the above code, the providers and ID values have been made generic.)

In a later step, you will customize the results to be specific to your app's catalog.

Also note that Alexa's natural language processing intelligence does the work of parsing the user's utterances and converting them to the right directives. There are many different directives that the Lambda function looks for. These directives are identified by the name property in the header block. For example, the following is a SearchAndPlay directive:

{
  "directive": {
      "payload": {
        ...
        "header": {
                 "payloadVersion": "3",
                 "messageId": "56baf542-6dbb-4803-8387-8370757cff0b",
                 "namespace": "Alexa.RemoteVideoPlayer",
                 "name": "SearchAndPlay",
                 "correlationToken": "ddd36869-36b8-4d75-aa78-268610c5e8b6"
             }
          ...
        }
      }
    }

Finally, note that as you're browsing the Cloudwatch logs, you will probably see messages like this:

REPORT RequestId: f6ddb389-00d1-11e9-9bf9-b3d4aae40293
Duration: 59.08 ms
Billed Duration: 100 ms
Memory Size: 128 MB	Max
Memory Used: 31 MB

At this point, don't worry about billing for Cloudwatch services. The Free tier allows for 5GB of data without charge. The free tier covers the needed memory for most apps.

Troubleshooting

If you ran into trouble with any of the above steps, consult the section here. This section lists tips for troubleshooting problems.

Problem: The Alexa smartphone app cannot discover the VSKTV device. Instead you get an error that says, "Sorry, we could not find any devices to link." This is a problem related to discovery of smart home devices.

Solution: Try the following:

  1. Verify that you're in a supported country for video skills.
  2. Verify that your video skill is configured with the correct Lambda ARN.
  3. Verify that your Lambda has the correct video skill ID.
  4. Verify that your Lambda has the Alexa Smart Home trigger selected.
  5. Verify that your Alexa smartphone app and your Echo Dot (or other smarthome-enabled device) are on the same wifi network.
  6. Restart your Echo Dot and your smartphone app.
  7. Repeat all the steps in Step 2.1: Enable Your Skill on an Alexa Device. (For example, as per the instructions in Step A, make sure you log into https://alexa.amazon.com and forget all Smart Home devices. Also disable any skills in the app and re-enable them, etc.)
  8. After performing all these steps, if your video skill still doesn't work, consider creating a new video skill from scratch, following step 1 and step 2 all over again (creating a Lambda, etc.).
  9. If the issue still persists, see also Troubleshoot Smart Home Device Discovery Issues.
  10. Still not working? Submit a Contact Us case.

Problem: After linking to your skill, the Alexa app doesn't list your linked device.

Solution: After you link to your skill, you will see a screen that says "Your linked Devices" — but it won't list any devices. There's currently a bug in the Alexa app that doesn't show the linked devices. In reality, your device is actually linked. (This bug will be fixed in a future release.) If you say, "Alexa, Play Bosch" and Alexa responds, "Getting Bosch from [video skill name]," then the device is linked to your skill.

Next Steps

Up until this point, you've simply been observing the directives sent to your Lambda function. Now it's time to begin integration with your Fire TV app. The first step of Fire TV app integration is to integrate the Alexa Client Library into your Fire TV app. Go to the next step: Step 3: Integrate the Alexa Client Library.