How to Control Your Kodi Media Center with an Amazon Echo

how-to-control-your-kodi-media-center-with-an-amazon-echo photo 1

Remote controls are so 1950. If you have a Kodi media center and an Amazon Echo, you can play all your favorite movies and shows with a well-placed voice command…if you’re willing to do a little setup.

The Amazon Echo is, in our opinion, one of the coolest parts of a smart home. Controlling your lights, blinds, and TV with your phone is cool, but controlling them with your voice is truly the future. I was skeptical, but quickly became impressed–and hungry for more.

RELATED ARTICLEShow-to-control-your-kodi-media-center-with-an-amazon-echo photo 2How to Set Up and Configure Your Amazon Echohow-to-control-your-kodi-media-center-with-an-amazon-echo photo 3How to Control Your Smart Home Products with the Amazon Echo

Being able to turn my TV on is cool, but what I really wanted was to be able to control my media center. I wanted to be able to say “Play the next episode of Friends” and have it search my library, see what I watched last, and start playing the subsequent episode. And after a bit of searching, I found that one enterprising programmer named Joe Ipson had already done just that.

This takes a little bit of setup, and it looks very intimidating at first. You’ll need to create a web server, push some code from GitHub, and do a little work from the command line, but you don’t need to be a programmer to get this up and running. Ipson has done almost all the heavy lifting, and you just need to copy his code, edit a few parts, and upload it to the right place. If you follow this guide to the letter, you should be up and running in no time.

Step One: Prepare Your Kodi Web Server

In order for this to work, Kodi will need to have a server accessible from the web. Thankfully, this is built into Kodi, though you may need to forward some ports on your router and perform some other tasks before it works smoothly.

Open Kodi on your media center and head to System > Services > Web Server. Enable the web server if it isn’t enabled already, and give it a username and password. Be sure to use a password you don’t use for any other service.

how-to-control-your-kodi-media-center-with-an-amazon-echo photo 4

You will also need the public IP address for your home. However, since this can change, we highly recommend signing up for a dynamic domain name using a service like Dynu. Follow our guide here before continuing if you don’t already have one.

how-to-control-your-kodi-media-center-with-an-amazon-echo photo 5

Lastly, you’ll need to set up port forwarding for your Kodi box. This will differ from router to router, but you can check out our guide here for more information. Just forward any external port to the local IP address of your Kodi box (in my case, 192.168.1.12) and local port (8080 by default).

NOTE: while Kodi’s local port is 8080 by default, you can change it to whatever you want–or you can forward it to a different external port to make sure there are no complications (since other apps may ask for port 8080). I’m using 8080 in this tutorial, but if you use something different, just replace all instances of port 8080 with the external port you choose here.

how-to-control-your-kodi-media-center-with-an-amazon-echo photo 6

If all goes well, you should be able to access Kodi’s web interface by opening a web browser and typing in:

my.dynamic-domain.com:8080

where my.dynamic-domain.com is the URL of your dynamic domain, and 8080 is the port you set in Kodi. If that doesn’t work, make sure that Kodi, your dynamic domain, and your port forwarding were all set up properly.

RELATED ARTICLEShow-to-control-your-kodi-media-center-with-an-amazon-echo photo 7How To Easily Access Your Home Network From Anywhere With Dynamic DNShow-to-control-your-kodi-media-center-with-an-amazon-echo photo 8How to Forward Ports on Your Router

Step Two: Set Up Heroku

Next, you’ll need to sign up for an account at Heroku, a free platform for creating cloud-based apps. We’ll use this to create a web server that connects our Echo with our Kodi media center.

Head to Heroku’s home page and click the “Sign Up” button in the upper right-hand corner. Type in your name and email. For your primary development language, feel free to choose “I’m not a developer”.

how-to-control-your-kodi-media-center-with-an-amazon-echo photo 9

Next, download and install the Heroku Toolbelt on your computer from this page. This process should work on Windows, OS X, and Linux, though we’ll be using Windows for our example. Choose the “Full Installation”.

how-to-control-your-kodi-media-center-with-an-amazon-echo photo 10

After installing, press Windows+X on your keyboard and choose “Command Prompt”. (Mac and Linux users will want to open their respective Terminal apps). Then, run the following command:

heroku --version

This should either return a version of Heroku, or finish the Heroku Toolbelt installation process.

how-to-control-your-kodi-media-center-with-an-amazon-echo photo 11

If everything looks good, run the next command to log into Heroku from the command line:

heroku login

Type in the email address you used to create your Heroku account and press Enter. Then, type your Heroku password, and press Enter. It will return a successful login message if all goes well.

how-to-control-your-kodi-media-center-with-an-amazon-echo photo 12

Step Three: Upload Your Code

Next, we’re going to create a new app within Heroku. Run the following command:

