question

Marco avatar image
Marco asked

Custom utterance smart home skill

Good morning,

We are creating a Smart home skill to manage a customized device (a water dispenser). The device is mapped to the skill through a ModeController (which manages the type of water to be dispensed), a RangeController (which manages the dosage) and a PowerController that starts the dispensing.

Our client requested a custom utterance of the type "Alexa, dispense {dose} of {mode} water.

To use custom utterance, I thought I'd create a routine to share but I saw that in the routine I can not manage all the controllers of the device, but in my case only the PowerController. How can I manage my other Controllers?


this is my discovery response

{
    "event": {
        "header": {
            "namespace": "Alexa.Discovery",
            "name": "Discover.Response",
            "messageId": "91018b05-9462-41db-bbf1-310184b91bb3",
            "payloadVersion": "3"
        },
        "payload": {
            "endpoints": [
                {
                    "endpointId": "customEndpointId",
                    "manufacturerName": "Manufacturer",
                    "description": "Manufacturer Device",
                    "friendlyName": "test virtual device 2",
                    "additionalAttributes": {
                        "manufacturer": "Manufacturer",
                        "serialNumber": "123654",
                        "firmwareVersion": "0",
                        "customIdentifier": "customEndpointId_connectionBoard"
                    },
                    "displayCategories": [
                        "OTHER"
                    ],
                    "capabilities": [
                        {
                            "type": "AlexaInterface",
                            "instance": "Manufacturer.Dose",
                            "version": "3",
                            "properties": {
                                "supported": [
                                    {
                                        "name": "rangeValue"
                                    }
                                ],
                                "retrievable": true
                            },
                            "configuration": {
                                "supportedRange": {
                                    "minimumValue": 0,
                                    "maximumValue": 3,
                                    "precision": 1
                                }
                            },
                            "capabilityResources": {
                                "friendlyNames": [
                                    {
                                        "@type": "asset",
                                        "value": {
                                            "assetId": "Dosaggio"
                                        }
                                    },
                                    {
                                        "@type": "text",
                                        "value": {
                                            "text": "Dosaggio",
                                            "locale": "it-IT"
                                        }
                                    }
                                ]
                            },
                            "interface": "Alexa.RangeController"
                        },
                        {
                            "type": "AlexaInterface",
                            "instance": "Manufacturer.Mode",
                            "version": "3",
                            "properties": {
                                "supported": [
                                    {
                                        "name": "mode"
                                    }
                                ],
                                "proactivelyReported": true,
                                "retrievable": true,
                                "nonControllable": false
                            },
                            "configuration": {
                                "supportedModes": [
                                    {
                                        "value": "plain",
                                        "modeResources": {
                                            "friendlyNames": [
                                                {
                                                    "@type": "text",
                                                    "value": {
                                                        "text": "Liscia",
                                                        "locale": "it-IT"
                                                    }
                                                }
                                            ]
                                        }
                                    },
                                    {
                                        "value": "cold",
                                        "modeResources": {
                                            "friendlyNames": [
                                                {
                                                    "@type": "text",
                                                    "value": {
                                                        "text": "Fredda",
                                                        "locale": "it-IT"
                                                    }
                                                }
                                            ]
                                        }
                                    },
                                    {
                                        "value": "hot",
                                        "modeResources": {
                                            "friendlyNames": [
                                                {
                                                    "@type": "text",
                                                    "value": {
                                                        "text": "Calda",
                                                        "locale": "it-IT"
                                                    }
                                                }
                                            ]
                                        }
                                    },
                                    {
                                        "value": "sparkling",
                                        "modeResources": {
                                            "friendlyNames": [
                                                {
                                                    "@type": "text",
                                                    "value": {
                                                        "text": "Gasata",
                                                        "locale": "it-IT"
                                                    }
                                                }
                                            ]
                                        }
                                    },
                                    {
                                        "value": "lightSparkling",
                                        "modeResources": {
                                            "friendlyNames": [
                                                {
                                                    "@type": "text",
                                                    "value": {
                                                        "text": "Leggermente gasata",
                                                        "locale": "it-IT"
                                                    }
                                                }
                                            ]
                                        }
                                    }
                                ],
                                "ordered": false
                            },
                            "capabilityResources": {
                                "friendlyNames": [
                                    {
                                        "@type": "asset",
                                        "value": {
                                            "assetId": "Modalità"
                                        }
                                    },
                                    {
                                        "@type": "text",
                                        "value": {
                                            "text": "Modalità",
                                            "locale": "it-IT"
                                        }
                                    }
                                ]
                            },
                            "interface": "Alexa.ModeController"
                        },
                        {
                            "type": "AlexaInterface",
                            "instance": "Manufacturer.Dispenser",
                            "version": "3",
                            "properties": {
                                "supported": [
                                    {
                                        "name": "powerState"
                                    }
                                ],
                                "proactivelyReported": true,
                                "retrievable": true
                            },
                            "interface": "Alexa.PowerController"
                        },
                        {
                            "type": "AlexaInterface",
                            "version": "3",
                            "interface": "Alexa"
                        }
                    ]
                }
            ]
        }
    }
}
alexa smart homeutterancesroutines
10 |5000

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

LGSI ALEXA avatar image
LGSI ALEXA answered

@Marco We are also looking how to do custom utterance for smart home skill, .by change did you get any solution for the same? We are not able to get the routine concept what you are trying to do here , can you inform us


10 |5000

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

CodeDog@Amazon avatar image
CodeDog@Amazon answered

Hello @Marco and @LGSI ALEXA, you can add custom utterances to your Smart Home skill by adding the Custom Skill model to your Smart Home skill. Doing so will make your skill a multi-capability Smart Home skill, meaning it has the Smart Home and Custom Skill models. With the addition of the Custom Skill model, you can add a custom voice interaction model to handle utterances outside of the built-in utterances associated with Smart Home skills. You can read more information and follow instructions to upgrade to a multi-capability skill in our documentation here: https://developer.amazon.com/en-US/docs/alexa/smarthome/about-mcs.html

10 |5000

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