• 1
  • 93
  • 94
  • 95(current)
  • 96
  • 97
  • 176
Release Kanzi: Amazon Alexa skill for Kodi
@mcl22 (and any other German speakers), I've opened an issue on github for this. Any input, help, etc should be posted there.
Reply
Hey everyone,

New to the forum and hoping I can get some help with my issue. I have tried getting this working using 3 different Windows computers, but every time I try to test the skill on the skills developer page, I get "There was an error calling the remote endpoint, which returned HTTP 500 : Internal Server Error". Alexa says "There was a problem with the requested skill's response." I have followed the readme on github and the guide on howtogeek (for more detail on running commands, mainly), but I end up in the same place every time. Did I not set up my endpoint correctly? I followed the instructions for zappa and got pretty much the same results as the tutorials. Any help is appreciated!
Reply
@aplayerg, nearly any part of the set up can cause your error. My best advice is to go through the README again very carefully, pausing whenever you're not 100% certain about something, and ask about it here.
Reply
Anyone else having trouble getting Kodi to stop? I can start media, pause is good, but stop I need to be really clear - perhaps its a single syllable thing?
I cant see an utterance for stop - is it using some default control utternaces?
Could we maybe have some added? "Stop Playing" "Stop Music", "Stop movie" etc?
Reply
We do use the default intent for Stop.

You might listen to one of the recordings and see how clear it sounds to you.

However, I do wish to continue using the built-in Intents for these because it means any tweaks Amazon makes, we get "for free."

edit: Forgot to mention, if the recordings do sound clear, you can try using Cancel instead of Stop and see if it works better for you.
Reply
So, I went through the README again and ended up with the same issue. Something just isn't clicking for me. The only thing I might question is where to save kodi.config and where to run the python commands from when using zappa. I put the (edited) kodi.config file in the folder I grabbed from git (C:\kodi-alexa-master). I ran the zappa commands in the virtual environment (command line showed (venv)) from within the kodi-alexa-master folder. To me, it looks like the zappa deploy worked correctly as my Lambda console created a kodi-alexa-master-dev Function and added a Role to the IAM user that I set up and I got the URL at the end. Then I put that URL in the Alexa Skill Configuration with HTTPS and North America selected. Do I need to set certain permissions on that page? I didn't see a mention of those in the README or howtogeek guide, so I just left them unchecked. I'm at a loss. Is there anything I can provide that may be able to narrow down where the issue is?
Reply
(2017-05-18, 20:07)aplayerg Wrote: So, I went through the README again and ended up with the same issue. Something just isn't clicking for me. The only thing I might question is where to save kodi.config and where to run the python commands from when using zappa. I put the (edited) kodi.config file in the folder I grabbed from git (C:\kodi-alexa-master). I ran the zappa commands in the virtual environment (command line showed (venv)) from within the kodi-alexa-master folder.

Yes, you did this correctly.

(2017-05-18, 20:07)aplayerg Wrote: To me, it looks like the zappa deploy worked correctly as my Lambda console created a kodi-alexa-master-dev Function and added a Role to the IAM user that I set up and I got the URL at the end. Then I put that URL in the Alexa Skill Configuration with HTTPS and North America selected. Do I need to set certain permissions on that page? I didn't see a mention of those in the README or howtogeek guide, so I just left them unchecked. I'm at a loss. Is there anything I can provide that may be able to narrow down where the issue is?

Those permissions aren't relevant to this skill.

Try to issue a request and then do:

Code:
zappa tail dev

If it's hitting the skill at all, you should see something there.
Reply
(2017-05-19, 05:50)jingai Wrote: Try to issue a request and then do:

Code:
zappa tail dev

If it's hitting the skill at all, you should see something there.

I do get something here. The only thing that stands out to me from it is a "'NoneType' object is not callable". Everything else looks like just parameters the server uses? This is the same information that I would see in the CloudWatch logs correct?

