1

在 Alexa 发现过程中,我们需要发送设备详细信息及其功能。我正在发送灯光和风扇详细信息。Light 出现在 Alexa 应用程序中,但没有出现在风扇中。你能帮我找出我在以下回复中做错了什么吗?

我使用这个 Alexa 文档来创建响应。https://developer.amazon.com/docs/smarthome/connect-a-tower-fan-to-alexa.html

{
    "event": {
        "header": {
            "namespace": "Alexa.Discovery",
            "name": "Discover.Response",
            "payloadVersion": "3",
            "messageId": "somd-id"
        },
        "payload": {
            "endpoints": [
                {
                    "endpointId": "fan-i",
                    "friendlyName": "Fan",
                    "description": "Fan",
                    "manufacturerName": "Fan",
                    "displayCategories": [
                        "OTHER"
                    ],
                    "cookie": {},
                    "capabilities": [
                        {
                            "type": "AlexaInterface",
                            "interface": "Alexa.PowerController",
                            "version": "3",
                            "properties": {
                                "supported": [
                                    {
                                        "name": "powerState"
                                    }
                                ],
                                "proactivelyReported": true,
                                "retrievable": true
                            }
                        },
                        {
                            "type": "AlexaInterface",
                            "interface": "Alexa.RangeController",
                            "version": "3",
                            "instance": "speed",
                            "capabilityResources": {
                                "friendlyNames": [
                                    {
                                        "@type": "asset",
                                        "value": {
                                            "assetId": "Alexa.Setting.FanSpeed"
                                        }
                                    }
                                ]
                            },
                            "properties": {
                                "supported": [
                                    {
                                        "name": "rangeValue"
                                    }
                                ],
                                "proactivelyReported": true,
                                "retrievable": true
                            },
                            "configuration": {
                                "supportedRange": {
                                    "minimumValue": 1,
                                    "maximumValue": 5,
                                    "precision": 1
                                },
                                "presets": [
                                    {
                                        "rangeValue": 1,
                                        "presetResources": {
                                            "friendlyNames": [
                                                {
                                                    "@type": "asset",
                                                    "value": {
                                                        "assetId": "Alexa.Value.Minimum"
                                                    }
                                                },
                                                {
                                                    "@type": "asset",
                                                    "value": {
                                                        "assetId": "Alexa.Value.Low"
                                                    }
                                                }
                                            ]
                                        }
                                    },
                                    {
                                        "rangeValue": 5,
                                        "presetResources": {
                                            "friendlyNames": [
                                                {
                                                    "@type": "asset",
                                                    "value": {
                                                        "assetId": "Alexa.Value.Maximum"
                                                    }
                                                },
                                                {
                                                    "@type": "asset",
                                                    "value": {
                                                        "assetId": "Alexa.Value.High"
                                                    }
                                                }
                                            ]
                                        }
                                    },
                                    {
                                        "rangeValue": 3,
                                        "presetResources": {
                                            "friendlyNames": [
                                                {
                                                    "@type": "asset",
                                                    "value": {
                                                        "assetId": "Alexa.Value.Medium"
                                                    }
                                                }
                                            ]
                                        }
                                    }
                                ]
                            }
                        },
                        {
                            "type": "AlexaInterface",
                            "interface": "Alexa",
                            "version": "3"
                        }
                    ]
                },
            ]
        }
    }
}

注意:我只是在下面重复上面的问题,因为 StackOverflow 不允许粘贴太多代码而描述较少。

在 Alexa 发现过程中,我们需要发送设备详细信息及其功能。我正在发送灯光和风扇详细信息。Light 出现在 Alexa 应用程序中,但没有出现在风扇中。你能帮我找出我在以下回复中做错了什么吗?

4

1 回答 1

1

我认为 Alexa.RangeController 目前仅限于美国地区。因此,如果您试图发现注册到美国境外帐户的设备,那么 Alexa 似乎只是忽略了带有 RangeController 接口的发现响应。我解决这个问题的方法是将用户帐户切换到美国并且设备立即出现。试一试,如果您有更好的解决方案,请分享。

于 2019-05-10T10:48:27.667 回答