View on GitHub

Kodi Connect - Alexa

Integration between Kodi media center and Alexa voice assistant

Implements Alexa Video Skill
Example Youtube

Donation

If you want to buy me a beer :)

paypal

Working features

Steps to set up Kodi Alexa integration

Please follow the tutorial here

Please join Discord if you have any questions regarding setup, or in general
Discord link

Setup tutorial

  1. Create account on Kodi Connect page, to link your Kodi devices
    • You don’t need to use email and/or password related to any Amazon service.
  2. Install addon on your Kodi device

  3. Set up AWS and Amazon accounts
    • These are needed to have your Lambda function and Alexa skill hosted.
  4. Set up Lambda and Alexa skill
    • Deploy Lambda function to your AWS account (manually), and create Alexa skill (through KodiConnect automation)
  5. Link Kodi Device to Alexa Echo devices

Tutorial - Kodi Connect

Navigate to https://kodiconnect.kislan.sk

Click Register to move to registration page. Diagram

Enter your valid email address, and choose a password (currently it’s not possible to reset/change password).

You will also have to enter this password when linking Alexa Skill, and/or Google Assistant “Skill”. Diagram

Confirmation page will look like this, and you can close this window. Diagram

After receiving and open the confirmation email, click on the link, which will open the confirmation page. Diagram

Here just click on the link, which will take you to the Login page. Diagram

Enter email address and password which you entered on the registration page. Diagram

Choose a name for your Kodi instance. You can just enter Kodi, as this is unique to your account.

This is only relevant if you plan to use multiple Kodi instances. Diagram

A secret will be generated for your Kodi instance, which will be required for Kodi Connect Addon Diagram

Tutorial - Addon

Note: If updating Addon which introduces new features, you need to relink the Kodi device in Alexa app. Just unlink the device, and go through discovery again. This is because new versions of Addon now report supported features, to ensure backward compatibility, and seamless user experience. This should be the first step, if some of the features is not working for you.

Tutorial - Amazon Developer and AWS Account

You will need to have a valid Amazon Developer, and AWS account. These are free to sign up for.

For Amazon Developer, go to their page (developer.amazon.com), and click “Sign In”. From there, you can click “Create your Amazon Developer account”.

For Amazon Web Services (AWS), go to their page (aws.amazon.com), and click “Sign Up”. It will ask you for a credit card, but do not worry - AWS includes a “free tier”. The service that kodi uses, AWS Lambda, will allow up to 1,000,000 requests, per month, free. You can read more here: AWS Lambda - Pricing.

For your own safety, you are encouraged to look at Billing, and set limits/budgets, just in case. If you use other AWS Services, they may be subject to a cost.

Tutorial - Alexa skill and Lambda function

Region Select

This step is VERY IMPORTANT.

At the top right of the screen, there is a button next to your username, but before the “Support” button. It may have the name of a region. You must click it and select the correct Lambda Function Region according to your Alexa language.

Amazon provides a list of regions and languages. Here is a copy:

Skill language Endpoint Region Lambda Region Name AWS Region
English (US), English (CA) North America US East (N. Virginia) us-east-1
English (UK), French (FR), German, Italian, Spanish (ES) Europe, India EU (Ireland) eu-west-1
English (IN) Europe, India EU (Ireland) eu-west-1
Japanese, English (AU) Far East US West (Oregon) us-west-2

For example, I am located in Slovakia, but my Amazon Echo devices are set to “English (US)”. For this step, I would choose “US East (N. Virginia)”.

Setting up Alexa Skill - Part 1

  1. Open Kodi Connect page
  2. Log in if you’re not already
  3. On the Devices page, click the “Alexa skill”, which will redirect you to the Amazon website to log in (you need to use Amazon account that you have on your Echo devices).
  4. After signing in, you will be redirected back to Kodi Connect page, with a single button “Create skill”.
  5. Press it, and wait until “empty” Skill is created, and skill ID is presented.

Leave this window/tab open, as we will need to return back to it.
But copy the Skill ID, which should look something like this:

amzn1.ask.skill.2ba4b05b-3bd2-46b1-bbb5-15153ff41a48

Setting up AWS Lambda

  1. Click on the Services button at the top left. In the list, look for the “Compute” section, and click on “Lambda”.
  2. Click on the orange “Create Function” button.
  3. Make sure the “Author from scratch” tile is selected.
  4. Set the following options:
    • Name - “kodi”
    • Runtime - Node.js 12.x
  5. Under “Permissions” section expand “Choose or create an execution role”
  6. Ensure that “Create a new role with basic Lambda permissions” is selected
  7. Click the “Create Function” button.
  8. In the “Designer” section, click on the “+ Add trigger” button, then pick “Alexa Smart Home” from the dropdown.
  9. In the “Application ID” box, paste the “Skill ID”, that you’ve copied in the previous section (e.g. amzn1.ask.skill.2ba4b05b-3bd2-46b1-bbb5-15153ff41a48).
  10. Make sure “Enable Trigger” is checked. Click “Add” at the bottom right.
  11. Download the zip file with the Lambda function code from here
  12. Then in the same section, click on the name of your function (should be “kodi”).
  13. In the “Function code” section below, look for “Code entry type”. Click on this menu, and select “Upload a .zip file”.
  14. Click the “Upload” button, and select the zip file we downloaded earlier (e.g. kodi-alexa-video-package-1.0.zip).
  15. Click “Save” at the top right of the page, and wait for it to load.

Copy the function ARN that is in the upper right corner, which should look something like this:

arn:aws:lambda:<region_you_picked>:<long_number>:function:kodi

Setting up Alexa Skill - part 2

  1. Go back to the page from “Part 1”, or if you’ve closed it, Kodi Connect - Alexa Skill page
  2. Here enter the Lambda function ARN, that you’ve or you can copy from the AWS page, where you’ve created it (arn:aws:lambda:<region_you_picked>:<long_number>:function:kodi), and press “Link Lambda” button
  3. Give it a few seconds, and it will update the skill to be ready for use.

Tutorial - Enable Alexa skill

Navigate to https://alexa.amazon.com

Click Kodi Video under Your skills. Diagram

Click on Enable button, to start Skill account linking. Diagram

Enter your credentials for Kodi Connect. Diagram

Press Allow button, to authorize Amazon with Kodi Connect Server. Diagram

Confirmation page will open after that, which you can close, and return to previous page. Diagram

Device discovery will start automatically, which should not take more than few seconds. Diagram

After discovery, at least one Kodi instance should be visible in list. Pick one to connect it to the Echo. Diagram

Pick which Echo devices can control the Kodi instance. Diagram

This page just shows you the list of connected Kodi instances. Just click the last link, to go back to skill overview.
!!! Note: There is probably a bug in Alexa app, because after this step, there are no linked devices in the list, but if you continue to the next step, everything works as expected. Diagram

All is set up now, and you can start asking Alexa to play movies and/or tv shows on your Kodi instance. Diagram