I also ran this after just doing the Testing from the Alexa Skill page and not from speaking to my echo, if that makes a difference.
Reply
I'll need to see the log then to figure out what's going on. PM me if you prefer.
Reply
By playing around with the german utterances I found something Smile It could have to do with slots not beeing "generic" as you once told me. Or it is a problem with the custom slot examples not always beeing helpful Smile

I already said that Alexa wouldn't recognize the artist "Boney M." or the album "sex sex sex". That's when I use the ListenToArtist with the utterance "ListenToArtist spiel Musik von {Artist}". I use this for Boney M. not for the album of course.
Alexa instead plays Bonnie Tyler who is part of the examples for MUSICARTISTS. The fuzzy matching is not even performed.

If I delete Bonnie Tyler it's getting worse. Trying to make Alexa/Kodi play Bonnie Tyler or Boney M. results in playing Body Count, Bon Jovi ...

But, if use the PlayMedia ("PlayMedia spiel {Movie}") by just saying "spiel Boney M." it works. In this case Alexa gives the string to the skill and the skill tries to match movies, playlists and so on until it matches the right artist.

As far as I understand it, Alexa in this example first looks for a movie title in the samples for MOVIES and can't find any similar enough to match to "Boney M.". So it gives the string to the skill and the skill does the rest. Of course this needs more time because the skill searches for movies, playlists, ...

I ask myself if it's somehow possible to make Alexa do this (just give the string to the skill) in all cases she has no 100% match in the samples? Whatver Alexa does there, the skill would be able to play the right media if Alexa did give the right information Smile
Reply
(2017-05-19, 17:54)jingai Wrote: I'll need to see the log then to figure out what's going on. PM me if you prefer.

I don't think I am able to PM yet due to my post count. Below is the log after zappa tail dev. Sorry not sure how to make it look better Sad

