Kodi Community Forum

Full Version: Amazon Echo Alexa Video Skill for Kodi
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Many thanks for inviting me to the beta skill. Are there plans to integrate music playback to the skill? And is there a way to return to the home screen using the skill as the stop command is limited by amazon?
Tomas,

Thanks for your prompt reply. It never occurred to me that krypton 17.4 is old.

Anyway I’ve also been working on it today and instead of disabling the scene and activity on Harmony Hub, I have just renamed it to be something other than Kodi.

It seems that Alexa was really sending the instructions through to the hub instead of the Kodi instance. As soon as I renamed it the Kodi. Commands started working properly.

Perhaps good to note this in your documentation moving forward, that the Kodi Connect device name should be unique within your network

So nothing wrong at all except that Alexa was confused.

Thanks so much for this. It’s truly awesome.
(2018-09-05, 13:04)pbarr Wrote: [ -> ]Tomas,

Thanks for your prompt reply. It never occurred to me that krypton 17.4 is old.

Anyway I’ve also been working on it today and instead of disabling the scene and activity on Harmony Hub, I have just renamed it to be something other than Kodi.

It seems that Alexa was really sending the instructions through to the hub instead of the Kodi instance. As soon as I renamed it the Kodi. Commands started working properly.

Perhaps good to note this in your documentation moving forward, that the Kodi Connect device name should be unique within your network

So nothing wrong at all except that Alexa was confused.

Thanks so much for this. It’s truly awesome.

Actually I spoke too soon.

Only the playback functions within a movie were working. Pause, resume, fast forward 20 seconds, etc.

Once the movie was ended, it proved impossible to do a find or play command. Alexa interprets it properly and says things like “getting Interstellar from Kodi Video” but absolutely no reaction in the UI.

I also followed your advice and upgraded to Krypton 17.6 the latest stable release of Kodi.

No change at all except the commands within movie playback no longer work.

I’m completely at a loss now. I even rebuilt the Echo Dot from scratch.

Also no improvement.

It’s basically a dead duck here.

So please let me know what I can get you to help understand this problem.
(2018-09-05, 15:11)pbarr Wrote: [ -> ]
(2018-09-05, 13:04)pbarr Wrote: [ -> ]Tomas,

Thanks for your prompt reply. It never occurred to me that krypton 17.4 is old.

Anyway I’ve also been working on it today and instead of disabling the scene and activity on Harmony Hub, I have just renamed it to be something other than Kodi.

It seems that Alexa was really sending the instructions through to the hub instead of the Kodi instance. As soon as I renamed it the Kodi. Commands started working properly.

Perhaps good to note this in your documentation moving forward, that the Kodi Connect device name should be unique within your network

So nothing wrong at all except that Alexa was confused.

Thanks so much for this. It’s truly awesome.

Actually I spoke too soon.

Only the playback functions within a movie were working. Pause, resume, fast forward 20 seconds, etc.

Once the movie was ended, it proved impossible to do a find or play command. Alexa interprets it properly and says things like “getting Interstellar from Kodi Video” but absolutely no reaction in the UI.

I also followed your advice and upgraded to Krypton 17.6 the latest stable release of Kodi.

No change at all except the commands within movie playback no longer work.

I’m completely at a loss now. I even rebuilt the Echo Dot from scratch.

Also no improvement.

It’s basically a dead duck here.

So please let me know what I can get you to help understand this problem.

Just a quick thought.

Is it significant that the skill I have says DevUK and my Amazon account is a US account ?
(2018-09-05, 15:15)pbarr Wrote: [ -> ]
(2018-09-05, 15:11)pbarr Wrote: [ -> ]
(2018-09-05, 13:04)pbarr Wrote: [ -> ]Tomas,

Thanks for your prompt reply. It never occurred to me that krypton 17.4 is old.

Anyway I’ve also been working on it today and instead of disabling the scene and activity on Harmony Hub, I have just renamed it to be something other than Kodi.

It seems that Alexa was really sending the instructions through to the hub instead of the Kodi instance. As soon as I renamed it the Kodi. Commands started working properly.

Perhaps good to note this in your documentation moving forward, that the Kodi Connect device name should be unique within your network

