Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
“Alexa智能家居”;无法检索状态“0”;_Alexa_Alexa Skill_Smarthomeskill - Fatal编程技术网

“Alexa智能家居”;无法检索状态“0”;

“Alexa智能家居”;无法检索状态“0”;,alexa,alexa-skill,smarthomeskill,Alexa,Alexa Skill,Smarthomeskill,我在玩Alexa智能家居的一个示例技巧——我不是在和任何真正的硬件或后端说话,只是想让信息流正常工作。我已经设置了一个简单的开关/插头/灯,只支持打开/关闭-我有帐户链接工作和技能启用。当我尝试通过电话或网络上的Alexa应用程序(启用调试)查看它时,它总是说设备没有响应,或者“检索状态失败”。我完全可以在Cloud Watch中看到如下消息 你知道为什么我会长期得到这样的回应吗 请求: "directive": { "endpoint":

我在玩Alexa智能家居的一个示例技巧——我不是在和任何真正的硬件或后端说话,只是想让信息流正常工作。我已经设置了一个简单的开关/插头/灯,只支持打开/关闭-我有帐户链接工作和技能启用。当我尝试通过电话或网络上的Alexa应用程序(启用调试)查看它时,它总是说设备没有响应,或者“检索状态失败”。我完全可以在Cloud Watch中看到如下消息

你知道为什么我会长期得到这样的回应吗

请求:

"directive": { "endpoint": { "cookie": {}, "endpointId": "endpoint-003", "scope": { "token": "<<<SUPRESSING>>", "type": "BearerToken" } }, "header": { "correlationToken": "<<SHORTENED>>", "messageId": "50397414-bb9d-412f-8a2c-15669978ab64", "name": "ReportState", "namespace": "Alexa", "payloadVersion": "3" }, "payload": {} } } “指令”:{ “端点”:{ “cookie”:{}, “端点ID”:“端点-003”, “范围”:{ “token”:“问题是:我的头响应中的“name”应该是“ReportState”。“response”仅用于设置/更改值的内容

我的一般建议是始终验证三件事是好的:

  • 最初的“发现”
  • “回应”信息
  • 一般“ReportState”查询
  • 我的意思是:

  • 任何您在“发现”中宣传为应该报告的内容最好在其他(“报告状态”)消息中报告。如果您宣传“PowerController”-如果您的报告状态不包含状态,您将看不到状态,或者它将永远重试(继续查找)-或者您可能会遇到某种错误
  • 如果您更改了发现内容,请确保您确实删除了、重新发现了,并且新添加/删除的状态(如上)正常
  • 始终确保报告“EndpointHealth”

  • 您是否在处理后端代码中的发现请求?例如,是的。我以它为例。
    {
        "context": {
            "properties": [
                {
                    "name": "connectivity",
                    "namespace": "Alexa.EndpointHealth",
                    "timeOfSample": "2020-06-29T16:49:59.00Z",
                    "uncertaintyInMilliseconds": 0,
                    "value": "OK"
                },
                {
                    "name": "powerState",
                    "namespace": "Alexa.PowerController",
                    "timeOfSample": "2020-06-29T16:49:59.00Z",
                    "uncertaintyInMilliseconds": 0,
                    "value": "ON"
                }
            ]
        },
        "event": {
            "endpoint": {
                "endpointId": "endpoint-003",
                "scope": {
                    "token": "Alexa-access-token",
                    "type": "BearerToken"
                }
            },
            "header": {
                "correlationToken": "<<SHORTENED>>",
                "messageId": "7a8b9a71-adda-41b8-acba-4d3855374845",
                "name": "Response",
                "namespace": "Alexa",
                "payloadVersion": "3"
            },
            "payload": {}
        }
    }