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 - stuCONNERS - 2016-11-07

no pip on libreelec


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

You can't install it?


RE: Amazon Echo skill for Kodi - stuCONNERS - 2016-11-07

nope its locked down


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

If you have another computer you can use, that might be best. You don't have to do this on the machine that runs Kodi if you're deploying to Lambda, Heroku, etc.


RE: Amazon Echo skill for Kodi - stuCONNERS - 2016-11-07

think its time to jump ship and move over to Xubuntu instead


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

I'd really like to see some people with PVRs testing @freemans13's PVR pull request. If anyone out there with a PVR wants to give it a go but doesn't know how to check it out for testing, here's what you do:

Code:
git fetch upstream pull/47/head:pr-47
git checkout pr-47



RE: Amazon Echo skill for Kodi - rlg6767 - 2016-11-10

I'll test this over the next few days.


RE: Amazon Echo skill for Kodi - nawo69 - 2016-11-10

(2016-10-31, 13:34)jingai Wrote:
(2016-10-31, 13:06)nawo69 Wrote: But I did test a few times last night and c7367ba was fine but 6307d27/1e59125 had to ask twice; though navigation commands like play/pause/stop etc did work fine first time

Would need to see the logs to verify that Kodi is actually receiving the command (put Kodi in debug mode and check its log, too).

But also, what version of Kodi are you running? We did recently switch from creating a temporary playlist to simply passing the movie ID to Player.Open, and it's possible it's got a problem in some version of Kodi.
Running latest version I have the issue with having to ask it to play episodes twice again here is a snippet of the logs; 1st time it seems to try and play as a playlist then second as regular item

1st attempt fails -Spmc log

18:20:48 T:18446744071846359680 NOTICE: EMBY.playbackutils -> Play called.
18:20:48 T:18446744071846359680 NOTICE: EMBY.playutils -> Verifying path: smb://192.168.0.13/Share/TVHD/The Blacklist/Season 04/The Blacklist - S04E01 - Esteban.mkv
18:20:48 T:18446744071846359680 NOTICE: EMBY.playutils -> Path exists.
18:20:48 T:18446744071846359680 NOTICE: EMBY.playutils -> File is direct playing.
18:20:48 T:18446744071846359680 NOTICE: EMBY.playbackutils -> Setting up properties in playlist.
18:20:48 T:18446744072040732416 NOTICE: EMBY.kodimonitor -> Method: Playlist.OnRemove Data: {"playlistid":1,"position":1}
18:20:48 T:18446744071846359680 NOTICE: EMBY.playbackutils -> Processed as a playlist. First item is skipped.

2nd attempt works – spmc log

18:23:48 T:18446744071847121408 NOTICE: EMBY.playbackutils -> Play called.
18:23:48 T:18446744071847121408 NOTICE: EMBY.playutils -> Verifying path: smb://192.168.0.13/Share/TVHD/The Blacklist/Season 04/The Blacklist - S04E01 - Esteban.mkv
18:23:48 T:18446744071847121408 NOTICE: EMBY.playutils -> Path exists.
18:23:48 T:18446744071847121408 NOTICE: EMBY.playutils -> File is direct playing.
18:23:48 T:18446744071847121408 NOTICE: EMBY.playbackutils -> Play as a regular item.
18:23:48 T:18446744072443575808 NOTICE: DVDPlayer: Opening: smb://192.168.0.13/Share/TVHD/The Blacklist/Season 04/The Blacklist - S04E01 - Esteban.mkv

Lambda log