Code:
[1495211661987] [DEBUG] 2017-05-19T16:34:21.973Z 032d2e42-3cb1-11e7-bb7a-912b6efc9e0c Zappa Event: {u'body': u'eyJ2ZXJzaW9uIjoiMS4wIiwic2Vzc2lvbiI6eyJuZXciOnRydWUsInNlc3Npb25JZCI6IlNlc3Npb25JZC41NDJkMDVlMS1hYTA4LTQxMTEtYjQ5MS1jMzhiMTk0MWU4NTMiLCJhcHBsaWNhdGlvbiI6eyJhcHBsaWNhdGlvbklkIjoiYW16bjEuYXNrLnNraWxsLjg5MTM3NDEzLTg1OTctNDFiYS1hZTZjLWQ2ZmI1ODY0ZTYyNSJ9LCJhdHRyaWJ1dGVzIjp7fSwidXNlciI6eyJ1c2VySWQiOiJhbXpuMS5hc2suYWNjb3VudC5BRTZQU0dVQVFIVUw2U09VMkZMTTNPVkhSRFJVVktWUVdDT1JXV1dDQU1VVU1GS1lUUkhQSkRKS0RZRUhYR0paSVBRQ0M0Vk01SUlBNkxJN0QyRENRTjJBRjc0RTVOWVU3N1VTWUVYS1VPUVBVVUo2QkNMWDRJTVdNM1JGM1hISE1aRVNCWllONVE3VFdHMzRNSzZDTVI0VVdLSVZBTVdBQ1ZUTVZFM0lWWExRWVZCNkdVWlVUSFhZRkRYR1FDMjdMVzJSNk5VUk02TUhPUkEifX0sInJlcXVlc3QiOnsidHlwZSI6IkludGVudFJlcXVlc3QiLCJyZXF1ZXN0SWQiOiJFZHdSZXF1ZXN0SWQuZjFmYzFmNDEtZTE4Yy00MzFmLWFlNjItZjMzYTBjOTZiMzAzIiwidGltZXN0YW1wIjoiMjAxNy0wNS0xOVQxNjozNDoyMVoiLCJsb2NhbGUiOiJlbi1VUyIsImludGVudCI6eyJuYW1lIjoiQmFjayJ9fX0=', u'resource': u'/', u'requestContext': {u'resourceId': u'5u57lfykt7', u'apiId': u'fizqc4zx46', u'resourcePath': u'/', u'httpMethod': u'POST', u'requestId': u'0323df64-3cb1-11e7-a2e8-99b76f4de407', u'path': u'/dev', u'accountId': u'466605846552', u'identity': {u'apiKey': u'', u'userArn': None, u'cognitoAuthenticationType': None, u'accessKey': None, u'caller': None, u'userAgent': u'Apache-HttpClient/UNAVAILABLE (Java/1.8.0_112)', u'user': None, u'cognitoIdentityPoolId': None, u'cognitoIdentityId': None, u'cognitoAuthenticationProvider': None, u'sourceIp': u'73.23.237.339', u'accountId': None}, u'stage': u'dev'}, u'queryStringParameters': None, u'httpMethod': u'POST', u'pathParameters': None, u'headers': {u'Content-Type': u'application/json; charset=utf-8', u'Via': u'1.1 9e644b668b618795f8d86bdfb8b8f740.cloudfront.net (CloudFront)', u'CloudFront-Is-Desktop-Viewer': u'true', u'CloudFront-Is-SmartTV-Viewer': u'false', u'SignatureCertChainUrl': u'https://s3.amazonaws.com/echo.api/echo-api-cert-4.pem', u'CloudFront-Is-Mobile-Viewer': u'false', u'X-Forwarded-For': u'73.23.237.339, 53.233.345.35', u'CloudFront-Viewer-Country': u'US', u'X-Forwarded-Port': u'443', u'Accept': u'application/json', u'User-Agent': u'Apache-HttpClient/UNAVAILABLE (Java/1.8.0_112)', u'X-Amzn-Trace-Id': u'Root=1-591f1e8d-1664a87626f9de571f9167ea', u'Accept-Charset': u'utf-8', u'Host': u'fizqc4zx46.execute-api.us-east-1.amazonaws.com', u'X-Forwarded-Proto': u'https', u'X-Amz-Cf-Id': u'J5wKS4xwLnYqPda0JjEGoKGAHhwFB1U0hxSALSdRh8V8pjswDHrI7Q==', u'CloudFront-Is-Tablet-Viewer': u'false', u'Signature': u'GBW+eNqrZDzHLRgSadoueiLKTQsR0lzP4Ih0C298RG79IJx/odffdrYAxPHf5M0H6yNmnTHOmPqaJL+RV1mSRMcSwxXb8dmpuct92vX3JInuRqBo4GN/xp0an5vcdj+A8+C1RzX5J8kFGX6XFo+uvhGH/cf8lHGopsTAuUqhjSGMbQ1QkEMq4i/+ZPPxmNFdSoCH8beFczsRWR3ni/AVSvPNl7VLfGqyrbNqICKyLucXcWOBJPu3ycKUBQszB5gVYNE9ak3TVMlKjd6JCPxJy+5FZtZNuCVjgqYavCVR2piMeXbiLPoTGvfIbdWH8acdhg1aSmx/hv1sY7KKdFrdHw==', u'CloudFront-Forwarded-Proto': u'https'}, u'stageVariables': None, u'path': u'/', u'isBase64Encoded': True}
[1495211661987] 'NoneType' object is not callable
[1495211746287] [DEBUG] 2017-05-19T16:35:46.268Z 35632f59-3cb1-11e7-ac5f-47259560c847 Zappa Event: {u'account': u'466605846552', u'region': u'us-east-1', u'detail': {}, u'detail-type': u'Scheduled Event', u'source': u'aws.events', u'version': u'0', u'time': u'2017-05-19T16:35:45Z', u'id': u'2d46d010-e719-4117-945c-0f667c61f672', u'resources': [u'arn:aws:events:us-east-1:466605846552:rule/kodi-alexa-mast-dev-zappa-keep-warm-handler.keep_warm_callback']}
[1495211746287] [DEBUG] 2017-05-19T16:35:46.268Z 35632f59-3cb1-11e7-ac5f-47259560c847 Zappa Event: {}
[1495211986147] [DEBUG] 2017-05-19T16:39:46.130Z c43c8d77-3cb1-11e7-aca8-8166c93b061d Zappa Event: {u'account': u'466605846552', u'region': u'us-east-1', u'detail': {}, u'detail-type': u'Scheduled Event', u'source': u'aws.events', u'version': u'0', u'time': u'2017-05-19T16:39:45Z', u'id': u'd6655249-2c69-4d48-a7fd-738674c7801d', u'resources': [u'arn:aws:events:us-east-1:466605846552:rule/kodi-alexa-mast-dev-zappa-keep-warm-handler.keep_warm_callback']}
[1495211986147] [DEBUG] 2017-05-19T16:39:46.131Z c43c8d77-3cb1-11e7-aca8-8166c93b061d Zappa Event: {}
Reply
@mcl22, yes, that sounds like the Slot doesn't have enough items to be converted to generic. Play works because it passes only MOVIES in, and fuzzy matches everything.