So nothing wrong at all except that Alexa was confused.

Thanks so much for this. It’s truly awesome.

Actually I spoke too soon.

Only the playback functions within a movie were working. Pause, resume, fast forward 20 seconds, etc.

Once the movie was ended, it proved impossible to do a find or play command. Alexa interprets it properly and says things like “getting Interstellar from Kodi Video” but absolutely no reaction in the UI.

I also followed your advice and upgraded to Krypton 17.6 the latest stable release of Kodi.

No change at all except the commands within movie playback no longer work.

I’m completely at a loss now. I even rebuilt the Echo Dot from scratch.

Also no improvement.

It’s basically a dead duck here.

So please let me know what I can get you to help understand this problem. 

Just a quick thought.

Is it significant that the skill I have says DevUK and my Amazon account is a US account ? 
Damn, my bad .. 17.4 would have probably be okay .. I somehow misunderstood it for 16.4

That is weird, but probably shouldn't affect it.
Can you describe more, how it is not working?
What does Alexa reply? Does Kodi show any notification?
Also, could you upload kodi.log somewhere? There might be some useful information.
And if you send me the email that you used to register on Kodi connect page, I will check server logs
(2018-09-05, 12:51)fryster Wrote: [ -> ]Many thanks for inviting me to the beta skill. Are there plans to integrate music playback to the skill? And is there a way to return to the home screen using the skill as the stop command is limited by amazon?
Unfortunately, there is currently no API provided by Amazon for smart music skills (as with spotify, amazon music, etc.)
(2018-09-05, 15:54)tkislan Wrote: [ -> ]
(2018-09-05, 15:15)pbarr Wrote: [ -> ]
(2018-09-05, 15:11)pbarr Wrote: [ -> ]Actually I spoke too soon.

Only the playback functions within a movie were working. Pause, resume, fast forward 20 seconds, etc.

Once the movie was ended, it proved impossible to do a find or play command. Alexa interprets it properly and says things like “getting Interstellar from Kodi Video” but absolutely no reaction in the UI.

I also followed your advice and upgraded to Krypton 17.6 the latest stable release of Kodi.

No change at all except the commands within movie playback no longer work.

I’m completely at a loss now. I even rebuilt the Echo Dot from scratch.

Also no improvement.

It’s basically a dead duck here.

So please let me know what I can get you to help understand this problem. 

Just a quick thought.

Is it significant that the skill I have says DevUK and my Amazon account is a US account ?   
Damn, my bad .. 17.4 would have probably be okay .. I somehow misunderstood it for 16.4

That is weird, but probably shouldn't affect it.
Can you describe more, how it is not working?
What does Alexa reply? Does Kodi show any notification?
Also, could you upload kodi.log somewhere? There might be some useful information.
And if you send me the email that you used to register on Kodi connect page, I will check server logs  
Tomas,

Hopefully I did this right and you should find the log file here. I switched on DEBUG also.

https://paste.ubuntu.com/p/mtBZkyV2T4/

I registered with [email protected]

As for the description of what's happening.

I start up Kodi and the Kodi Connect pop up appears and says "connected"

Then I just ask Kodi to play a movie:

Alexa, play Interstellar - just as in the cheat sheet.

Alexa says: "getting Interstellar from Kodi Video".

This experience is the same for TV Shows and Movies.

Then nothing happens so I'm guessing there's an unhandled exception occurring somewhere there, either in Kodi or in your server.  Looking at those logs I think it's Kodi.

If I am in a movie or a music video I can still "pause" and "play". Lag is about 2 seconds on both commands and Alexa doesn't respond verbally to those, but they do work. I can also fast forward, etc.

Incidentally I don't know how to use a voice command to "stop" play a video and return to the menu. I still need to use a remote control for that.

Thanks for your efforts.
i just sent you a PM requesting beta access... thanks
Im glad someone finally picked up on making this. I gave it a whirl sometime around last xmas when i got an echo. The backend is a pretty big pain so everyone using this should really be thankful he's giving it to anyone else. I had to get my own hosting so i could pass the commands from AWS to my "cloud" and that process then sent commands to the kodi web interface api. I only managed to really get pause and play working well and alexas commands to trigger it were not very normal like "alexa, play on kodi" instead of "play kodi". If i didnt use the "on" it would always try to play a file named kodi not command a device. I give you a lot of credit because getting the lambda functions on aws setup and everything flowing smoothly from alexa to kodi was a total bugger.