lambda_handler: applicationId=amzn1.ask.skill.955d3c26-0489-4519-ba01-myid
Verifying application ID...
on_session_started: requestId=amzn1.echo-api.request.021e5dc7-f89f-41cb-8646-28427626327a, sessionId=amzn1.echo-api.session.341921ac-4c32-4b5a-a607-06dca0c78ed7
on_intent: requestId=amzn1.echo-api.request.021e5dc7-f89f-41cb-8646-28427626327a, sessionId=amzn1.echo-api.session.341921ac-4c32-4b5a-a607-06dca0c78ed7
Requested intent: PlayNextEpisode
Playing the next unwatched episode of the blacklist
Sending request to http://myip.no-ip.org:8080/jsonrpc
the blacklist
Sending request to http://myip.no-ip.org:8080/jsonrpc
Sending request to http://myip.no-ip.org:8080/jsonrpc
Sending request to http://myip.no-ip.org:8080/jsonrpc
Sending request to http://myip.no-ip.org:8080/jsonrpc
Sending request to http://myip.no-ip.org:8080/jsonrpc
END RequestId: 6368edd7-a772-11e6-aca1-29f22d6f8f9b
REPORT RequestId: 6368edd7-a772-11e6-aca1-29f22d6f8f9b Duration: 7208.38 ms Billed Duration: 7300 ms Memory Size: 128 MB Max Memory Used: 52 MB
START RequestId: cec3fd93-a772-11e6-a00d-69330b25bf85 Version: $LATEST
lambda_handler: applicationId=amzn1.ask.skill.955d3c26-0489-4519-ba01-myid
Verifying application ID...
on_session_started: requestId=amzn1.echo-api.request.9e9e5e72-328f-4a1c-8cfe-1fea05802d90, sessionId=amzn1.echo-api.session.myid-f30d-43d0-89d8-86ea140c6d88
on_intent: requestId=amzn1.echo-api.request.9e9e5e72-328f-4a1c-8cfe-1fea05802d90, sessionId=amzn1.echo-api.session.myid-f30d-43d0-89d8-86ea140c6d88
Requested intent: PlayNextEpisode
Playing the next unwatched episode of the blacklist
Sending request to http://myip.no-ip.org:8080/jsonrpc
the blacklist
Sending request to http://myip.no-ip.org:8080/jsonrpc
Sending request to http://myip.no-ip.org:8080/jsonrpc
Sending request to http://myip.no-ip.org:8080/jsonrpc
Sending request to http://myip.no-ip.org:8080/jsonrpc
Sending request to http://myip.no-ip.org:8080/jsonrpc
END RequestId: cec3fd93-a772-11e6-a00d-69330b25bf85
REPORT RequestId: cec3fd93-a772-11e6-a00d-69330b25bf85 Duration: 7764.54 ms Billed Duration: 7800 ms Memory Size: 128 MB Max Memory Used: 52 MB
START RequestId: d9abe48e-a772-11e6-aa2e-81330bbb78b3 Version: $LATEST
lambda_handler: applicationId=amzn1.ask.skill.955d3c26-0489-4519-ba01-myid
Verifying application ID...
on_session_started: requestId=amzn1.echo-api.request.f31d027e-fe29-414b-9c23-94dd20c5dfa2, sessionId=amzn1.echo-api.session.94dfc915-d914-45bd-b47d-ef3550154960
on_intent: requestId=amzn1.echo-api.request.f31d027e-fe29-414b-9c23-94dd20c5dfa2, sessionId=amzn1.echo-api.session.94dfc915-d914-45bd-b47d-ef3550154960
Requested intent: Stop
Stopping playback



Sent from my SHIELD Tablet K1


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

(2016-11-10, 20:55)nawo69 Wrote: 18:20:48 T:18446744071846359680 NOTICE: EMBY.playbackutils -> Play called.
18:20:48 T:18446744071846359680 NOTICE: EMBY.playutils -> Verifying path: smb://192.168.0.13/Share/TVHD/The Blacklist/Season 04/The Blacklist - S04E01 - Esteban.mkv
18:20:48 T:18446744071846359680 NOTICE: EMBY.playutils -> Path exists.
18:20:48 T:18446744071846359680 NOTICE: EMBY.playutils -> File is direct playing.
18:20:48 T:18446744071846359680 NOTICE: EMBY.playbackutils -> Setting up properties in playlist.
18:20:48 T:18446744072040732416 NOTICE: EMBY.kodimonitor -> Method: Playlist.OnRemove Data: {"playlistid":1,"position":1}
18:20:48 T:18446744071846359680 NOTICE: EMBY.playbackutils -> Processed as a playlist. First item is skipped.

Well, this explains pretty clearly why it's doing it. It thinks "smb://192.168.0.13/Share/TVHD/The Blacklist/Season 04/The Blacklist - S04E01 - Esteban.mkv" is a playlist, so it's not playing the item directly.

Unfortunately, I can't really say why it would do this, but it seems it's something Emby is deciding to do. By the time Kodi/Emby/whatever has hold of a file to play, it's got nothing left to do with the Alexa skill. Though someone else here that uses Emby may be able to help you diagnose the problem.


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

(2016-11-04, 16:22)jonjon Wrote: @CaptainMoody this has been fixed, to update you just download the zip from the repo

I don't think this has been fixed (the None issue in the URL), since I just tried to set this up today with a fresh pull from the repo and I am getting the same error. It's easy enough for me to fix locally since I have no intent of using https or the subpath option.


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

