Most issues that arise while developing a smart home skill can be easily resolved by testing and troubleshooting. This blog will cover issues regarding unsuccessful device discovery, devices not responding to directives, and supported utterances for different devices.
If a customer enables your skill and starts the discovery process by saying, “Alexa, discover my smart home devices” or clicking “Discover Devices” on the Alexa app but no devices are discovered, it’s likely that your skill’s response to the Discover directive is incorrectly formatted. Here are some tips on troubleshooting the discovery response:
You may encounter an issue where you have successfully tested discovery for your multi-locale skill, but the skill fails certification due to devices not being able to be discovered in a specific region. If the skill is unable to discover any devices for a specific region, this could be the result of one of the following:
If you are able to control your devices but Alexa is returning a “<device name> is not responding” message, it’s likely that your Lambda function did not send a confirmation that the directive was handled. As Alexa generally waits 8 seconds for your response before timing out, your Lambda function must also respond to Alexa within 8 seconds. Here is an example of a request where a customer hears the error message, but the light turns on:
If steps 4-7 takes more than 8 seconds, the customer will hear the “Sorry, <device name> is not responding” message, even though the light is turned off. If the Lambda function's execution time is set to the default 3 seconds and step 6 takes more than 3 seconds, the device cloud will have controlled the device but the Lambda function will have timed out, resulting in no response send to Alexa at step 7. To resolve this issue, ensure that the maximum execution time on your Lambda function is set to 8 seconds, while also checking that your device cloud is responding promptly and not causing the Lambda function to respond to Alexa after 8 seconds.
Compare your JSON response to sample documentation. Depending on the controller, the formatting of the payload may be slightly different - ensure that spelling and case of each payload parameter, the structure of the objects within the payload object, as well as the spelling of the namespace and name parameters within the header object matches the documentation. Copying the sample and modifying it so that it works for your device is the simplest way to ensure the correct format.
For example, a sample format for the AdjustTargetTemperature from the ThermostatController can be found here, which shows the exact format of the payload, which includes the targetSetpointDelta object.
{
"directive": {
"header": {
"namespace": "Alexa.ThermostatController",
"name": "AdjustTargetTemperature",
"messageId": "<message id>",
"correlationToken": "<an opaque correlation token>",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "<an OAuth2 bearer token>"
},
"endpointId": "<endpoint id>",
"cookie": {}
},
"payload": {
"targetSetpointDelta": {
"value": -2.0,
"scale": "CELSIUS"
}
}
}
}
Use the Smart Home Test tool which provides automated tests for the following Alexa interfaces:
Report all properties required in the StateReport. For example, In a thermostat that implements the TemperatureSensor and ThermostatController, you would want to report the “temperature” property of the TemperatureSensor as well as all of the properties defined in discovery for the ThermostatController such as: thermostatMode, targetSetpoint, lowerSetpoint and upperSetpoint.
You may find that certain utterances can be used to control a device that has implemented a specific interface, but similar sounding utterances might not. The Utterances section listed on the documentation for each controller should be used when testing your smart home skill. As long as you have implemented the interface correctly, those utterances should work for your device. For example, in the ThermostatController documentation, Utterances section lists various utterances that will work for controlling a thermostat.
These troubleshooting tips should help you get your smart home skill back on track to certification. Feel free to reach out over on the smart home skill API forum for any further questions.