2
votes

I'm creating a skill that allows Alexa to first consult all the connected devices (air conditioning equipment for example) and it returns a list from a service (these names are customizable by the user). I need those device names to store them as values of a custom Slot, to be able to give orders to Alexa of the type: Alexa, tell me the temperature of {deviceName}.

Any ideas or suggestions?

3
Is your question about how to get the list of connected devices or just custom slots or both?johndoe

3 Answers

1
votes

Use alexa dialogs and when the dialogState != 'COMPLETED' check the value of {deviceName} slot and if it is not in the list elicit the slot again with proper response. Do something like this:

if (dialogState === 'STARTED') {
    return handlerInput.responseBuilder
        .addDelegateDirective()
        .getResponse();
}
else if (dialogState !== 'COMPLETED') {
    if (intent.slots.deviceName.value) {
        if ( //check if the deviceName is not in the list ) {
            return handlerInput.responseBuilder
                .speak('Sorry, this device is not added in your list, say again...')
                .addElicitSlotDirective(intent.slots.deviceName.name)
                .getResponse();
        }
        else {
            return handlerInput.responseBuilder
                .addDelegateDirective()
                .getResponse()
        }
}
else {
    //dialogState is 'COMPLETED'
    //here you have the correct device name
}
1
votes

There is no way to do the dynamic slots in the Alexa Skills. The slot values in the live skill can be updated only after the interaction model building and successful skill certification.
The Dialogflow API allows updating slot values dynamically
Hope Amazon Will add something similar soon.

0
votes

Now Alexa has possibility to use Dynamic Entities.