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 - MattDale - 2016-10-25

(2016-10-25, 12:36)jonjon Wrote:
(2016-10-25, 12:20)MattDale Wrote: I'm also able to log into Kodi via my dynamic DNS URL, so *that* seems to be OK too.

Are you able to access the JSONRPC using your ddns? e.g. superrandomname.duckdns.org:33333/jsonrpc

Also what language are you trying to set up and where are you located?

(2016-10-25, 14:21)jingai Wrote:
(2016-10-25, 12:41)MattDale Wrote: Thanks for the reply... Whilst I don't understand JSONRPC, I've entered my DDNS followed by /jsonrpc into a browser and it's come up with a lot of code, so I'd say yes to that one!

Did it prompt you for a username and password first?

Yep - and I used the same username/pass as I have for Kodi to get in.


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

@MattDale, try using curl to manually send a request; e.g., list of movies:

Code:
curl --data-binary '{"jsonrpc":"2.0", "method":"VideoLibrary.GetMovies", "params":{"filter":{"field":"playcount", "operator":"lessthan", "value":"1"}}, "id":1}' -H 'content-type: application/json;' -u username:password http://ip:port/jsonrpc

The beginning of the response should look something like this:

Code:
{"id":1,"jsonrpc":"2.0","result":{"limits":{"end":210,"start":0,"total":210},"movies":



RE: Amazon Echo skill for Kodi - MattDale - 2016-10-25

Hm. Not sure if this helps or hinders, but I've got a new error when I try that: http://pastebin.com/SXQXZ0Sy

Are we onto something?


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

Eh, did you copy and paste it, with the exception of the -u switch onward? Seems like your command line input is munged.


RE: Amazon Echo skill for Kodi - MattDale - 2016-10-25

I did. I've also tried removing the password and awaiting the prompt for it (which I got, as you'd expect) - same result. Hm! Sorry, I'm new to a lot of this so working somewhat blind.


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

I'm fairly positive you're missing the single quotes around the --data-binary argument ('{"jsonrpc":2.0"...."id":1}'), and possibly the -H argument.

I just tried it here without the quotes and get the same output you got.


RE: Amazon Echo skill for Kodi - MattDale - 2016-10-25

(2016-10-25, 15:11)jingai Wrote: @MattDale, try using curl to manually send a request; e.g., list of movies:

Code:
curl --data-binary '{"jsonrpc":"2.0", "method":"VideoLibrary.GetMovies", "params":{"filter":{"field":"playcount", "operator":"lessthan", "value":"1"}}, "id":1}' -H 'content-type: application/json;' -u username:password http://ip:port/jsonrpc

The beginning of the response should look something like this:

Code:
{"id":1,"jsonrpc":"2.0","result":{"limits":{"end":210,"start":0,"total":210},"movies":

(2016-10-25, 17:30)jingai Wrote: I'm fairly positive you're missing the single quotes around the --data-binary argument ('{"jsonrpc":2.0"...."id":1}'), and possibly the -H argument.

I just tried it here without the quotes and get the same output you got.

Definitely copy-pasting, I promise! I am using a new install of curl (never used it before) but that seemed pretty foolproof, so not sure if I could have done anything wrong there...

Image


RE: Amazon Echo skill for Kodi - Jagsta - 2016-10-25

(2016-10-25, 17:47)MattDale Wrote: Definitely copy-pasting, I promise! I am using a new install of curl (never used it before) but that seemed pretty foolproof, so not sure if I could have done anything wrong there...

Image

Are you doing this from your local windows machine? That explains why it's not taking that set of arguments I guess!

I think the idea was to try that from Heroku, to verify you are getting expected responses from your Kodi server from the place the script is running.


RE: Amazon Echo skill for Kodi - MattDale - 2016-10-25

Thanks. I am indeed trying to run this from my local machine. New to Heroku too, and can't see how I can run curl from there - all instructions for running commands seem to be pointing me back to my local CLI.


RE: Amazon Echo skill for Kodi - MattDale - 2016-10-25

Woah, hold your horses everyone, I seem to be working now!

I just reset the username and password in Heroku (I SWEAR it was right in the first place, just trying anything at this stage) and it's working now!

Thanks so much for your help everyone.


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

Now you know why devs never trust what the user says Wink

Glad you got it working!


RE: Amazon Echo skill for Kodi - Jagsta - 2016-10-25

Actually, I know nothing about Heroku either, I have no idea if they provide a shell or if this is possible using an API, it might not be.


RE: Amazon Echo skill for Kodi - digiltd - 2016-10-25

(2016-10-25, 14:45)elikiasdad Wrote: Quick question. When creating a role in AWS it wants me to select a role type. Which one do I select?

https://github.com/m0ngr31/kodi-alexa#aws-variables

Though that suggests you create the role with AWSLambdaFullAccess. I used to use this but just changed it to a AWSLambdaBasicExecutionRole and it still works ok so far.


RE: Amazon Echo skill for Kodi - MattDale - 2016-10-25

(2016-10-25, 18:25)jingai Wrote: Now you know why devs never trust what the user says Wink
Damn right!

Quote:Glad you got it working!

Now having fun with the parsing. Mostly seems sensible, although some commands are a bit screwy: "Play next episode of [x]" plays the last episode I watched, and "play latest episode of" selects a previously played episode - not figured out the logic, but it's a different one for each series.

The random play, movie play, and pause/volume/skip all working great though - so much fun!


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

(2016-10-25, 19:12)MattDale Wrote: "Play next episode of [x]" plays the last episode I watched

It should play the next unwatched episode for that series. And it does for me -- I use this one all the time. Are your shows getting marked as watched?

(2016-10-25, 19:12)MattDale Wrote: "play latest episode of" selects a previously played episode - not figured out the logic, but it's a different one for each series.

This should play the latest (as in, most recently added to library) episode of a series.


This forum uses Lukasz Tkacz MyBB addons.