Control Kodi by Voice With Tasker and Yatse

It was only a couple weeks ago that I stumbled upon Tasker thanks to my huge facination with Home Automation. For days I had been watching videos of people talking to their phone being able to control their home lights, stereo’s, appliances and more. After spending far to many hours being fascinated I finally stumbled across a video that had shown a user speaking into his Android smartphone that ended up controlling his Kodi HTPC. I was fascinated to say the least and having dabbled into Tasker itself I set out wondering how to do it.

I didn’t have much luck finding a definitive tutorial but through a couple hundred Google searches I picked up bits and pieces of how to do it and was surprised at how easy it actually was. I’ve seen a bunch of questions surrounding this exact task in the reddit community and decided I would try my hand at putting together a tutorial to at least get started.

Contents

What You’ll Need To Get Started

DISCLAIMER: I’m not a Tasker expert by any means and have just recently discovered it. With that said I take no responsibility for anything bad that happens to your device (even though nothing should). This is just a simple tutorial showcasing what I did to get this working in harmony.

The two most important aspects of this is obviously a dedicated Kodi Box and an Android device. For my tutorial I’m using my now outdated Galaxy S4 but as long as you have a device that accepts voice recognition and can install the following software you shouldn’t have a problem. You’re going to have to spend some money but I promise it won’t cost much.

Here’s a list of what you’ll need.
– A box running Kodi (Here’s a list of my top 3 for 2015)
– A Smart Device capable of voice recognition
– Install Tasker from the Google Play Store ($3.99)
– Install AutoVoice (a free Tasker plugin) and it’s pro version unlocker ($1.67).
– Install Yatse (free) and you’ll need to invest in the unlocker as well It’s currently $8.71 on the Play Store.

We need to spend money on the Unlocker of Yatse because it gives us access to the API which is what is going to control voice playback with our simple home Automation setup.

Let’s Get Started

I’m going to assume you know how to install the apps above, it shouldn’t be to complicated for anyone to get them installed. But we’re going to need to do a couple checks to make sure everything can communicate with each other first and foremost. I’m also going to assume you’re using the default theme for Kodi as well as this is the best way to navigate the menu’s.

Step 1

The first step in all of this is making sure Kodi can communicate with Yatse. In order to do that we need to dig into some of the Kodi settings to enable a few of the features. You’re going to want to make sure whatever device you’re using, if you can, is to setup a static IP address for it or at least try to use DHCP reservation.

  • 1. Open Kodi and scroll to the SYSTEM menu and choose the sub-section SETTINGS.
  • 2. Once in SETTINGS go down to SERVICES
  • 3. In SERVICES you’ll want to go down to WEBSERVER and make sure that the option to “Allow Control of Kodi via HTTP” is enabled. Be sure to enter in a username and password that you’ll remember. For this purpose I’ll be using the username and password as “Kodi”. Make note of the port number, usually something like 80 or 8080.
  • 4. Under the Remote Control section of Services be sure to select both options “Allow programs on this system to control Kodi” and “Allow programs on other systems control Kodi”.
  • 5. Then under ZEROCONF be sure that “Announce these services to other systems via Zerconf” is enabled.
  • 6. Return make to the KODI main screen and make your way to SYSTEM once more but this time choose SYSTEM INFO. Make note of your IP Address (typically 192.168.x.xxx)

That’s it for Kodi, now we move onto step two.

Step 2

Now it’s time to setup Yatse on whatever Android Smart Device you are using. You don’t need the unlocker of Yatse for any playback functionality but you’re going to need it if you’re wanting to use voice control and for this tutorial that’s what it’s all about. What we need to do now is connect Yatse to the device we want to control. You’re going to need some of the things we wanted to keep track of from step one, those being the username/password, port number, and IP address.

If this is your first time using Yatse you should be greeted with a setup screen where you can add the host. If you’ve already owned Yatse and have the Unlocked version installed you can skip this step. For those first timers we need to add a host and in order to do so we do as follows:

  • 1. From the add host screen we click the “+” button. From there we should be shown a popup that gives us three options, we want to choose XBMC / KODI “Add a running host”.
  • 2. On the next screen you’ll see something about information and Detected hosts. The Yatse app will scan your local network to find your Kodi enabled media player. In any situation I’ve run I haven’t had any luck where my host has been auto-detected to thus I will add it in manually by clicking the next button at the bottom of the screen.
  • 3. On the next screen we enter in our information that we recorded from Step 1. Enter the IP address, in my case, 192.168.1.64 and the port number (8080) and click next.
  • 4. If it’s successful it will try to connect to the device but because we setup a username and password it will fail and we’ll have to enter it in on the next screen. Do so under login and password, in my example I used Kodi for both. Remember that the username and password is case sensitive.
  • 5. If everything works you should be greeted with a “Congratulations, your host will be added after pressing the finish button”. So…let’s click finish!
  • 6. Finally you’ll be taken to a screen where all your media centers will be displayed. At this moment we just have the one we entered above so lets click it once and then click the check mark below.

Congratulations, we’ve now setup Yatse to work with Kodi. If you want to test it out then try playing around with some of the buttons. There is a slide in menu on the left that will give you direct access to your local library.

But now it’s time for the real fun.

Step 3