(2016-11-10, 22:41)jacobh Wrote:
(2016-11-04, 16:22)jonjon Wrote: @CaptainMoody this has been fixed, to update you just download the zip from the repo

I don't think this has been fixed (the None issue in the URL), since I just tried to set this up today with a fresh pull from the repo and I am getting the same error. It's easy enough for me to fix locally since I have no intent of using https or the subpath option.

I can't test it myself, though I did have others who use Lambda test it. Are you absolutely certain you are in fact using the latest?

In kodi.py around line 102, the SendCommand method should look like this:

Code:
# Do not use below for your own settings, use the .env file
  SCHEME = os.getenv('KODI_SCHEME')
  if not SCHEME:
    SCHEME = 'http'
  SUBPATH = os.getenv('KODI_SUBPATH')
  if not SUBPATH:
    SUBPATH = ''
  KODI = os.getenv('KODI_ADDRESS')
  if not KODI:
    KODI = '127.0.0.1'
  PORT = os.getenv('KODI_PORT')
  if not PORT:
    PORT = '8080'
  USER = os.getenv('KODI_USERNAME')
  if not USER:
    USER = 'kodi'
  PASS = os.getenv('KODI_PASSWORD')
  if not PASS:
    PASS = 'kodi'



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

Yes, this is exactly what the code looks like.

I modified the URL generation to just not use those parameters:
Code:
# Join the environment variables into a url
  url = "http://%s:%s/%s" % (KODI, PORT, 'jsonrpc')

I realize this will get overridden when I do another pull to update my code, but I was more interested in testing the whole thing out then finding a real fix.

I'm not a python guy, so I don't know if there are differences in how the '' might be interpreted. On my Lamda setup, the runtime is Python 2.7 and the handler is wsgi.lambda_handler.

I also think it's the latest because there was a change in the lambda-deploy code from when I tried this a week ago or so. This time I had to install the Visual C python compiler for it to work.


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

(2016-11-10, 22:56)jacobh Wrote: Yes, this is exactly what the code looks like.

I'm not a python guy, so I don't know if there are differences in how the '' might be interpreted. On my Lamda setup, the runtime is Python 2.7 and the handler is wsgi.lambda_handler.

They're just empty strings. It won't print them as "None" like it's doing for you.

SCHEME = os.getenv('KODI_SCHEME') will return None if it's unset, and "if not SCHEME" would/should catch that and set SCHEME to 'http'.

You could print the value of SCHEME and SUBPATH just after the os.getenv() calls and check your log if you wish to help figure out what's causing this.

(2016-11-10, 22:56)jacobh Wrote: I also think it's the latest because there was a change in the lambda-deploy code from when I tried this a week ago or so. This time I had to install the Visual C python compiler for it to work.

Yeah, because python-Levenshtein is written in C. I presume you could also install a binary package though and it should work.


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

(2016-11-10, 23:09)jingai Wrote:
(2016-11-10, 22:56)jacobh Wrote: Yes, this is exactly what the code looks like.

I'm not a python guy, so I don't know if there are differences in how the '' might be interpreted. On my Lamda setup, the runtime is Python 2.7 and the handler is wsgi.lambda_handler.

They're just empty strings. It won't print them as "None" like it's doing for you.

SCHEME = os.getenv('KODI_SCHEME') will return None if it's unset, and "if not SCHEME" would/should catch that and set SCHEME to 'http'.

You could print the value of SCHEME and SUBPATH just after the os.getenv() calls and check your log if you wish to help figure out what's causing this.

(2016-11-10, 22:56)jacobh Wrote: I also think it's the latest because there was a change in the lambda-deploy code from when I tried this a week ago or so. This time I had to install the Visual C python compiler for it to work.

Yeah, because python-Levenshtein is written in C. I presume you could also install a binary package though and it should work.

I just installed the VC python compiler and it worked fine. It wasn't complicated, but it might be worth updating the readme.

It's definitely still broken. The log from my Lambda instance was showing:
Code:
http://None:/xxx.homenet.org:3579/None/jsonrpc

I removed my actual hostname and replaced it with xxx. I think the problem is likely the http_normalize_slashes method. I'm just figuring out how to do debugging with Python, but I'll play around with a bit more tonight. If I find the problem I will submit a pull request (or paste the fix here if that's preferred).


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

Two things then:

1) Do you have KODI_SCHEME and KODI_SUBPATH defined in your .env file? Even if they're empty -- I just want to know if they're uncommented.

2) If you can put those print statements below the os.getenv() calls it will probably tell me what I need to know. I can get a pre-modified copy of kodi.py to you if you need me to.