heroku create

Heroku will create a new app project for you with a random generic name. (You could give it your own name, but you can’t use a name anyone else has used before–so I just use the random one it gives me). It will give you two URLs containing this name. Write them down now; you’ll need them later.

how-to-control-your-kodi-media-center-with-an-amazon-echo photo 13

Next, create a new folder on your computer where you’ll store the code for this project. I put mine in my Documents folder, and called it “Code”–so I know exactly where all my little projects like this go.

Once you’ve done that, CD into that folder with this command, replacing the folder path with your own:

CD C:\Users\Whitson\Documents\Code\

Then, run:

git clone https://github.com/m0ngr31/kodi-alexa.git

This will clone all of Ipson’s code for this project into a new folder called kodi-alexa.

how-to-control-your-kodi-media-center-with-an-amazon-echo photo 14

Next, CD into that kodi-alexa folder with:

CD kodi-alexa

Then run the following command to add your Kodi IP address (or dynamic domain), Kodi webserver port, Kodi webserver username, and Kodi webserver password:

heroku config:set KODI_ADDRESS='my.dynamic-address.com' KODI_PORT='8080' KODI_USERNAME='kodi' KODI_PASSWORD='mysuperlongpassword' --app random-name-88888

Obviously, replace the address, port, username, and password, and random app name with the ones you set up in Kodi back in step one.

how-to-control-your-kodi-media-center-with-an-amazon-echo photo 15

Lastly, run the following commands, pressing Enter after each one:

git remote add heroku https://git.heroku.com/random-name-88888.git

(…replacing random-name-88888 with the name of your project.)

git push heroku master
heroku ps:scale web=1 --app random-name-88888

Git will go through the process of uploading your code to Heroku and starting the app. After you enter the final command, you’ll see a brief output like “Scaling dynos… done” as confirmation.

When everything is finished, your app is in place on your web server–you just need to point your Echo to it.

how-to-control-your-kodi-media-center-with-an-amazon-echo photo 16

Step Four: Create Your Amazon “App”

To connect Ipson’s code with our Echo, we’ll need to create an “app” for Alexa. This app won’t be distributed to anyone, it’ll just be in “testing mode” forever, connected to your own Amazon account for use with your Echo.

To start, set up a free Amazon Developer account. Head to this page, log in with your Amazon account, and register for a developer account. Fill in the required fields, agree to the terms, and say “No” when you’re asked if you’re going to monetize your apps.

how-to-control-your-kodi-media-center-with-an-amazon-echo photo 17

Once logged in, head to “Apps & Services” in the top toolbar, then select “Alexa” from the sub-toolbar. Click the “Get Started” button under “Alexa Skills Kit”.

how-to-control-your-kodi-media-center-with-an-amazon-echo photo 18

Next, click the “Add a New Skill” button.

how-to-control-your-kodi-media-center-with-an-amazon-echo photo 19

Give your skill a name–I called mine “Kodi”–and give it an invocation name. This is what you’ll say when you want to invoke a command. For example, my invocation name is also “the living room”, which means I’ll have to say “Ask the living room to…” to give Alexa commands for my media center.

In my experience, long invocation names work better than shorter ones. I used “Kodi” for awhile (“Ask Kodi to…”) but Alexa occasionally had trouble finding movies. I couldn’t tell you why, but longer invocation names like “the living room” work almost flawlessly for me. So try choosing something with a few syllables.

Click Next when finished.

how-to-control-your-kodi-media-center-with-an-amazon-echo photo 20

Click “Add Slot Type” button in the middle of the next window.

how-to-control-your-kodi-media-center-with-an-amazon-echo photo 21

Create a new slot called SHOWS , and list some of your TV shows in the box, one per line–I have about 20-30 shows in mine. You don’t need to add every show in your Kodi library, but it’s good to have a decent number of examples. This will help Alexa recognize the shows you dictate to it. Click OK when finished.

how-to-control-your-kodi-media-center-with-an-amazon-echo photo 22

Repeat this process with two more Slot Types: MOVIES and MUSIC . (If you don’t have a music library, create the slot type anyway–Ipson’s code requires it–and just stick a few random artist names in there. It won’t cause any problems.)

how-to-control-your-kodi-media-center-with-an-amazon-echo photo 23

NOTE: If you find that 20-30 random items isn’t enough for Alexa to recognize your commands, try this slot generator, also from Joe Ipson. It’ll scan your library and create a list of every movie, show, and artist on your Kodi box, to ensure Alexa gets it right every time. If you’d prefer not to enter your information into something hosted on his server, you can always clone the Github code yourself and create your own version on Heroku, just like we did in Step Three above.

When you’ve created all three Slot Types, head back to the folder you extracted from GitHub on your PC. Find the alexa.intents and alexa.utterances files. Open them both with an app like Notepad++.

