VIDEO: Amazon Echo controlling KODI!
#1
UPDATE: All necessary modules and step by step instructions are posted on my youtube channel. Just watch the numbered videos in order, and be sure to read the full description under each video in order to download the needed KODI and SpeechParser modules for Premise. Link to my channel: https://www.youtube.com/channel/UC6fLTEm...B5VoKazC9A


Hey guys, I just posted the youtube video below demonstrating how I've integrated KODI and the Amazon Echo with my home automation system.





If you have any questions, please post them on the youtube KODI video, and I'll do my best to go through and answer them or make a new video that explains things better.

Details from the video:
This is my one of three videos of what I'm doing with the Amazon Echo, KODI and home automation.

If I get enough subscribers, I plan to make future more organized videos along with details of how to set all this up in your home. I’ll also post the KODI module for you to play with too in conjunction with the how to videos.

In this video, I'm demonstrating true voice enabled two way feedback with KODI, my home automation system and the Amazon Echo!

Here’s what I’m using to do this:
1. Amazon's Echo (aka Alexa)

2. KODI running on an nVidia Shield AndroidTV device

3. A free home automation program called Motorola Premise Home Control (http://cocoontech.com/forums/page/home-a...premise-r3)

and...
4. A KODI module I've written for Premise allowing full two-way ip based functionality (including library importing) and IR too (so you can use the native Netflix 4k App that comes on the nVidia Shield without picking up another remote).

5. A very versatile SpeechParser module I've written for Premise, that takes a generic command phrase, then performs some action and forms a natural language response.

6. A new Amazon Echo skill I'm calling "Premise" that is in testing under my developer account. It uses an Intent called “Premise” to pass whatever is said after “Alexa ask Premise to” to my home automation server.

7. A free tiered Amazon Web Services (AWS) account to send Alexa commands to my home automation server over HTTPS. The same AWS lambda function also reads back an HTTP response of what actions took place that is sent from my home automation server (via the SpeechParser module).

Some additional even more geeky details:
Everything you see is done in a very generic fashion. No individual phrases were programmed for what you see in the video, I’m too lazy for that!

I’ve written code (a Premise SpeechParser module) for my home automation system that actually interprets the sentence using nested regular expressions to find what property state, property value, device type and room location you are trying to control based on what command you say.

In this manner, the command phrases are NOT order dependent (unlike most other options out there including Amazon’s), and leverage the object based structure of Premise, to recursively find a match within my home for whatever command is issued.

To elaborate, once found from the command phrase, the device type and room location are then used to examine all devices in the under a particular location (e.g. room) that match a particular device type (e.g. light). Once a match is found (e.g. table lamp in the living room), the properties under that object are compared using recursion to find the best match for the command sentence, and the new value is set.

The queries in the Part 2 video also work in a similar manner, but instead of setting a property value, they grab the value and return a response to the query.
Reply
#2
Very cool
Reply
#3
Thanks! I added another video showing how the Premise KODI module works:

Video description:
This is the third of three videos of what I'm doing with the Amazon Echo, KODI and home automation. This video mainly shows control of KODI by home automation system, including automatic library import, full two-way control, and even IR control of an nVidia Shield Android TV to allow favorites to be loaded for native Youtube and Netflix apps.

To see a full video of the Amazon Echo control, please see my channel here: https://www.youtube.com/channel/UC6fLTEm...C9A/videos

If I get enough subscribers, I plan to make future more organized videos along with details of how to set all this up in your home. I’ll also post the KODI module for you to play with too!

[i]Here’s what I’m using to do the stuff from the video:[/i]
1. Amazon's Echo (aka Alexa)

2. KODI running on an nVidia Shield AndroidTV device

3. A free home automation program called Motorola Premise Home Control (http://cocoontech.com/forums/page/home-a...premise-r3)

4. URC (Universal Remote Controls) MXW-920 RF remote.

5. MSC-400 URC base station (to send RS232 commands to my home automation server)

and...
6. A KODI module I've written for Premise allowing full two-way ip based functionality (including library importing) and IR too (so you can use the native Netflix 4k App that comes on the nVidia Shield without picking up another remote). The module actually seamlessly switches between IR and IP based control!

Some additional geeky details on the KODI Premise module:
I’ll also use this module to auto select sound modes on my preamp to match source content. This is implemented using the Audio.Fields.Song JSON-RPC property, so my home automation system will know what bitrate is being used, how many channels, etc…

Another idea I have is for this module to automatically move an anamorphic lens in/out based on the content’s video aspect ratio, or even just switch my TV’s view mode based on the aspect ratio of what’s playing. This will be implemented using Video.Streams streamdetails.

This module uses Premise Home Control’s mSense feature to automatically find a source that can play a given content type in a room that you select (e.g. movie, episode, tv channel, and song). I’ve written the KODI Premise module so it is 100% compatible with this feature.

You could have a KODI box in each room and tell Premise to play a song in all rooms, or you can also join what’s playing in a different room. As discussed in the video, the cool thing is being able to press play and have Premise automatically figure out which source is selected, and send the Play command to it. This is also what allows a user say “Press play in [room name].”

The importing is fully automatic using JSON-RPC, and any of the commands work over JSON-RPC, so no IR is needed unless you want it to control native android apps such as Youtube or Netflix.

(2015-09-12, 06:37)ZombieRobot Wrote: Very cool
Reply
#4
Nice but a bit slow. A few years and this will all be second nature
Reply
#5
I'll post a video of my Moto 360 (old version) smart watch using Google voice search to control things. You'll see it's much faster! Too bad Google refuses to make something like the Echo with an open API.

I agree on the slowness. I think amazon was doing some maintenance last night when I filmed it as the Alexa app was also down for a little while (realized this after posting the video). It's usually about half that speed, but there's always a delay and it's never close to being what I'd consider very fast! The delay is on Amazon's end, and there's nothing you can do about it...

(2015-09-12, 17:55)danfloss Wrote: Nice but a bit slow. A few years and this will all be second nature
Reply
#6
That's really cool. I've been looking at a lot of stuff about home automation. Like Danfloss said its slow. But I think things will get better over time on Amazon's end. I would love to be able to do something like this in the future.

Edit: posted before I saw the second video. Definitely seems like it was an Amazon issue.
Reply
#7
Brick 
Thanks!

I posted a poll here to see how many are interested in home automation with KODI using voice: http://forum.kodi.tv/showthread.php?tid=238769

If there's enough interest, I'll post my KODI module along with some setup videos, then post the SpeechParser module after that.

The SpeechParser module I've written is much more elegant than some methods out there. The actual command interpretation is done within the home automation server, and you send a command via an HTTP Get or Post like:

MyServer.com/sys/{SomePathGUID}?d??mbNaturalLanguage(this_is_a_spoken_command)

Where this_is_a_spoken_command could be "turn_on_master_bedroom_light" or whatever you want Premise to do. The neat thing is the words are NOT order dependent (unlike the Smartthings or Wink stuff that works with the Echo).

Here's a PDF describing the SpeechParser part in detail, it also goes over some command examples: https://drive.google.com/file/d/0B1J0a4O...sp=sharing

I need to update the Tasker instructions before I ever post this as there are some more details on setting up the Tasker Javascript, especially if HTTPS is used. I actually made this module over two years ago and have used it everyday with Google Now, but the KODI module is new so I need to test it more.

(2015-09-13, 23:38)Tatts4Life Wrote: That's really cool. I've been looking at a lot of stuff about home automation. Like Danfloss said its slow. But I think things will get better over time on Amazon's end. I would love to be able to do something like this in the future.

Edit: posted before I saw the second video. Definitely seems like it was an Amazon issue.
Reply
#8
I'm interested, looks pretty cool.
[H]i-[d]eft [M]edia [K]een [V]ideosaurus
My HT
Reply
#9
I'm VERY interested. Please post everything... seriously, everything! I'd love to have Premise up and running at my house.

- Sam
Reply
#10
I am too very interested. Cool stuff. Having tried my hand at LinuxMCE for a while for this same coolness with no real results to show for (my limited knowledge in Linux), I would love to try my hand in this. Please share.
Thanks
Reply
#11
wow this with the new apple tv whould be sick!
Reply
#12
Hey guys, I finally got around to posting all the KODI guides to do this with an Android device.

Just take a look at the numbered how to videos (1 through 7.4): https://www.youtube.com/channel/UC6fLTEm...B5VoKazC9A

Video 6 has the KODI module download, and video 7.1 has the Speech Parser download... You can seriously have this up and running in an evening if you watch the videos in order and do exactly as I explain and show!
Reply
#13
etc6849, now that Alexa is integrated in new FTV box (and soon 1st gen box) and FireOS 5.x, would the instructions be different?
[H]i-[d]eft [M]edia [K]een [V]ideosaurus
My HT
Reply
#14
The video only shows how to setup voice control for an Android device, but goes over setting up the home automation server to accept generic requests, so definitely watch the videos if you want this to work with your FTV box.

If you watch the videos, and test things with an Android device, you'll be ready to setup things for Alexa (using the node.js script I wrote and included with the zip file attached to video 7.1).

I don't know how to show you guys this as AWS requires credit card info to setup, my address, etc... Editing that out of a video frame by frame is too labour intensive for the 20 people that may watch it and will actually follow along!

Basic steps are:
1. Create an Echo developers account.
2. Setup a custom intent (I named my intent "Premise").
3. Setup an Amazon AWS account.
4. Place the node.js code onto the AWS cloud and link it to the intent.

The steps are simple to set this up if you google for tutorials on how to make your own Alexa intents. Even the Echo developer portal pretty much lists what to do step by step, and I've already done the node.js script for you, so you just have to edit it with your IP address, username, password and port (for Premise HTTPS connection).

No reason any device can't be hacked to work like I'm showing. All the device has to do is have a way to get spoken words into a string and then send them via a URL. The setup on the home automation backend is all the same, and the logic is all in one place, and not spread across each Android tablet, Echo, etc...
Reply
#15
Perfect, this was on my wishlist for sometime now, never new that you already made this possible with kodi and Amazon Echo, you my sir are a genius.
I am getting hooked for the next whole week (have an entire week off from work - PTO, had many plans, but now this project takes priority over others). lol

Ive subscribed to your youtube channel, should i start going through the videos starting from 1 to 7.1? I have Kodi on windows 7, or is this exclusive to windows 10?
I have Vera Home automation, have tons of things on it.
Have Amazon Echo, am i good to go, or do i need to order some other module? I dont care to start my TV through the voice control, but would like to direct Alexa to start a movie while the TV/Kodi is running already. Also, i am using Vera along with Amazon Echo using the HA Bridge running 24/7 on my htpc.

Are all the steps covered in your videos to configure Kodi and Alexa togather. Ah this is raw sex, I am already getting the goosebumps.
Reply

Logout Mark Read Team Forum Stats Members Help
VIDEO: Amazon Echo controlling KODI!4