The fun begins when we start to implement Tasker. If you’re already familiar with Yatse you may wonder why we would even bother with using Tasker for this. Truthfully as a standalone app using Yatse and Yatse’s built in voice commands works just fine without the need for Tasker integration. The real reason behind using an app like Tasker with AutoVoice is to simplify the process a step further. I

Tasker is an incredible program and makes automation easier. I’m sure a lot won’t feel the need for it but being able to simply say “OK Google, Kodi play the next episode of Mad Men” and have your TV start where you left off with your favorite TV show is an added bonus…plus it might make your friends a little envious. I’m not going to go into great detail on what Tasker is or how to use it as this is something you should learn on your own. There are some wonderful YouTube tutorials out there that will walk you through different profile and task creations that can automatically connect and play music when you start your car or something as simple as reading your text messages while driving. The options are almost limitless and it would take a lot more writing to discuss it all here.

For now I will show you how to simply setup Google Now to work with Kodi.

Now the only way this works is if you purchased AutoVoice from the play store. You can try it for seven days but I believe the trial limits to you four letters to trigger a profile within Tasker. For how reasonable the price is and the amount of functionality you can get out of it it’s worth the cost.

You don’t have to do anything with AutoVoice, just install it. Once that’s done let’s get started using Tasker and setting up our profile that will communicate with the Yatse remote which ultimately will communicate with our Kodi media player.

  • 1. The first step we need to do is launch Tasker. If it’s your first time running it you’ll be greeted with some messages before landing on a screen that says “Click + to add a Profile”. This is where we will begin so click the “+” icon.
  • 2. From here we need to choose what context it will use, in this instance we want “Event”.
  • 3. After choosing event we need to choose the event category and because we want to use AutoVoice we’ll need to select plugin. Inside plugin select AutoVoice.
  • 4. From the AutoVoice drop down menu we want it to recognize what we’re saying when we speak into Google Now. Choose Recognized.
  • 5. You should then be taken to a screen where it says nothing but “Configuration”. From here we need to configure what AutoVoice will hear so it triggers the task we’re going to setup after. Click the pencil (edit) icon to the right.
  • 6. If this is your first time with Tasker it will probably look a little overwhelming but unless you get really indepth you don’t need to play around to much. After clicking edit we should see some options on screen. What we have to do is create a filter that will connect to the Yatse API for voice. To do this you can do it one of two ways, either type it in by clicking “Command Filter” or speaking it in by clicking “Speak Filter”. The filter I’m using in this example is XBMC. That word will then realize I want to send something to the Yatse app to control playback. SO, let’s click Command Filter and type in XBMC and then click OK.
  • 7. Now that our filter is in place we hit the check mark in the top right to accept it.
  • 8. As you’ll see we are taken back to the screen with Configuration but with the AutoVoice options in it. To accept this we have to click in the top left corner where the Tasker icon is. When I first started using Tasker I thought it was a BACK button but this is indeed how you save your Task. Click the button with the ICON in the top left corner to accept this.
  • 9. Once back to the profiles main screen we should see our AutoVoice Recognized Commaned and a popup asking for a New Task. Click it and enter a name like “XBMC Send” and let’s continue.
  • 10. Now we need to handle the actual Task. Click the “+” sign once again so we can add an action.
  • 11. OPTIONAL STEP: You don’t technically need this part but because my Kodi device seems to go to sleep and power down the ethernet port I needed Yatse to open, reconnect, and wake up the LAN. To do this when we clicked the plus sign we want to choose APP, then LAUNCH APP. From here you can simply choose Yatse and then click the ICON in the top left corner to save it.
  • 12. We now need to create another action that sends what we spoke into Google to Yatse. Click the “+” sign once more but this time choose “SYSTEM” and then the “SEND INTENT” option.
  • 13. Things are going to get techy here. Once in the SEND INTENT screen we need to make use of the Yatse API. In order to do so enter in these values without quotes.
    • ACTION: Enter in “org.leetzone.android.yatsewidget.ACTION_APP_VOICECOMMAND_PARSER”
    • CAT: “None”
    • EXTRA: “org.leetzone.android.yatsewidget.EXTRA_STRING_PARAMS:%avcommnofilter”
    • TARGET: “Service”
  • 14. That should be it. To save it we need to click the ICON that looks like a back button to save. Do it twice and we are now back to the main tasker screen and we can try this out.

That’s all you’ll need for Tasker.

Wrapping Up

So now it’s time to test and depending on what device you have it may vary. The big thing is you’ll have to know how to trigger Google Now. For me it’s as simple as saying “OK GOOGLE” into my phone. I found it a little annoying to have to say “Ok Google, XBMC play the next episode of Mad Men” and would rather just double click the home button and have Google Now open so I could say “XBMC Play the next episode of Mad Men”.

If all things we’re successful you should have Yatse open and the latest episode. The commands themselves from Yatse aren’t terribly extensive so you’ll have to understand that you’re limited to what you can say. To learn more about what those commands are visit the official Yatse documentation.

I hope this helps some people starting out, I certainly don’t think this is the best solution but it’s one working for me. If there are any questions or problems with the setup let me know below or if you know a better way to accomplish this please feel free to drop a comment as well to fill me in.

3 Comments

  1. Phill Howells Mar 29, 2016
  2. Nate Kinkead Jul 16, 2015
    • walkities Jul 16, 2015

Leave a Reply

Real Time Analytics