Announcement: The Alexa Skills Community Is Moving To Stack Overflow

For improved usability and experience, Alexa skills related forum support will be transitioned to Stack Overflow. Effective January 10, 2024, the Amazon Developer Forums will no longer be available. For continued Alexa skills support you can reach out to us on Stack Overflow or via Contact Us.

question

Steve A avatar image
Steve A asked

TIME slot

I'm having a very difficult time getting the Echo to recognize TIME slots. The program I'm writing does more advanced control of Hue lights (colors, scenes, dynamic effects), etc. Everything works fine but scheduling. And it's because Alexa just passing along information in the TIME slot. Among the intents is: { "name": "Time", "type": "TIME" }, A sample utterance might be: ControlLights turn the {floor lights|Lights} {off|State} at {four thirty|Time}. But the Echo just won't pick up the Time slot if used in combination with any other slot. (If I just say a time, Alexa recognizes it as a time.) It doesn't seem to matter how many examples I give, either of times alone, or in combination with other slots. Oddly (and sadly), the app actually works better with just one slot that takes arbitrary text. So, a version of the app that is structured with a few examples like this: ControlLights {change the table light to the color blue at seven thirty|String} ControlLights {turn off the kitchen lights|String} performs much better than when I slot everything (and have my app do the relevant parsing of the string.) Any thoughts? Anyone else having trouble with a TIME slot? Also, does anyone know the correct format for times like 1:04 or 2:05? I assume it's {one oh four|Time} and {two oh five|Time} ....but it's not documented.
alexa skills kitvoice-user interface
10 |5000

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

Steve A avatar image
Steve A answered
And it's because Alexa just *isn't* passing along information in the TIME slot...
10 |5000

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

The Stig avatar image
The Stig answered
[i]Any thoughts? Anyone else having trouble with a TIME slot?[/i] Have you tried doing: ControlLights turn the {floor lights|Lights} {off|State} [b]and[/b] at {four thirty|Time}. I know that doesn't make sense when you say it out loud, but Echo uses AND to accept multiple slots at once (source: the Favorite Color sample app). I know this isn't the ideal solution, but if it works - then we know that the issue [i]Also, does anyone know the correct format for times like 1:04 or 2:05? I assume it's {one oh four|Time} and {two oh five|Time} ....but it's not documented. [/i] I swear I read the format for this just the other day (could be crazy though). I'll look for it and post back whether I was able to find it or not. Best of luck with your app!
10 |5000

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

The Stig avatar image
The Stig answered
[i]Also, does anyone know the correct format for times like 1:04 or 2:05? I assume it's {one oh four|Time} and {two oh five|Time} ....but it's not documented.[/i] Here's what I found: - Numbers should be expressed as words and not digits (“five”, not “5”). - Acronyms and other phrases involving spoken letters should be separated by periods and spaces (“p. m.”, not “pm”). - Punctuation marks should not be included except in the special cases listed below. (“ten dollars”, not “$10”. “three point five stars”, not “3.5 stars”). Taken from the "The Sample Utterances File" section on this page: https://developer.amazon.com/public/solutions/devices/echo/alexa-app-kit/docs/defining-the-spoken-language-interface-for-an-alexa-app This makes me believe that [i]{one oh four|Time} and {two oh five|Time}[/i] are correct. However, I'm not sure if you need to specifiy AM / PM in the request or if Alexa would just apply it to the next time 1:04 happens. Regardless if it's AM or PM. Message was edited by: RJ S.
10 |5000

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

Steve A avatar image
Steve A answered
RJ S, Thanks...this got me on the right track. I tried your suggestion -- {kitchen lights|Lights} {on|State} and at {nine oh three|Time} -- and it helped. Alexa started picking up time slots, but oddly, only one and two word times (five, and five thirty, but *not* five thirty six.) Moving the Time slot to the start of the utterance, e.g., at {five oh three|Time} turn {on|State} the {kitchen lights|Lights}, works perfectly. (No need for "and"). I'm not sure if this is working as expected, or there are still some wrinkles to be ironed out with Time slots Thanks so much! Steve p.s. This also clears up the correct format for times like 9:05 -- {nine oh five|Time} is correct.
10 |5000

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

The Stig avatar image
The Stig answered
Glad to help Steven, If I may, how'd you get Alexa to remember the time after the session closes? Or does Alexa pass the time onto IFTT (or another 3rd party app/program).
10 |5000

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

Steve A avatar image
Steve A answered
The scheduling information is stored on the Hue bridge on my local network (I've set up a secure tunnel to my local network so Alexa has access to the bridge. This obviously won't work for a proper app...but it works for proof of concept stuff.) Thanks again! Steve
10 |5000

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

Fawn@Amazon avatar image
Fawn@Amazon answered
Hi Steven, Do you have many more examples in your training data that have one or two word times, as opposed to three words? If you have an unbalanced set of examples, the model may learn to prefer one or two words for the slot as opposed to putting in all three in that sentence position. Adding more examples should hopefully help! Best, Fawn
10 |5000

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

Steve A avatar image
Steve A answered
Fawn, Thanks for following up. I had an equal number of each (25) sort of time (one-, two-, and three-word times.) In any event, Alexa began picking up three-word times without any change to the sample utterances as soon as I moved the TIME slot to the beginning of the utterance: at {two thirty nine|Time} do {foo|Bar} vs. do {foo|Bar} at {two thirty nine|Time}. It's weird! Steve
10 |5000

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

Fawn@Amazon avatar image
Fawn@Amazon answered
Thanks for the info Steven. It is strange that it is working in one position but not the other. I would suggest adding even more examples with three word times at the end of the phrase to see if you can push the models into accepting that number of values in the slot. If you could, I would suggest adding about 30-50 more three word times at the end of the utterances to see if that helps. Best, Fawn
10 |5000

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