Unfortunately, as far as I know, Amazon doesn't give us a way to force a slot generic.

Sent from my D5803
Reply
@mcl22 what is alexa hearing when you look in the alexa app / settings / history ? Does she hear boney m? Do you ever go through and mark cards yes and no when it says "did alexa do what you wanted?" Doing that really does help her understand you better as it learns the sounds you make. Deleting your voice recordings history does remove all the learning though.
Reply
In those cases when she plays bonnie tyler instead of boney m. the app also tells me bonnie tyler. That's what I meant. She "decides" herself.
When using play she (in this case) can't match anything and gives the heard string to the skill. And then the skill tries to match the right thing. And in these cases one can also see that Alexa actually understood me right. The app history tells boney m. (even with the dot after the m) and the skill log does, too.
But going through the cards is a good advice. I'm gonna do that more often now.

@jingai, so is there no way to do anything about it? Perhaps by adding more samples to the slots or something else? Just want to know if I can do something to help (I guess others are going to run into this problem, too).

By using "play" I for the first time really realized how good Alexa could understand me. Before I always thought she doesn't do the right thing because she didn't understand me correctly or because the artist name is too complicated.
Now I see that she can understand things like boney m. or even blink-182. And also in Germany you say blink one eighty two and she performs right.

But just to show how far this goes. The problem seems to exist for all slots. That's why I actually can't use something like "play album from artist". Some example: "Alexa, ask kodi to play album dopamin by böhse onkelz". An error occurs because she matches böhse onkelz but not an album called "do or die" by böhse onkelz. When trying to play the album "Schwarz" she tries "Schlachtenlärm" by another artist. And so on. She'd rather take something from the samples even if it's not even close to similar to what I said than passing the string to the skill. That happens for movies, too.

If I only say "spiel das album schwarz" without an artist, she chooses the album swagger. If I try the same sentence on the testing platform it succeeds but the log say "searching for album schwartz" with a "t" so the fuzzy matching is needed. Schwarz without the "t" as written in the test would be a simple match.
Although theres this different behavior between the written test and my spoken words it can't be about my pronounciation or something because if I just say "Alexa was ist schwarz" (what is black) she gives me an answer and the app tells me that she understood "was ist schwarz".

And one more thing Smile The umlaut problem is solved. But we do have another special character in german, the "ß". And I do again get the UnicodeEncodeError in the log when trying to call something including a "ß". And this can happen pretty often because the character is used in words like weiß (white) or daß (that).
Reply
(2017-05-20, 08:02)mcl22 Wrote: In those cases when she plays bonnie tyler instead of boney m. the app also tells me bonnie tyler. That's what I meant. She "decides" herself.
When using play she (in this case) can't match anything and gives the heard string to the skill. And then the skill tries to match the right thing. And in these cases one can also see that Alexa actually understood me right. The app history tells boney m. (even with the dot after the m) and the skill log does, too.
But going through the cards is a good advice. I'm gonna do that more often now.

