alexa-samples / alexa-smarthome

Resources for Alexa Smart Home developers.
https://alexa.design/smarthome
Other
686 stars 336 forks source link

error response is not working on Alexa #19

Closed JasonAyla closed 6 years ago

JasonAyla commented 6 years ago

I just wanted to check if the device is online or not before power controller if the device is offline, I will response an offline error.

But Alexa always response "xxx is not responding", it's driving me crazy.

below is my error response format:

Hi Jenn, my error response is formatted as below, but Alexa aways responses "xxx is not responding", can you help to confirm the right format?

Any help is great. My error response format is as below: { "event": { "header": { "payloadVersion": "3", "correlationToken": "dFMb0z+PgpgdDmluhJ1LddFvSqZ/jCc8ptlAKulUj90jSqg==", "namespace": "Alexa", "name": "ErrorResponse", "messageId": "1bd5d003-31b9-476f-ad03-71d471922820" }, "endpoint": { "endpointId": "AC000W001509569" }, "payload": { "message": "device is offline, you can not control it now.", "type": "ENDPOINT_UNREACHABLE" } } }

briankel commented 6 years ago

Hi Jason, are you building a Custom skill or a Smart Home skill? If you are developing a Smart Home skill then the responses that Alexa says are built into the Alexa service. So if you send back an "ENDPOINT_UNREACHABLE" response she is going to say "xxx is not responding" which is the built in response for that error type. If on the other hand your'e building a Custom skill then the responses are entirely up to you.

JasonAyla commented 6 years ago

Hi briankel, Thanks for the reply. What I have been building is smart home skill. It took me a long time realize the response is correct. May I ask why don’t you response like “Sorry, XXX is offline now.”, since you let the developer send an offline error, to tell the customer what just happend is a better idea. Can you tell me how can I find the correct alexa response template for different types of alexa error?

郭少佳/Jason 艾拉物联网络(深圳)有限公司 / Ayla Networks 地址: 深圳市南山区高新南区粤兴一道8号香港城市大学产研楼310-311室 电话: 13760282105

原始邮件 发件人:briankelnotifications@github.com 收件人:alexa/alexa-smarthomealexa-smarthome@noreply.github.com 抄送:JasonAylajason.guo@aylanetworks.com; Authorauthor@noreply.github.com 发送时间:2017年12月7日(周四) 03:45 主题:Re: [alexa/alexa-smarthome] error response is not working on Alexa(#19)

Hi Jason, are you building a Custom skill or a Smart Home skill? If you are developing a Smart Home skill then the responses that Alexa says are built into the Alexa service. So if you send back an "ENDPOINT_UNREACHABLE" response she is going to say "xxx is not responding" which is the built in response for that error type. If on the other hand your'e building a Custom skill then the responses are entirely up to you. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

briankel commented 6 years ago

Error responses are documented here: https://developer.amazon.com/docs/device-apis/alexa-errorresponse.html

mikemaas-amazon commented 6 years ago

This issue looks to be resolved.