我开发了Alexa SmartHome技能。如果设备不再可用,但Alexa想要触发它,我将显示NO_SUCH_ENDPOINT错误。但是,Alexa的音频响应指出该设备当前没有响应,而不是该设备不再可用。
具有该技能的交流通常可以正常工作,并且可以对现有设备进行正确评估。
请考虑以下示例。 Alexa发布了一条指令(作用域令牌已在预处理步骤中删除,因此此处未显示):
{
"directive": {
"header": {
"namespace": "Alexa.PowerController",
"name": "TurnOn",
"payloadVersion": "3",
"messageId": "72fd470b-3cf5-44cc-aeb2-e173a286a8b2",
"correlationToken": "AAAAAAAAAQAaieQVQqSUvTlNNIhWgfO7DAIAAAAAAAAQ2kRZ2tWZo+nCF1MbKxBLEECYxPfytOiyDYkatx+IIPveE0AvXnS2buopCXtXhjQnLd75guvqBpPTlEXptFat5BlG4Ml2CLdShb9QFJpAtEyXF3Cp6RgrKLxHH0AkFKMahGGwt4hE7HhO807Kl+8YCmFE2eF6t5iwQr\/hooRQi64CgKPGMkH1UlIM45v\/yXOGm6pmtyrXHe8nJ2Qxu5LFZjx+q1hfvWDqYkiFio+CD2IEANPHLT2Fh70DirBVcIKrpRQRC2OQqxyZiIPy+Pw5LFbawuGiDX1IqGysB8kVylOs1Fyx\/WDizFYykwBLONk3CWnAlJmxEnuvmiXH46dt5vLc0tse+fORARS0Zf7AHgtI3RoV9LZxoCA7a2xe7VkMQVuEm\/F6n8H\/JScqrWAqUTvRrfBUTCKFBhcvWt+\/Oka4itUUffbqHwu9qQfH\/UJXCO7g1tqSqnkdnJ\/p0s1WCDjdIBlj1LhBszLt2FesQEFeBFrr9SQlunkYYm1r7wUfdtqs\/pgWDFI0nTsf2pLgKYRiumom\/0w4eCO5Fo\/VDMwVGRaXxn5jumS19jW0aKACrDsciq\/OalxHx8eyTtoKGheBBAyucPUwcL4XtBYxd5J5ZHg0XTpZR2huLaRtdmgEvPXWEhzet\/VG4q7fD29iu6I7vBKa1SSX3eaBkPALF+Aze1hmVTH3mo5WBg=="
},
"endpoint": {
"scope": {
"type": "BearerToken"
},
"endpointId": "2",
"cookie": []
},
"payload": []
}
}
如果某件事失败并且所请求的设备不再存在,该技能将以
响应{
"event": {
"header": {
"namespace": "Alexa",
"name": "ErrorResponse",
"payloadVersion": "3",
"messageId": "30987551-6385-414d-8227-949cb50ac561",
"correlationToken": "AAAAAAAAAQAaieQVQqSUvTlNNIhWgfO7DAIAAAAAAAAQ2kRZ2tWZo+nCF1MbKxBLEECYxPfytOiyDYkatx+IIPveE0AvXnS2buopCXtXhjQnLd75guvqBpPTlEXptFat5BlG4Ml2CLdShb9QFJpAtEyXF3Cp6RgrKLxHH0AkFKMahGGwt4hE7HhO807Kl+8YCmFE2eF6t5iwQr\/hooRQi64CgKPGMkH1UlIM45v\/yXOGm6pmtyrXHe8nJ2Qxu5LFZjx+q1hfvWDqYkiFio+CD2IEANPHLT2Fh70DirBVcIKrpRQRC2OQqxyZiIPy+Pw5LFbawuGiDX1IqGysB8kVylOs1Fyx\/WDizFYykwBLONk3CWnAlJmxEnuvmiXH46dt5vLc0tse+fORARS0Zf7AHgtI3RoV9LZxoCA7a2xe7VkMQVuEm\/F6n8H\/JScqrWAqUTvRrfBUTCKFBhcvWt+\/Oka4itUUffbqHwu9qQfH\/UJXCO7g1tqSqnkdnJ\/p0s1WCDjdIBlj1LhBszLt2FesQEFeBFrr9SQlunkYYm1r7wUfdtqs\/pgWDFI0nTsf2pLgKYRiumom\/0w4eCO5Fo\/VDMwVGRaXxn5jumS19jW0aKACrDsciq\/OalxHx8eyTtoKGheBBAyucPUwcL4XtBYxd5J5ZHg0XTpZR2huLaRtdmgEvPXWEhzet\/VG4q7fD29iu6I7vBKa1SSX3eaBkPALF+Aze1hmVTH3mo5WBg=="
},
"endpoint": {
"endpointId": "2"
},
"payload": {
"type": "NO_SUCH_ENDPOINT"
}
}
}
根据在https://github.com/alexa/alexa-smarthome/blob/master/validation_schemas/alexa_smart_home_message_schema.json处找到的Alexa SmartHome JSON模式,响应是有效的。我希望Alexa声明类似“所请求的端点不存在”的内容。而是“设备当前没有响应”。 (我使用德语Alexa,因此确切的措词可能有所不同)
我不知道出了什么问题。 Alexa通常会对NO_SUCH_ENDPOINT做出不同的反应,而我做错了吗?还是这是来自Alexa的默认错误响应,而我只是错误地期望她会向用户提供不同的响应?