Alexa智能家居,模式控制器不起作用

时间:2019-04-12 14:24:09

标签: alexa-skill

嗨,我正在尝试运行alexa模式控制器而没有任何运气。有人让它起作用了吗?  我的问题似乎与发现示例与亚马逊示例相同。洗衣机在alexa Web应用程序中正确填充,但是使用控制台(基于文本),我总是得到“我不知道如何将洗衣机设置为该设置。”

function handleDiscovery(request, context) {
    var payload = {
    "endpoints": [
    {
      "endpointId": "Washer-001",
      "friendlyName": "Washer",
      "description": "Smart Washer by Washer Maker Plus",
      "manufacturerName": "Washer Maker Plus",
      "displayCategories": [
        "OTHER"
      ],
      "cookie": {},
      "capabilities": [
        {
          "type": "AlexaInterface",
          "interface": "Alexa.ModeController",
          "version": "3",
          "instance": "Washer.WashCycle",
          "capabilityResources": {
            "friendlyNames": [
              {
                "@type": "text",
                "value": {
                  "text": "Wash Cycle",
                  "locale": "en-US"
                }
              },
              {
                "@type": "text",
                "value": {
                  "text": "Wash Setting",
                  "locale": "en-US"
                }
              }
            ]
          },
          "properties": {
            "supported": [
              {
                "name": "mode"
              }
            ],
            "retrievable": true,
            "proactivelyReported": true
          },
          "configuration": {
            "ordered": false,
            "supportedModes": [
              {
                "value": "WashCycle.Normal",
                "modeResources": {
                  "friendlyNames": [
                    {
                      "@type": "text",
                      "value": {
                        "text": "Normal",
                        "locale": "en-US"
                      }
                    },
                    {
                      "@type": "text",
                      "value": {
                        "text": "Cottons",
                        "locale": "en-US"
                      }
                    }
                  ]
                }
              },
              {
                "value": "WashCycle.Delicates",
                "modeResources": {
                  "friendlyNames": [
                    {
                      "@type": "text",
                      "value": {
                        "text": "Delicates",
                        "locale": "en-US"
                      }
                    },
                    {
                      "@type": "text",
                      "value": {
                        "text": "Knits",
                        "locale": "en-US"
                      }
                    }
                  ]
                }
              }
            ]
          }
        },
        {
          "type": "AlexaInterface",
          "interface": "Alexa.ModeController",
          "version": "3",
          "instance": "Washer.WashTemperature",
          "capabilityResources": {
            "friendlyNames": [
              {
                "@type": "text",
                "value": {
                  "text": "Wash Temperature",
                  "locale": "en-US"
                }
              },
              {
                "@type": "asset",
                "value": {
                  "assetId": "Alexa.Setting.WaterTemperature"
                }
              }
            ]
          },
          "properties": {
            "supported": [
              {
                "name": "mode"
              }
            ],
            "retrievable": true,
            "proactivelyReported": true
          },
          "configuration": {
            "ordered": true,
            "supportedModes": [
              {
                "value": "WashTemperature.Cold",
                "modeResources": {
                  "friendlyNames": [
                    {
                      "@type": "text",
                      "value": {
                        "text": "Cold",
                        "locale": "en-US"
                      }
                    },
                    {
                      "@type": "text",
                      "value": {
                        "text": "Cool",
                        "locale": "en-US"
                      }
                    }
                  ]
                }
              },
              {
                "value": " WashTemperature.Warm",
                "modeResources": {
                  "friendlyNames": [
                    {
                      "@type": "text",
                      "value": {
                        "text": "Warm",
                        "locale": "en-US"
                      }
                    }
                  ]
                }
              },
              {
                "value": " WashTemperature.Hot",
                "modeResources": {
                  "friendlyNames": [
                    {
                      "@type": "text",
                      "value": {
                        "text": "Hot",
                        "locale": "en-US"
                      }
                    }
                  ]
                }
              }
            ]
          }
        },
        {
          "type": "AlexaInterface",
          "interface": "Alexa",
          "version": "3"
        }
      ]
    }
  ]
    };
    var header = request.directive.header;
    header.name = "Discover.Response";
    log("DEBUG", "Discovery Response: ", JSON.stringify({ header: header, payload: payload }));
    context.succeed({ event: { header: header, payload: payload } });
}

0 个答案:

没有答案