amazon-web-services - Alexa 智能家居技能 : Issue with de

我写了一个Alexa智能家居技巧。

当我尝试使用 Alexa 测试或从移动应用程序发现设备时,lambda 被触发。

lambda 已成功执行,但我在应用程序或 Alexa 控制台测试中遇到以下错误。

I couldn't find any new Smart Home devices. If you’ve ‎n't already, please enable the smart home skill for your device from the Alexa App.

可能是什么问题?

由于 lambda 已成功执行,我认为部署 lambda 的语言 (English(IN)) 或 AWS 区域 (EU-WEST-1) 没有任何问题。

我在 Alexa 开发者控制台上没有看到任何日志

有什么建议吗?

Lambda 函数的响应 -

标题 =

    { 
namespace: 'Alexa.Discovery',
    name: 'Discover.Response',
    payloadVersion: '3',
    messageId: '785f0173-6ddb-41d8-a785-de7159c7f7ca' 
}

有效载荷 =

{
    "endpoints": [
        {
            "endpointId": "d4b87cbe6c8e490493733f260b8c2c25",
            "friendlyName": "Kitchen",
            "description": "Demo",
            "manufacturerName": "Man1",
            "displayCategories": [
                "LIGHT"
            ],
            "cookie": {
                "owner": "Owner1"
            },
            "capabilities": [
                {
                    "type": "AlexaInterface",
                    "version": "3",
                    "interface": "Alexa"
                },
                {
                    "type": "AlexaInterface",
                    "version": "3",
                    "interface": "Alexa.PowerController",
                    "properties": {
                        "supported": [
                            {
                                "name": "powerState"
                            }
                        ],
                        "proactivelyReported": true,
                        "retrievable": true
                    }
                },
                {
                    "type": "AlexaInterface",
                    "version": "3",
                    "interface": "Alexa.BrightnessController",
                    "properties": {
                        "supported": [
                            {
                                "name": "brightness"
                            }
                        ],
                        "proactivelyReported": true,
                        "retrievable": true
                    }
                }
            ]
        }
    ]
}

我们在响应事件中包装 header 和负载。

context.succeed({ event: { header: header, payload: payload } });

最佳答案

到目前为止,我还没有找到查看日志的方法。

我遇到了同样的问题,我意识到我在某些属性或模式实体(如 id)中输入了错误的值。

以同样的方式,在某些情况下解决我的另一件事是按以下方式放置方案:

context.succeed({
  "event": {
    "header": {
      "namespace": "Alexa.Discovery",
      "name": "Discover.Response",
      "payloadVersion": "3",
      "messageId": header.messageId
    },
    "payload": {
      "endpoints": [
        {
          "endpointId": "demo_id",
          ...
          ,
          "cookie": {},
          "capabilities": [
            {
              "type": "AlexaInterface",
              "interface": "Alexa",
              "version": "3"
            },
            ...
          ]
        }
      ]
    }
  }
});

关于amazon-web-services - Alexa 智能家居技能 : Issue with device discovery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57373810/

相关文章:

reactjs - 从 create-react-app 生成生产构建时缺少 index.html

reactjs - 如果文本很长,React 'react-data-table-component

python-3.x - 如何使用超时停止阻塞函数 subscribe.simple

java - Spring WebFlux : How to access Request Body

wordpress - 在 Yoast 生成的 JSON-LD 模式中更改作者 @id

android-mediacodec - 如何找到 Google Pixel 2 手机的硬件解码器实

vhdl - 什么是{globally|locally} static {primary|expre

leaflet - 如果单个标记不在或靠近集群,则无法呈现

python - Jupyter 实验室中的后台线程时钟

python - Tweepy Cursor.items() 无法按预期使用 api.retweet