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-08-31

(2017-08-31, 16:05)ziggy73701 Wrote: Hello!!! Am getting

File "generate_custom_slots.py", line 81
print 'Writing: %s' % (filename)
^
SyntaxError: invalid syntax

When running python generate_custom_slots.py should I be adding something else?

Use Python 2.x -- not Python 3 -- as the README states at the top.


RE: Amazon Echo skill for Kodi - jingai - 2017-08-31

(2017-08-31, 16:01)simon_rb Wrote:
(2017-08-31, 15:56)jingai Wrote: @simon_rb, I'm not sure what you mean exactly. If you give me an example of what you're looking for I can answer more thoroughly, but in general no, you cannot just add your own utterances and expect them to do something.

You can add alternative phrasing for existing utterances, but it's all a delicate balance to avoid conflicts with others, so you'd be better off suggesting what you'd like to see either here or on Github as an Issue.

I have a customer keyboard.xml. Two of those commands, first is to set 3D mode in kodi and the other is audiotoggledigital which changes the audio toggle from pass through to not pass through.

I assume I can add audiotoggledigital to the Sample Utterances? Or is that not how it works?

Code:
audiotoggledigital change passthrough
audiotoggledigital change audio settings
audiotoggledigital disable passthrough
audiotoggledigital enable passthrough
audiotoggledigital toggle passthrough
audiotoggledigital toggle audio

No, that is only a small part of it -- you'd also have to write the code to handle it.

The stuff on the skill builder site is just the skill model. The actual code to handle executing the Intents is all in the code you pushed up to AWS with Zappa.

And -- please don't take this the wrong way, but it's hard enough to support this as it is -- if you make local changes to the skill, we (the developers) will expect you to revert those for support in the future.


RE: Amazon Echo skill for Kodi - simon_rb - 2017-08-31

Ah ok, worth a request on GitHub then lol.

Thank you so much.


RE: Amazon Echo skill for Kodi - jingai - 2017-08-31

@simon_rb, your particular request as it is won't really fly, just FYI, because they are custom commands. Doing what you want in a generic way that would work for other users would be a lot more involved.


RE: Amazon Echo skill for Kodi - simon_rb - 2017-08-31

(2017-08-31, 16:14)jingai Wrote: @simon_rb, your particular request as it is won't really fly, just FYI, because they are custom commands. Doing what you want in a generic way that would work for other users would be a lot more involved.

Whoops, I have just put it on there. They are genuine commands that can run. Ive only mapped them in the keyboard.xml so I can execute them from my remote rather than going through menus.

Its on GitHub anyways. If its not worth the effort then thats COMPLETELY understandable. You have helped enough! Big Grin


RE: Amazon Echo skill for Kodi - jingai - 2017-08-31

What I meant was specifically what you're asking for probably won't happen; that is, allowing users to add arbritrary utterances/intents to bind to custom actions.

If it can be done in a generic fashion via JSON-RPC, we'll consider adding any new Intents, though. There is GUI.SetStereoscopicMode that we could use.

It looks like we can use Input.ExecuteAction with "audiotoggledigital" as the param to toggle passthrough.


RE: Amazon Echo skill for Kodi - sparky0820 - 2017-08-31

(2017-08-31, 16:06)jingai Wrote: [quote='sparky0820' pid='2640320' dateline='1504187840']
Do I just redo all of this on the machine, or do I need to uninstall python and start over?

All of those commands are intended for developers, and any of them can fail. Unfortunately, I cannot tell you where you went wrong without seeing the output from all of them. If you're really stuck, it might be best to start over and copy/paste the terminal output here (redacting your secrets/personally-identifying information, of course) so we can see what you're doing wrong.

I went through all the steps again, and I didn't get a single error. It did generate a new execute api, so I updated the Alexi skill. It now, gets a new error (502: bad gateway). The logs are still saying unable to import module 'handler'.

I even tried to start all over by uninstalling Python, but when I did the zapa init it already had all my information in there. Feel like I've messed this up to the point where I can't succeed.


RE: Amazon Echo skill for Kodi - simon_rb - 2017-08-31

(2017-08-31, 16:31)sparky0820 Wrote:
(2017-08-31, 16:06)jingai Wrote: [quote='sparky0820' pid='2640320' dateline='1504187840']
Do I just redo all of this on the machine, or do I need to uninstall python and start over?

All of those commands are intended for developers, and any of them can fail. Unfortunately, I cannot tell you where you went wrong without seeing the output from all of them. If you're really stuck, it might be best to start over and copy/paste the terminal output here (redacting your secrets/personally-identifying information, of course) so we can see what you're doing wrong.

I went through all the steps again, and I didn't get a single error. It did generate a new execute api, so I updated the Alexi skill. It now, gets a new error (502: bad gateway). The logs are still saying unable to import module 'handler'.

I even tried to start all over by uninstalling Python, but when I did the zapa init it already had all my information in there. Feel like I've messed this up to the point where I can't succeed.

I spent all yesterday trying to get this to work. Spent 10 mins this morning following the below guide (just to get there server side working) on a windows machine. I had a similar if not the same error as you until I tried below.

Worth a shot?

