Alexa.Discovery 响应:Alexa 未检测到设备

Posted

技术标签:

【中文标题】Alexa.Discovery 响应:Alexa 未检测到设备【英文标题】:Alexa.Discovery response: no device detected by Alexa 【发布时间】:2020-09-15 10:19:20 【问题描述】:

我正在使用 AWS Lambda 实施我的 Alexa Home Skill。

当我尝试在 Alexa Skill 测试页面上检测新设备时收到以下请求:

directive=header=namespace=Alexa.Discovery, name=Discover, payloadVersion=3, messageId=0160c7e7-031f-47ee-a1d9-a23f38f87a9e, payload=scope=type=BearerToken, token=...

我回复如下:


    "event": 
        "payload": 
            "endpoints": [
                
                    "displayCategories": [
                        "SMARTPLUG"
                    ],
                    "capabilities": [
                        
                            "type": "AlexaInterface",
                            "interface": "Alexa",
                            "version": "3"
                        ,
                        
                            "type": "AlexaInterface",
                            "interface": "Alexa.PowerController",
                            "version": "3",
                            "properties": 
                                "retrievable": true,
                                "supported": [
                                    
                                        "name": "powerState"
                                    
                                ],
                                "proactivelyReported": true
                            
                        ,
                        
                            "type": "AlexaInterface",
                            "interface": "Alexa.EndpointHealth",
                            "version": "3",
                            "properties": 
                                "retrievable": true,
                                "supported": [
                                    
                                        "name": "connectivity"
                                    
                                ],
                                "proactivelyReported": true
                            
                        
                    ],
                    "manufacturerName": "mirko.io",
                    "endpointId": "ca84ef6d-53b1-430a-8a5e-a62f174eac5e",
                    "description": "mirko.io forno (id: ca84ef6d-53b1-430a-8a5e-a62f174eac5e)",
                    "friendlyName": "forno"
                
            ]
        ,
        "header": 
            "payloadVersion": "3",
            "namespace": "Alexa.Discovery",
            "name": "Discover.Response",
            "messageId": "c0555cc8-ad7a-4377-b310-9de9b9ab6282"
        
    

尽管如此,由于某些原因,Alexa 回答说它没有找到任何新设备。 我可能弄错了,但我很确定在我决定添加 Alexa.EndpointHealth 接口之前它曾经可以工作。

【问题讨论】:

【参考方案1】:

您的响应对象在我看来是正确的,除了额外的 "endpoint" 字段。

"endpoint": 
            "endpointId": "INVALID",
            "scope": 
                "type": "BearerToken",
                "token": "INVALID"
            
        

Alexa.Discovery 文档中没有这样的字段。尝试删除它,看看它是否可以解决问题。

【讨论】:

感谢您的回复。这部分消息来自 Alexa Github 示例 (github.com/alexa/skill-sample-java-smarthome-switch/blob/…)。无论如何,我把它扯掉了,没有运气。

以上是关于Alexa.Discovery 响应:Alexa 未检测到设备的主要内容,如果未能解决你的问题,请参考以下文章

Amazon Alexa - 未定义的语音响应

如何为 Alexa 技能意图响应获取和使用确认“是”或“否”

Alexa Flask Ask Yes / No 响应处理

javascript Alexa - 对AudioPlayer.PlaybackStarted的响应导致错误

Alexa 技能响应 抱歉,我无法按照您的要求进行操作。请再试一次

Node.js Lambda 函数从 REST 调用将“响应无效”返回给 Alexa 服务模拟器