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 - 2016-11-14

@jonjon (and anyone else that wants to), could you test this branch for the environment variables defaults issue (None appearing in URL)?


RE: Amazon Echo skill for Kodi - jacobh - 2016-11-14

(2016-11-14, 17:44)jingai Wrote: @jonjon (and anyone else that wants to), could you test this branch for the environment variables defaults issue (None appearing in URL)?

I can confirm this works.

You might want to add a comment in about the AWS Lambda python interpreters strange behavior.


RE: Amazon Echo skill for Kodi - jingai - 2016-11-14

(2016-11-14, 19:00)jacobh Wrote: I can confirm this works.

You might want to add a comment in about the AWS Lambda python interpreters strange behavior.

Thanks for testing. I had planned to comment it as well, but was waiting to see if it actually worked.

I'll wait for @jonjon to test too and then merge it in.


RE: Amazon Echo skill for Kodi - Dominique - 2016-11-15

(2016-11-14, 16:50)jingai Wrote: @Dominique, is the endpoint actually accessible?

Thanks for your response. How exactly would I check that?


RE: Amazon Echo skill for Kodi - digiltd - 2016-11-15

@jingai

Yep, all good.

Tested:

Code:
# The Kodi webserver only supports HTTP.
#
# You can change KODI_SCHEME to https to tell the skill to use https (from AWS to your local network)
# It is assumed that you know what https is and that you have already set this up with your own certificates

# KODI_SCHEME = https
KODI_ADDRESS = supersecret.evenmoresecret.com
KODI_PORT = 34242
KODI_USERNAME = supersecretusername
KODI_PASSWORD = supersecretandsuperlongpassword

# If using a reverse proxy you might need to add an extra bit to the url before "jsonrpc"
#
#     KODI_SCHEME://KODI_ADDRESS:KODI_PORT/KODI_SUBPATH/jsonrpc
#
# Set this with KODI_SUBPATH (no slashes)

# KODI_SUBPATH = supersecretsubpath

SKILL_APPID = amzn1.ask.skill.123123123123123212123312312321

LAMBDA_ENV_VARS = KODI_SCHEME,KODI_ADDRESS,KODI_PORT,KODI_SUBPATH,KODI_USERNAME,KODI_PASSWORD,SKILL_APPID

AWS_DEFAULT_REGION = eu-west-1
LAMBDA_TIMEOUT = 60
LAMBDA_MEMORY_SIZE = 128
LAMBDA_HANDLER = wsgi.lambda_handler

AWS_ACCESS_KEY_ID = ABDHSDGDHSKDHSALHFDSHFDJSHFJDLKS
AWS_SECRET_ACCESS_KEY = ASDASDASDASDASDASDASDASDASDASDASD
LAMBDA_ROLE = arn:aws:iam::123123123123:role/lambda_kodi_basic_execution

Result:

Code:
Sending request to http://supersecret.evenmoresecret.com:34242/jsonrpc

Well done, cheers


RE: Amazon Echo skill for Kodi - jingai - 2016-11-15

(2016-11-15, 02:37)Dominique Wrote:
(2016-11-14, 16:50)jingai Wrote: @Dominique, is the endpoint actually accessible?

Thanks for your response. How exactly would I check that?

Hit it with a web browser -- you should get HTTP 500 (No Content) in response. The page will be empty, but if you get the right response, it's at least accessible.


RE: Amazon Echo skill for Kodi - jingai - 2016-11-15

My turn to ask a question Tongue

I've found that after some period of time, Alexa will start intercepting the basic commands (e.g., play, pause, stop, skip, etc) herself rather than passing them to the skill.

If I change the invocation of the skill, this will usually fix it for a short time, but eventually she will start intercepting them again.

I am suspecting this may have something to do with the reason Amazon requires a two-word invocation for skills. I've been keeping mine to one word (alternating between cody and kodi). Or maybe something to do with the new(ish) audio player interface they have..

Has anyone managed to get this working 100% reliably?


RE: Amazon Echo skill for Kodi - Dominique - 2016-11-16

(2016-11-15, 15:06)jingai Wrote: Hit it with a web browser -- you should get HTTP 500 (No Content) in response. The page will be empty, but if you get the right response, it's at least accessible.

Yes it was a HTTP 500 error. So what now?


RE: Amazon Echo skill for Kodi - jingai - 2016-11-16

(2016-11-16, 03:40)Dominique Wrote:
(2016-11-15, 15:06)jingai Wrote: Hit it with a web browser -- you should get HTTP 500 (No Content) in response. The page will be empty, but if you get the right response, it's at least accessible.

Yes it was a HTTP 500 error. So what now?

I'm really sorry.. I meant 502. 500 is Internal Server Error.

If 500 is actually what you got, then something is wrong with the server that isn't related to the skill.


RE: Amazon Echo skill for Kodi - Dominique - 2016-11-16

(2016-11-16, 03:45)jingai Wrote: I'm really sorry.. I meant 502. 500 is Internal Server Error.

If 500 is actually what you got, then something is wrong with the server that isn't related to the skill.

That is so funny, it is 502 and not 500.

Image


Judging from this screenshot and the other from my previous post, what is your suggestion?

By the way, I really appreciate your assistance.


RE: Amazon Echo skill for Kodi - jingai - 2016-11-16

So now we look at the logs on your server that is hosting the skill.

Make a request and then post the logs from the Heroku instance.


RE: Amazon Echo skill for Kodi - digiltd - 2016-11-16

(2016-11-15, 20:35)jingai Wrote: My turn to ask a question Tongue

I've found that after some period of time, Alexa will start intercepting the basic commands (e.g., play, pause, stop, skip, etc) herself rather than passing them to the skill.

If I change the invocation of the skill, this will usually fix it for a short time, but eventually she will start intercepting them again.

I am suspecting this may have something to do with the reason Amazon requires a two-word invocation for skills. I've been keeping mine to one word (alternating between cody and kodi). Or maybe something to do with the new(ish) audio player interface they have..

Has anyone managed to get this working 100% reliably?

It is always a struggle when trying to use these types of commands. I think it is more related to the built in intents for playback control and audioplayer rather than the invocation name.

It might be worth having a play to see if we can use these built in features for this skill. https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/custom-playbackcontroller-interface-reference

I use ha-bridge and a device (fake bulb) called "pause mode" that sends out a Harmony remote button press, but I have also had it working with JSONRPC for kodi software percentage based volume control (which works pretty well). Using "pause mode" occasionally lets me say "pause mode on" without invocation and having it as a smart device means it doesnt have to use a skill. But results are sketchy, again I think because the use of "pause". So last night I changed it to "intermission" requiring me to say "intermission on". Not really tested it though.


RE: Amazon Echo skill for Kodi - jingai - 2016-11-16

Yeah it's on my TODO list to look at the audioplayer interface. Even though we don't stream to the echo we might be able to fake it to get the other benefits.


RE: Amazon Echo skill for Kodi - BDPNA - 2016-11-17

If Alexa is 5 hours off on when my video will "end" when I ask her (and thanks to whomever added this feature, it ROCKS!!!)...How do I adjust the skill or app to make up for the 5 hour time difference? Where do I have this set wrong?


RE: Amazon Echo skill for Kodi - jingai - 2016-11-17

I need to make the time zone adjustable so that feature works properly. Working on it Smile