I never could figure out how to avoid that cloud api part to send commands directly over the local network so kudos to you for that. Im curious to know how you did if you dont mind sharing?
(2018-09-07, 02:17)pbarr Wrote: [ -> ]
(2018-09-05, 15:54)tkislan Wrote: [ -> ]
(2018-09-05, 15:15)pbarr Wrote: [ -> ]Just a quick thought.

Is it significant that the skill I have says DevUK and my Amazon account is a US account ?   
Damn, my bad .. 17.4 would have probably be okay .. I somehow misunderstood it for 16.4

That is weird, but probably shouldn't affect it.
Can you describe more, how it is not working?
What does Alexa reply? Does Kodi show any notification?
Also, could you upload kodi.log somewhere? There might be some useful information.
And if you send me the email that you used to register on Kodi connect page, I will check server logs  
Tomas,

Hopefully I did this right and you should find the log file here. I switched on DEBUG also.

https://paste.ubuntu.com/p/mtBZkyV2T4/

I registered with [email protected]

As for the description of what's happening.

I start up Kodi and the Kodi Connect pop up appears and says "connected"

Then I just ask Kodi to play a movie:

Alexa, play Interstellar - just as in the cheat sheet.

Alexa says: "getting Interstellar from Kodi Video".

This experience is the same for TV Shows and Movies.

Then nothing happens so I'm guessing there's an unhandled exception occurring somewhere there, either in Kodi or in your server.  Looking at those logs I think it's Kodi.

If I am in a movie or a music video I can still "pause" and "play". Lag is about 2 seconds on both commands and Alexa doesn't respond verbally to those, but they do work. I can also fast forward, etc.

Incidentally I don't know how to use a voice command to "stop" play a video and return to the menu. I still need to use a remote control for that.

Thanks for your efforts.

I did a bit of research on this. There is a line of code in your json rpc call that manages the Unicode. You are set to utf-8. In most cases where only Latin characters are used in file names this should mostly be ok, but I have a bunch of Chinese, Japanese, and Korean titles, it to mention the affectation that some artists have with higher end ASCII characters in their names. I changed this line to ISO-8859-1 and reinstalled the modified plugin. It all works now.
Hi Tomas,

I just saw a video on this skill it looks amazing.  Could you please add me.  The problem is I get an access denied when I try to send a PM.  Do you have any suggestions?

Thank you,
Alan
(2018-09-07, 02:17)pbarr Wrote: [ -> ]
(2018-09-05, 15:54)tkislan Wrote: [ -> ]
(2018-09-05, 15:15)pbarr Wrote: [ -> ]Just a quick thought.

Is it significant that the skill I have says DevUK and my Amazon account is a US account ?   
Damn, my bad .. 17.4 would have probably be okay .. I somehow misunderstood it for 16.4

That is weird, but probably shouldn't affect it.
Can you describe more, how it is not working?
What does Alexa reply? Does Kodi show any notification?
Also, could you upload kodi.log somewhere? There might be some useful information.
And if you send me the email that you used to register on Kodi connect page, I will check server logs   
Tomas,

Hopefully I did this right and you should find the log file here. I switched on DEBUG also.

https://paste.ubuntu.com/p/mtBZkyV2T4/

I registered with [email protected]

As for the description of what's happening.

I start up Kodi and the Kodi Connect pop up appears and says "connected"

Then I just ask Kodi to play a movie:

Alexa, play Interstellar - just as in the cheat sheet.

Alexa says: "getting Interstellar from Kodi Video".

This experience is the same for TV Shows and Movies.

Then nothing happens so I'm guessing there's an unhandled exception occurring somewhere there, either in Kodi or in your server.  Looking at those logs I think it's Kodi.

If I am in a movie or a music video I can still "pause" and "play". Lag is about 2 seconds on both commands and Alexa doesn't respond verbally to those, but they do work. I can also fast forward, etc.