https://www.howtogeek.com/249336/how-to-control-your-kodi-media-center-with-an-amazon-echo/


RE: Amazon Echo skill for Kodi - jingai - 2017-08-31

I checked that guide against our README, and there's nothing different in the skill deployment commands. I can promise without a doubt that our README in its current state is all correct -- I just went through it again from scratch here and everything deployed fine.

The only difference for Windows is how you activate the virtualenv, but we cover that in the README as well.

Further, he makes incorrect statements regarding the slots -- you should always use the slots that our generator produces.

But honestly, I do agree that our README could be more detailed in certain areas. The author of that guide really should submit a PR to clean up the documentation, but he won't do that because that doesn't generate revenue for him.


RE: Amazon Echo skill for Kodi - simon_rb - 2017-08-31

(2017-08-31, 16:43)jingai Wrote: I checked that guide against our README, and there's nothing different in the skill deployment commands. I can promise without a doubt that our README in its current state is all correct -- I just went through it again from scratch here and everything deployed fine.

The only difference for Windows is how you activate the virtualenv, but we cover that in the README as well.

Further, he makes incorrect statements regarding the slots -- you should always use the slots that our generator produces.

But honestly, I do agree that our README could be more detailed in certain areas. The author of that guide really should submit a PR to clean up the documentation, but he won't do that because that doesn't generate revenue for him.

Ah never noticed the slots issue. I didn't use it for that part. I only used it for the server part.I tried two raspberry pis and ubuntu and none of the three worked. The Windows way worked first time.


RE: Amazon Echo skill for Kodi - jingai - 2017-08-31

The values in the slots are more nuanced than that author realizes. To get Alexa to pump out a literal transcribed string at the end depends several things, such as number of values provided and the distribution of the string lengths (by number of words). His suggestion that people simply manually type in 20-30 values can work, but it's very likely to either not work as well, or even not at all.

There really is no "windows way," other than the one caveat I mentioned. All of the other commands are identical on the various platforms. The fact that you got it to work under Windows may simply boil down to you being more comfortable with that platform, or simply executing something in a subtly different way that you didn't realize before.

I understand the howtogeek article provides more detail for things such as creating the initial AWS account, setting up dynamic DNS, etc, but the problem with people using 3rd-party guides for something as complex as this is that if we change how something works, we cannot guarantee that the 3rd-party guide authors will follow suit (and do it correctly).

HowToGeek seems to have been keeping up, but I imagine they won't do that indefinitely. Hence, the "right answer" is for that author to submit a pull request to get the official documentation cleaned up. But I've already indicated why they didn't do that in the first place Wink

FWIW, it's on my TODO list to clean up the official documentation, but obviously new features are far more exciting to work on, and this is something I do for fun, after all.


RE: Amazon Echo skill for Kodi - simon_rb - 2017-08-31

Well said jingai, I already had all of it setup. Just getting Zappa to upload the code was my issue. No idea why.

But hey, its working and hopefully the others with the issues will get it working soon too.

Shame there is no auto script that can be made to set Zappa up. Too many variables and different systems I guess Big Grin


RE: Amazon Echo skill for Kodi - jingai - 2017-08-31

It could probably be automated, but there's a lot of error cases to handle and it pretty much falls under the same category as cleaning up the documentation -- dull, tedious work Smile


RE: Amazon Echo skill for Kodi - sparky0820 - 2017-08-31

(2017-08-31, 16:37)simon_rb Wrote:
(2017-08-31, 16:31)sparky0820 Wrote:
(2017-08-31, 16:06)jingai Wrote: [quote='sparky0820' pid='2640320' dateline='1504187840']
Do I just redo all of this on the machine, or do I need to uninstall python and start over?

All of those commands are intended for developers, and any of them can fail. Unfortunately, I cannot tell you where you went wrong without seeing the output from all of them. If you're really stuck, it might be best to start over and copy/paste the terminal output here (redacting your secrets/personally-identifying information, of course) so we can see what you're doing wrong.

I went through all the steps again, and I didn't get a single error. It did generate a new execute api, so I updated the Alexi skill. It now, gets a new error (502: bad gateway). The logs are still saying unable to import module 'handler'.

I even tried to start all over by uninstalling Python, but when I did the zapa init it already had all my information in there. Feel like I've messed this up to the point where I can't succeed.

I spent all yesterday trying to get this to work. Spent 10 mins this morning following the below guide (just to get there server side working) on a windows machine. I had a similar if not the same error as you until I tried below.

Worth a shot?

https://www.howtogeek.com/249336/how-to-control-your-kodi-media-center-with-an-amazon-echo/

I tried that one originally, just never got it to succeed. Not sure what to try at this point. Every time I uninstall and start over, it seems like all my settings are already there and it's not actually doing anything other than setting myself up for the 502: Bad Gateway or 500: internal server error


RE: Amazon Echo skill for Kodi - sparky0820 - 2017-08-31

I'm making progress. Now I'm getting some things happening when testing it out. I'm having issues when trying to play specific episodes of TV shows. For example:

Ask Kodi to watch Season 5 Episode 3 of Srubs I get the internal 500 error.

Thoughts?


This forum uses Lukasz Tkacz MyBB addons.