Kodi Community Forum
Release Kanzi: Amazon Alexa skill for Kodi - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Supplementary Tools for Kodi (https://forum.kodi.tv/forumdisplay.php?fid=116)
+--- Thread: Release Kanzi: Amazon Alexa skill for Kodi (/showthread.php?tid=254502)



RE: Amazon Echo skill for Kodi - jingai - 2017-09-01

It's probably exactly as it says.. your user permissions are wrong.


RE: Amazon Echo skill for Kodi - DonBrutto - 2017-09-01

But I ticked the correct box. I'll go over it again but I'm pretty sure I did as the readme said.


RE: Amazon Echo skill for Kodi - thehatboxghost - 2017-09-02

(2017-09-01, 13:10)jingai Wrote: @thehatboxghost, hmm.. did you by chance upgrade the skill code recently and forget to update the interaction model on Amazon's skill builder site?

No I didn't but thanks anyway. I might try removing everything and starting from scratch again, just to be sure. Thanks for the help anyway.


RE: Amazon Echo skill for Kodi - jingai - 2017-09-02

@thehatboxghost, well, you mentioned you "tried the 3 different stop utterances," and we don't currently have any defined stop utterances in the skill. We utilize the Amazon built-in for it.

We did, however, previously define the Stop Intent ourselves, and from your logs, it looked like that's what it was trying to invoke.


RE: Amazon Echo skill for Kodi - sanjonny - 2017-09-02

SInce I just went thru it, if you already have done the readme and have a working instance and want to make another skill to run a different kodi instance using the different invocation instead of by echo device, you can simplify it a bit for first time users.
Please feel free to add/edit/ criticize or whatever and add to readme if it is useful.


I have two kodi instances controlled by the same alexa device.

If you can link one device to one kodi instance then follow the other procedure outlined in the readme. By having the different invocation, I can control my garage kodi instance from any kodi device. The downside is you need to create another skill and directory to do it, but you can use the same user for all instances.

Note that it is much easier to just edit the config if you can tie one instance of kodi to one alexa device. But this method lets you control your kodi instance from any alexa device. It is more work though since you need to create a different version of zappa and directory, and a new skill.

What I did was do the original readme. Then copy that directory completely to a new directory, in my case, my original directory was kodi-alexa and I copied the directory and then renamed it to kodi-alexa-garage. I then did the shortened process below. This is on windows. Make sure your first setup works before trying to add a different invocation.

Code:
cd kodi-alexa-garage
virtualenv venv
venv\Scripts\activate.ps1 (note this is for windows using powershell see readme for different commands for other systems)
You now have to make any changes to the kodi.config. For my system the only change was changing the port number to the new kodi device
In my original config
Code:
# The Kodi webserver only supports HTTP, but if you've set up a reverse HTTPS
# proxy you can change this to https.
scheme   = http
address  = whatever.no-ip.biz
port     = 11114
since I already set the router up for the other kodi instance then my new config was
Code:
# The Kodi webserver only supports HTTP, but if you've set up a reverse HTTPS
# proxy you can change this to https.
scheme   = http
address  = sanjonny.no-ip.biz
port     = 11115
save that and then you are now ready to deploy.
Code:
zappa deploy dev

When that is done, make sure you copy the url as you did the first time. Now you need to make a new skill.
Use the readme to do everything related to the skill, my old skill was called kodi and the original invocation was "the bedroom", for my new skill, the skill is kodigarage, the invocation name is "the garage"

Now assuming you are using the same shared database (mysql or whatever) you just use the files already in the copied directory to fill out the custom slot types and information as in the readme. Do everything else, but in the page where you enter the endpoint, you want to use the new url from the deploy you already did instead of the url from the original skill setup.
If you do not share the database between kodi instances, you can just regenerate them with the python script for the new instance or the webtool. Finish doing everything else in the skill setup and save and you should be good to go!

For me, I can now say Alexa, ask "the garage" to pause or Alexa ask "the garage" what is playing and check if it works. My original was Alexa, ask "the bedroom" to pause. If pause works or you find out what is playing, you should be good to go!

I would suggest saving the directories and in future when needing to update, you simply go to each directory and follow the directions for upgrading in each directory to update each kodi instance.


Thanks so much for all your help and I hope this helps someone!


RE: Amazon Echo skill for Kodi - jingai - 2017-09-03

New release -- changes:

v2.9.0 (09/03/2017)
  • Add support for specifying genre in recommendations.
  • Optimize media recommendations.
  • Add ability to toggle stereoscopic mode.
  • Add ability to toggle audio passthrough.
  • Expand help to include example utterances.
  • Add read_timeout and read_timeout_async config variables.

As usual, see UPGRADING.md if you're upgrading from a previous version.

NOTE: There are two new variables in kodi.config that must be added to the DEFAULT section:

Code:
read_timeout = 120
read_timeout_async = 0.01



RE: Amazon Echo skill for Kodi - bill_orange - 2017-09-03

(2017-09-03, 15:39)jingai Wrote: New release -- changes:

v2.9.0 (09/03/2017)
  • Add support for specifying genre in recommendations.
  • Optimize media recommendations.
  • Add ability to toggle stereoscopic mode.
  • Add ability to toggle audio passthrough.
  • Expand help to include example utterances.
  • Add read_timeout and read_timeout_async config variables.

As usual, see UPGRADING.md if you're upgrading from a previous version.

NOTE: There are two new variables in kodi.config that must be added to the DEFAULT section:

Code:
read_timeout = 120
read_timeout_async = 0.01

I encounter one small problem with the update.

After inserting the new slots, intents, and utterances, I received this error when I saved:

Error: There was a problem with your request: The intent 'RecommendMedia' was not found in the domain definition. This error occurred in sample 'RecommendMedia recommend something' on line 501.

It was correct. There was no RecommendMedia intent. I deleted the utterance on line 501 and 502 and then all preceeded normally.

Maybe its my imagination, but it seems to search faster now. My music library is over 100 gig. It found "Dark Side of the Moon" in two or three seconds.


RE: Amazon Echo skill for Kodi - jingai - 2017-09-03

There's no RecommendMedia intent referenced in the utterances. Either you didn't update your utterances, or you have an old copy of SampleUtterances.txt lying around -- it was renamed to SampleUtterances.en.txt.

If you don't pull in the new utterances, the newly-added stuff won't work.


RE: Amazon Echo skill for Kodi - bill_orange - 2017-09-03

(2017-09-03, 18:48)jingai Wrote: There's no RecommendMedia intent referenced in the utterances. Either you didn't update your utterances, or you have an old copy of SampleUtterances.txt lying around -- it was renamed to SampleUtterances.en.txt.

If you don't pull in the new utterances, the newly-added stuff won't work.

"or you have an old copy of SampleUtterances.txt lying around -- it was renamed to SampleUtterances.en.txt."

That's what happened. I thought incorrectly that :

SampleUtterances --> US version
SampleUtterances.en --> British version
SampleUtterances.de --> German version

I did not realize that the first one was done away with.


RE: Amazon Echo skill for Kodi - EvilHidden - 2017-09-04

Having an issue attempting to play the series "Archer". Everything else works fine. I've tried saying play a random episode of Archer, play a specific one, but it just errors out. "Cannot find the show named Archer". I even made sure to put this in the show slot.

Any ideas or help appreciated.

Code:
[1504548873343] Playing a random episode of archer
[1504548873343] Searching for show "archer"
[1504548873343] Sending request to http://xxx/jsonrpc from device amzn1.ask.device.xxx
[1504548873753] Simple match failed, trying fuzzy match...
[1504548873753] Processing 34 items...
[1504548873753] heard: "archer"
[1504548873755] [INFO] 2017-09-04T18:14:33.755Z e6d45427-919c-xx-xx-xx xx.xx.xxx.xxx - - [04/Sep/2017:18:14:33 +0000] "POST / HTTP/1.1" 200 292 "" "Apache-HttpClient/4.5.x (Java/1.8.0_131)" 0/546.816



RE: Amazon Echo skill for Kodi - jingai - 2017-09-04

Try asking for "archer 2009".


RE: Amazon Echo skill for Kodi - EvilHidden - 2017-09-04

That seemed to work. Is there any way around that? I don't have to do that for Doctor Who (2005).


RE: Amazon Echo skill for Kodi - jingai - 2017-09-04

"Archer" is a small title, so it can't get a solid match against "Archer (2009)". Over 50% of the string is the year. Conversely, "Doctor Who" encompasses more of the string, percentage-wise.

There's not really much we can do about this without detrimental effects on other titles.

The only thing you can really do is modify the titles in your library to exclude the year.


RE: Amazon Echo skill for Kodi - EvilHidden - 2017-09-04

Bummer. Ok. Thanks for the info.


RE: Amazon Echo skill for Kodi - BlackCatPeanut - 2017-09-04

I've tried to setup a server using the Heroku hosted option and went through setup fairly smoothly. I've come to test the skill within the Skill Setup screens and am getting the following response when entering "play": "There was an error calling the remote endpoint, which returned HTTP 500 : INTERNAL SERVER ERROR" I also tried testing directly through my Echo Dot and it didn't work either saying there was an issue with the response...

Any ideas where I might have gone wrong? I tried setting up the server using the AWS route and it results in the same test result.

UPDATE: Found the following in the Heroku logs:
2017-09-04T21:04:19.004941+00:00 app[web.1]: ConnectionError: HTTPConnectionPool(host='http', port=80): Max retries exceeded with url: /XXXXXXXX/:XXXX/jsonrpc (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f196aea2bd0>: Failed to establish a new connection: [Errno -2] Name or service not known',))
2017-09-04T21:04:19.467892+00:00 heroku[router]: at=info method=POST path="/" host=XXXXXXXXXXXXXX.herokuapp.com request_id=5fb23420-058e-46b8-991c-2369ebf18f87 fwd="54.240.197.110" dyno=web.1 connect=1ms service=341ms status=200 bytes=161 protocol=https