Incidentally I don't know how to use a voice command to "stop" play a video and return to the menu. I still need to use a remote control for that.

Thanks for your efforts. 
Ah, I've found the issue in the logs

UnicodeDecodeError: 'utf8' codec can't decode byte 0xc3 in position 254059: invalid continuation byte

I've seen this error with some other users as well.
Problem is, that you have something in your video library, that has messed up encoding (probably), and Kodi is having troubles coding or decoding it.
Unfortunately, I've been trying to find a solution to this, but nothing I could find.
I basically just request a huge JSON from Kodi, with all the movies, and then tvshows, but if there are some invalid characters, JSON parser just fails to get the data out of it
(2018-09-08, 12:06)pbarr Wrote: [ -> ]
(2018-09-07, 02:17)pbarr Wrote: [ -> ]
(2018-09-05, 15:54)tkislan Wrote: [ -> ]Damn, my bad .. 17.4 would have probably be okay .. I somehow misunderstood it for 16.4

That is weird, but probably shouldn't affect it.
Can you describe more, how it is not working?
What does Alexa reply? Does Kodi show any notification?
Also, could you upload kodi.log somewhere? There might be some useful information.
And if you send me the email that you used to register on Kodi connect page, I will check server logs  
Tomas,

Hopefully I did this right and you should find the log file here. I switched on DEBUG also.

https://paste.ubuntu.com/p/mtBZkyV2T4/

I registered with [email protected]

As for the description of what's happening.

I start up Kodi and the Kodi Connect pop up appears and says "connected"

Then I just ask Kodi to play a movie:

Alexa, play Interstellar - just as in the cheat sheet.

Alexa says: "getting Interstellar from Kodi Video".

This experience is the same for TV Shows and Movies.

Then nothing happens so I'm guessing there's an unhandled exception occurring somewhere there, either in Kodi or in your server.  Looking at those logs I think it's Kodi.

If I am in a movie or a music video I can still "pause" and "play". Lag is about 2 seconds on both commands and Alexa doesn't respond verbally to those, but they do work. I can also fast forward, etc.

Incidentally I don't know how to use a voice command to "stop" play a video and return to the menu. I still need to use a remote control for that.

Thanks for your efforts. 

I did a bit of research on this. There is a line of code in your json rpc call that manages the Unicode. You are set to utf-8. In most cases where only Latin characters are used in file names this should mostly be ok, but I have a bunch of Chinese, Japanese, and Korean titles, it to mention the affectation that some artists have with higher end ASCII characters in their names. I changed this line to ISO-8859-1 and reinstalled the modified plugin. It all works now. 
Oh, disregard my previous reply.
But what approach you suggest here? is there a way to know the encoding upfront? or should I just add failover to try with other encodings?
(2018-09-09, 00:46)alansche Wrote: [ -> ]Hi Tomas,

I just saw a video on this skill it looks amazing.  Could you please add me.  The problem is I get an access denied when I try to send a PM.  Do you have any suggestions?

Thank you,
Alan
You can PM me on reddit. I have same username there
(2018-09-07, 20:41)nogoer Wrote: [ -> ]Im glad someone finally picked up on making this. I gave it a whirl sometime around last xmas when i got an echo. The backend is a pretty big pain so everyone using this should really be thankful he's giving it to anyone else. I had to get my own hosting so i could pass the commands from AWS to my "cloud" and that process then sent commands to the kodi web interface api. I only managed to really get pause and play working well and alexas commands to trigger it were not very normal like "alexa, play on kodi" instead of "play kodi". If i didnt use the "on" it would always try to play a file named kodi not command a device. I give you a lot of credit because getting the lambda functions on aws setup and everything flowing smoothly from alexa to kodi was a total bugger.

I never could figure out how to avoid that cloud api part to send commands directly over the local network so kudos to you for that. Im curious to know how you did if you dont mind sharing?
It is still not sending commands over the local network. That you got correct, and there is no way to bypass that.
The addon approach just removes the need to open your device to the internet, because it actually creates secure reverse proxy to my server.
So instead of having one cloud hosting, I'm actually hosting one server, one that connects all the Kodi devices together, and AWS Lambda function, that handles Alexa requests, and forwards them to the correct Kodi device.