how-to-control-your-kodi-media-center-with-an-amazon-echo photo 24

Select all the text in the alexa.intents file and paste it into the “Intent Schema” box on the Amazon Developer website. Repeat this process with the alexa.utterances file, placing the text in the “Sample Utterances” box.

When you’re done, click Next.

how-to-control-your-kodi-media-center-with-an-amazon-echo photo 25

On the next page, choose “HTTPS” for the “Endpoint” box and paste in the Heroku URL for your app that you wrote down at the beginning of step two ( https://random-name-88888.herokuapp.com/ ). Choose “No” for Account Linking and click Next.

how-to-control-your-kodi-media-center-with-an-amazon-echo photo 26

On the next page, select “My development endpoint is a subdomain of a domain that has a wildcard certificate from a certificate authority”. Click Next.

how-to-control-your-kodi-media-center-with-an-amazon-echo photo 27

You shouldn’t need to add any information on the Test page, though you can test certain aspects of the code if you know what you’re doing. Otherwise, click Next.

On the Publishing Information page, fill out the required fields–but don’t worry too much about what you put in, since you won’t be submitting this app for certification. You’re the only one who will be using this app. (Here is a 108×108 icon and a 512×512 icon for you to use.) Click Next when finished.

how-to-control-your-kodi-media-center-with-an-amazon-echo photo 28

On the final page, choose “No” for both privacy questions and check the Complicance box. Click the “Save” button when you’re finished. Do NOT click the “Submit for Certification” button.

how-to-control-your-kodi-media-center-with-an-amazon-echo photo 29

Step Five: Test Your New Commands

If all went well, you should be able to test your new commands now. Make sure your Kodi box is turned on, and try saying something like:

“Alexa, ask the living room to play season one, episode one of Friends”

(…obviously replacing that with an episode and show that you have on your machine.) It may take Alexa a moment, but hopefully she should respond and start playing the show in question. If you get an error and the episode doesn’t play, go back and make sure you did everything properly.

NOTE: Due to the limitations of Heroku’s free tier, Alexa may sometimes give you an error that says “The requested skill took too long to respond”, even though the episode starts playing anyway. In my case, this only happened on my Raspberry Pi, or sometimes when my Heroku app was sleeping. Your mileage may vary, but in all our tests, this was either a minor issue or a non-issue entirely.

You can ask Alexa if you have any new episodes, ask her to play the next episode of a show, or even use her to control Kodi, as inefficient as it may be (“Alexa, ask the living room to pause,” “Alexa, ask the living room to navigate down,” etc.). Check out the alexa.utterances file to see all the things Alexa can do with this integration. If you ever want to add a new phrase that corresponds to one of those functions, just log back onto your Amazon Developer account and add it to the list we pasted in step four.

If you have multiple Kodi boxes, you can do this for each of them–you just need to create a new app on both Heroku and Amazon for each (and give each a different invocation name). For example, I have a second app controlling the Raspberry Pi in my bedroom that lets me “ask the bedroom” to play new shows.


This isn’t flawless, and it wasn’t without its growing pains when I first set it up. But once you get it working, it’s easily one of the coolest things you can do with your Amazon Echo, at least in my opinion. Now I can start watching TV while cooking in the kitchen, or when my remote’s batteries are dead. This is the kind of power Amazon Echo was designed to have, and even though it takes a bit of work, it’s well worth it.

Having trouble? Check out this thread on the Kodi forums, as well as the original GitHub page, or drop a line in our comments below.

Title image from doomu/Bigstock and Amazon.

More stories

How to Save All Your Current Tabs in Chrome for Reading Later

Chrome allows you to open tabs from your last browsing session when you open the browser. However, what if you want to save your current set of tabs to re-open at any time? Chrome doesn’t provide a way to do that natively, but there is an easy workaround using bookmarks.

How to Open a Recently Closed Tab in Safari for iOS

That feeling you get when you close the wrong browser tab by accident is no fun. Fortunately, Safari for iOS, like most modern browsers, provides a way to recover from your little mishap. You just have to know where to look.

How to Connect to a VPN on Android

Previously, we have covered what VPNs are and how you can easily connect to them in Windows. Android also supports VPNs – if you have an Android phone or tablet, you can easily connect it to a VPN.

Should You Change Your Passwords Regularly?

Yes, there are some situations where you’ll want to regularly change your passwords. But those will probably be the exception rather than the rule. Telling typical computer users they need to regularly change their passwords is a mistake.

Why Is Printer Ink So Expensive?

Printer ink is expensive, more expensive per drop than fine champagne or even human blood. If you haven’t gone paperless, you’ll notice that you’re paying a lot for new ink cartridges — more than seems reasonable.