There are many layers involved here, and maybe it'd be easiest if I tried to explain the path:

1) Transcription. Alexa first tries to transcribe what you said, just outputting a text string. When we (the devs) ask you, "What did Alexa hear?" this is what we're referring to. You can see how she transcribed it by going to the Alexa App > Settings > History. If at this point, she heard "bonnie tyler," then she simply misunderstood you, but there is nothing we (the skill developers) can do about it. From our skill's perspective, playing "bonnie tyler" would be the correct thing to do because that's what it was instructed (by Alexa, not you) to do.

2) Action mapping. Alexa then tries to determine where to send your phrase for further processing. In our case, she sees a fragment that looks something like, "tell kodi to". She then knows to send the phrase to our skill's interaction model . Note the important distinction here -- we are not yet at the skill's main code, which resides on the skill server.

3) Utterance/Intent mapping. Within the interaction model, she tries to determine what your 'Intent' was by matching against the example Utterances in the skill's model. Note that this is not just a direct, 1:1 match -- she simply treats the phrases in the model as examples and picks the Intent that most closely matches.

4) Slot matching. If the example utterance she chose contains one or more Slot references, she tries to replace them with strings from items within the referenced Slots. If the referenced Slot contains too few items to be considered "generic," she will simply look for the best match and pass it along to the skill server, but if nothing matches at all, she passes None. If the Slot is "generic," she will do the above, but instead of passing None, she will pass the original transcribed text instead. Note: I don't have proof of this, but in my experience, the requirement for the first kind of match is more lenient than the second. Meaning, she is more likely to pop out "something" from the first, even if it's not very close at all, rather than just failing (outputting None).

5) Processing the Intent. Alexa sends a JSON object to the skill server that instructs us how to handle the request. We are now in the main skill code. First, the skill matches the Intent and extracts the Slot references, and passes these to the appropriate Intent handler. If your request is to play media, it requests the list of media of that type(s) from Kodi, and tries first to do a direct comparison of the transcribed text against the list from the library. If this fails, we do a second pass with a fuzzy match, succeeding if the match is >= 75% 'alike'.

The important takeaway here is that up until step 5, we're not yet even in the skill's code. It's true that the interaction model is "part" of our code, and there are ways that we can break this part, but in your case, this isn't likely what is happening.

To diagnose problems with matching, you need to look in different places depending on where the failure occurred:

1) Transcription. Look in the Alexa App under Settings > History and see what she actually heard you say. If it is nothing like what you asked for, there is nothing we (the skill developers) can do in the skill to correct this. The best you can do is try to speak more clearly; use the voice training function in the Alexa App; or provide feedback on the Card that was produced ("No, she did not hear me correctly"). On that last point, it additionally helps to "reward" her with a "Yes, she heard me correctly" when she does do the right thing.

2) Action mapping. If she decides to send your request to something other than the Kodi-Alexa interaction model, there is again nothing we can do about this.

3) Utterance/Intent mapping. If this goes wrong, she will instruct our skill to do something other than what you intended. To check this, you can look at the logs on the skill server -- we print a bit about the incoming request there. As for correcting the problem, it's probable that you just tried to request an Intent in such a way that we didn't consider. This can possibly be fixed by adding more example utterances to catch the way that you said it, but it should be noted that we have to take great care here to not introduce conflicts with other requests. A lot of our requests are very, very similar, so this is delicate to balance.

