question

Scott W. avatar image
Scott W. asked

Problem with spaces being translated

I am trying to learn the programming of this by trial and error so be patient with me :) I found an app someone else wrote that will basically allow me to send a REST API URL. It was designed to be used with HomeSeer but since all I needed was the URL's I figured I could make it work. The plan was to have EventGhost pick up the URL to control my Windows Media Center PC. I do have it working but for some reason when I have a channel with a space in it I only get the last part after the space. For example Forty Five only triggers Five. Now through the Echo app it does show properly: [b]"tell test application to go to channel forty five" [/b] In cloudwatch log I see: [b]Run Event five Requesting: /echo.html?five[/b] Here is the Function for the app that sends the URL: [b]var restPath="/echo.html";[/b] [b]function runEvent(intent, session, callback) { var eventName = intent.slots.EventName.value; var description = "Run Event "+eventName; var path = restPath+"?"+eventName; makeRequest(intent, path,description,callback); }[/b] Here is the Intent: [b] "intent": "RunEventIntent", "slots": [ { "name": "EventName", "type": "LITERAL" } ] },[/b] and finally the Sample Utterances: [b]RunEventIntent to goto {channeltwo|EventName} RunEventIntent to goto {channelteleven|EventName} RunEventIntent to goto {channelthirteen|EventName} RunEventIntent to goto {channeltwenty-four|EventName} RunEventIntent to goto {channelfourty-five|EventName} RunEventIntent to goto {channelfifty-four|EventName}[/b] The last 3 are the problem ones (the others work fine). I tried with spaces and dashes and still get the same result. Since I am so new to all of this I just don't know where to start. Thanks for any direction you can give. Scott
alexa skills kitdebugging
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Ross@Amazon avatar image
Ross@Amazon answered
Spaces should be used when defining Sample Utterance slot values. Sample Utterance examples can be found here: https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/defining-the-voice-interface#Recommendations%20for%20Defining%20the%20Sample%20Utterances
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Scott W. avatar image
Scott W. answered
Thanks Ross but I had already tried that. Whenever I have a space in the Sample Utterance: [b] RunEventIntent to goto {channel twenty four|EventName}[/b] I get this in the log: [b]2015-08-10T23:25:41.838Z 1deacb9e-3fb7-11e5-87ab-2dc4852c0d78 Run Event twenty four 2015-08-10T23:25:41.839Z 1deacb9e-3fb7-11e5-87ab-2dc4852c0d78 Requesting: /echo.html?twenty four events.js:72 throw er; // Unhandled 'error' event ^ Error: Parse Error at Socket.socketOnData (http.js:1588:20) at TCP.onread (net.js:528:27) END RequestId: 1deacb9e-3fb7-11e5-87ab-2dc4852c0d78 REPORT RequestId: 1deacb9e-3fb7-11e5-87ab-2dc4852c0d78 Duration: 239.09 ms Billed Duration: 300 ms Memory Size: 128 MB Max Memory Used: 9 MB Process exited before completing request[/b] Anywhere else I can look? Thanks for your help!! Scott Message was edited by: Scott W.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Ross@Amazon avatar image
Ross@Amazon answered
Try reformatting your sample utterances like so: RunEventIntent go to channel {two|EventName} RunEventIntent go to channel {televen|EventName} RunEventIntent go to channel {thirteen|EventName} RunEventIntent go to channel {twenty four|EventName} RunEventIntent go to channel {fourty five|EventName} RunEventIntent go to channel {fifty four|EventName} The best way to create sample utterances is by speaking to Alexa and checking to see how your speech was interpreted through http://echo.amazon.com/. A formatted text string of what Alexa heard can be seen under Settings -> History.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Naikel avatar image
Naikel answered
Definitely utterance should be: RunEventIntent go to channel {forty five|ChannelNumber} And define ChannelNumber as NUMBER not LITERAL and Alexa will do everything for you.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Scott W. avatar image
Scott W. answered
Thanks for the help. Defining it as Number over Literal helped :) Thanks again, Scott
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.