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 - superwad - 2017-05-01

@jingai From Google's cache of the Github page. I followed edru's guide on getting self-hosting working, and that's what it mentioned. I tried looking through the commits on Github, but didn't see when wsgi.py was removed/renamed.

I'll readjust my setup to point to alexa.wsgi, thanks Smile


RE: Amazon Echo skill for Kodi - realjohngalt - 2017-05-01

(2017-04-30, 22:42)jingai Wrote: It's safe to update to Flask-Ask 0.9.2 now -- I've fixed the issue with it.

I have this running on my own server still with flask-ask 0.9.1, but tried to get it running on heroku again from master HEAD for a krypton box this time. I'm now getting the following:
2017-05-01T04:31:04.242660+00:00 app[web.1]: Sending request to http://REDACTED:8080/jsonrpc
2017-05-01T04:31:04.352636+00:00 app[web.1]: [2017-05-01 04:31:04,351] ERROR in app: Exception on / [POST]
2017-05-01T04:31:04.352642+00:00 app[web.1]: Traceback (most recent call last):
2017-05-01T04:31:04.352643+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/flask/app.py", line 1982, in wsgi_app
2017-05-01T04:31:04.352644+00:00 app[web.1]: response = self.full_dispatch_request()
2017-05-01T04:31:04.352646+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/flask/app.py", line 1614, in full_dispatch_request
2017-05-01T04:31:04.352647+00:00 app[web.1]: rv = self.handle_user_exception(e)
2017-05-01T04:31:04.352647+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/flask/app.py", line 1517, in handle_user_exception
2017-05-01T04:31:04.352648+00:00 app[web.1]: reraise(exc_type, exc_value, tb)
2017-05-01T04:31:04.352649+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request
2017-05-01T04:31:04.352650+00:00 app[web.1]: rv = self.dispatch_request()
2017-05-01T04:31:04.352650+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request
2017-05-01T04:31:04.352651+00:00 app[web.1]: return self.view_functions[rule.endpoint](**req.view_args)
2017-05-01T04:31:04.352652+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/flask_ask/core.py", line 594, in _flask_view_func
2017-05-01T04:31:04.352653+00:00 app[web.1]: result = self._map_intent_to_view_func(self.request.intent)()
2017-05-01T04:31:04.352654+00:00 app[web.1]: File "/app/alexa.py", line 1914, in alexa_what_new_movies
2017-05-01T04:31:04.352654+00:00 app[web.1]: new_movies = kodi.GetUnwatchedMovies()
2017-05-01T04:31:04.352655+00:00 app[web.1]: File "/app/kodi.py", line 1023, in GetUnwatchedMovies
2017-05-01T04:31:04.352656+00:00 app[web.1]: for d in data['result']['movies']:
2017-05-01T04:31:04.352657+00:00 app[web.1]: KeyError: 'result'


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

@realjohngalt, make sure you're forwarding the port correctly.


RE: Amazon Echo skill for Kodi - realjohngalt - 2017-05-02

(2017-05-01, 21:03)jingai Wrote: @realjohngalt, make sure you're forwarding the port correctly.
This is only happening on heroku for me, and I can access the system just fine from ExtIP:8080/jsonrpc .


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

You can access it from outside of your LAN?

The skill was unable to retrieve the items in your Kodi library. Typically this is because it was unable to connect, though you could check Kodi's log for the request too and see if there was a problem.

But given that it works for you when making the request locally, I'd say verify your IP, port, and credentials in the .env file and make sure you can actually access http://extip:8080/jsonrpc from the internet.


RE: Amazon Echo skill for Kodi - superwad - 2017-05-04

(2017-04-29, 13:48)jingai Wrote: @superwad, you downloaded wsgi.py from where exactly? That's not what you want to point Apache at anymore. As of 2.5, it's alexa.wsgi.

I swapped to alexa.wsgi as suggested, did a git pull, and everything is working again (I was getting error 500 after swapping, but before pulling changes).

Only one question remains now. I cannot tell it to navigate the video (stop, pause, whatever). It doesn't seem to have that within utterances.txt or SampleUtterances.txt. How do I do this exactly?


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

(2017-05-04, 08:14)superwad Wrote: Only one question remains now. I cannot tell it to navigate the video (stop, pause, whatever). It doesn't seem to have that within utterances.txt or SampleUtterances.txt. How do I do this exactly?

They're not in the utterances because we use the Amazon built-ins for those.

"Alexa, tell Kodi to pause/play/stop/skip/etc" works here for sure. Does it not for you?


RE: Amazon Echo skill for Kodi - superwad - 2017-05-04

Does not work. "Alexa, tell the media center to stop" gives me the help message "I can do this, that, and another thing".

I can play a movie by telling it to "play movie <name>".


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

I'm honestly not sure then. It definitely works on all three installations I have here.

Are you actually using the code as it is on Github now? You will have all sorts of weird issues if you try to mix old and new revisions like you tried to do before.

Make sure you redeploy too.

Sent from my D5803


RE: Amazon Echo skill for Kodi - superwad - 2017-05-04

I did a fresh pull last night, restarted my local Apache instance, and tried. The only file that's not bog standard is .env, which I copied from the example file and filled in my own data. I get no errors in Apache when trying to load the alexa.wsgi file, or when actually using the command.

Can I test this using the developer site to find out what's going on? What would the utterance format be? "AMAZON.StopIntent stop" doesn't work, "AMAZON.StopIntent" either. StopIntent stop same deal.


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

Did you update the Intents and Utterances on Amazon's skill development site after you updated the code locally?

And on that same site there is a simulator. You would just write, "stop".

Sent from my D5803


RE: Amazon Echo skill for Kodi - superwad - 2017-05-05

I just updated the intent schema and the utterances. "stop" in the tester works now, "Stop" does not (capitalization matters apparently?)

I'll retest in a few hours at home.


RE: Amazon Echo skill for Kodi - superwad - 2017-05-05

Looks like it's working now. Thanks @jingai!


RE: Amazon Echo skill for Kodi - vampyrex13 - 2017-05-06

Is there a way to have another Amazon Alexa also use this skill? My girlfriend and I switch between accounts on Alexa, but every time she switches to her account, I spend a couple of minutes trying to ask Alexa to control Kodi before I realize it's not in my account. It would be nice to have this dev skill work in either account.


RE: Amazon Echo skill for Kodi - jingai - 2017-05-06

Unfortunately, you need to set up a copy of the skill for each account.

Sent from my D5803