4) Slot matching. You can see this in the skill server's logs. There are some limitations here that we can't really overcome. First, we depend on the transcription to be reasonably close to the title of the library item in Kodi (e.g., "bat out of hell 2" vs "bat out of hell 2 back into hell"). Second, if she simply heard the wrong thing entirely, the skill will still (correctly) try to do what it was told. And finally, our fuzzy matcher is not content-aware; that is, it's only trying match the two strings together. This could be better if we had access to a database that could give us alternative strings to match with, but we don't have that (yet, hopefully). For example, the skill has know way of knowing that, "tupac" or "too pack," as Alexa might hear it, can also be "2pac".

5) Processing the Intent. Any errors that occur here will be visible in the skill's server logs, and your best bet is to post them here or PM us.

(2017-05-20, 08:02)mcl22 Wrote: @jingai, so is there no way to do anything about it? Perhaps by adding more samples to the slots or something else? Just want to know if I can do something to help (I guess others are going to run into this problem, too).

At this point, we pretty much depend on the slots being 'generic,' so they should have >= ~200 items. The exact number is not disclosed by Amazon, unfortunately. We chose 300 in the slot generator to provide some pad.

But, if you don't have enough in your library to populate a slot to the point where it becomes 'generic,' it means we really purely on the direct matching in the interaction model against the slot items provided there. No fuzzy matching (by our skill code) will occur.

In order for us to (potentially) provide help, we (the skill devs) would need to first see the exact, transcribed text that Alexa heard. Second, we'd need to know what Alexa passed to the skill server (in the skill server logs, you'll see something like, "Trying to match: foo"). Finally, we'd need to see what the skill chose to play instead -- if anything.

This boils down to:

1) Send us the transcribed text from the Alexa App,
2) Send us the skill server's log from the time pertaining to this request.

(2017-05-20, 08:02)mcl22 Wrote: But just to show how far this goes. The problem seems to exist for all slots. That's why I actually can't use something like "play album from artist". Some example: "Alexa, ask kodi to play album dopamin by böhse onkelz". An error occurs because she matches böhse onkelz but not an album called "do or die" by böhse onkelz. When trying to play the album "Schwarz" she tries "Schlachtenlärm" by another artist. And so on. She'd rather take something from the samples even if it's not even close to similar to what I said than passing the string to the skill. That happens for movies, too.

If the slot isn't 'generic,' she's more lenient with the choice. She "tries harder" to match with one of the slot items she already knows about.

If the skill could fuzzy match, you'd get better results. But as I described above, it still isn't perfect and won't be unless we get access to a database that can provide us with a list of alternate titles.

(2017-05-20, 08:02)mcl22 Wrote: If I only say "spiel das album schwarz" without an artist, she chooses the album swagger. If I try the same sentence on the testing platform it succeeds but the log say "searching for album schwartz" with a "t" so the fuzzy matching is needed. Schwarz without the "t" as written in the test would be a simple match.
Although theres this different behavior between the written test and my spoken words it can't be about my pronounciation or something because if I just say "Alexa was ist schwarz" (what is black) she gives me an answer and the app tells me that she understood "was ist schwarz".

It still can be about your pronunciation (computers don't 'hear' like we do), but also about context. The interaction model for the skill provides her with more context, so she weighs what you said with schwartz more heavily here due to it.

The bottom-line is.. all of this is a lot more complex than people think. There's a lot that goes on before she answers your request Smile

(2017-05-20, 08:02)mcl22 Wrote: And one more thing Smile The umlaut problem is solved. But we do have another special character in german, the "ß". And I do again get the UnicodeEncodeError in the log when trying to call something including a "ß". And this can happen pretty often because the character is used in words like weiß (white) or daß (that).

Thanks for bringing that to my attention. I'm working right now on cleaning up the unicode handling in the skill. I'll make sure to test this.

edit: It would help if you could post the exact phrase you used so I can try something similar here. A log showing the error would also be very helpful.
Reply
  • 1
  • 93
  • 94
  • 95(current)
  • 96
  • 97
  • 176

Logout Mark Read Team Forum Stats Members Help
Kanzi: Amazon Alexa skill for Kodi15