实现Alexa.Speaker接口的智能家居设备无法响应卷更改请求

时间:2017-07-19 06:34:14

标签: alexa-skills-kit

我的Alexa Smart Home Skill for Entertainment Devices实现了API版本3的一些功能,包括Alexa.Speaker Interface

据我从文档中了解,它应该响应语音命令,例如“Alexa,将设备的音量设置为5”,但Alexa总是以&#34响应;抱歉,我无法控制您设备的音量"

设备的发现响应如下所示

{
    endpointId: 'music1',
    friendlyName: 'pillow',
    description: 'Music on Kodi',
    manufacturerName: 'Cubox-i',
    displayCategories: [],
    capabilities: [
        {
            type: 'AlexaInterface',
            interface: 'Alexa.PowerController',
            version: '1.0',
            properties: {
                supported: [
                    {
                        name: 'powerState',
                    },
                ],
            },
        },
        {
            type: 'AlexaInterface',
            interface: 'Alexa.PlaybackController',
            version: '1.0',
            properties: {},
        },
        {
            type: 'AlexaInterface',
            interface: 'Alexa.Speaker',
            version: '1.0',
            properties: {
                supported: [
                    {
                        name: 'volume',
                    },
                    {
                        name: 'muted',
                    },
                ],
            },
        },
    ],
}

这个发现似乎工作得很好,因为PowerController界面的反应很好(例如" Alexa,打开枕头" )。 我可以在AWS Lambda日志中看到发现,PowerControllerPlaybackController请求和响应。

Speaker的任何语音命令(无论是尝试将音量设置为20 ,将增加,还是要求静音取消静音枕头)不会向我的Lambda发出任何请求并导致上述响应 - 或者在&#34中静音; Pillow不支持该"

2 个答案:

答案 0 :(得分:2)

而不是

properties: {
            supported: [
                {
                    name: 'volume',
                },
                {
                    name: 'muted',
                },
            ],
        },

这个JSON,使用它:

'properties.supported':[{
                    name: 'volume',
                },
                {
                    name: 'muted',
                }]

这是他们试图解决的错误,但在此之前,这将有效,如果这个特定的解决方案适合您,请告诉我。

答案 1 :(得分:2)

除了'properties.supported'之外,版本应为1 (而不是3)。 Speaker接口发现响应应如下所示:

{   
    "type": "AlexaInterface",
    "interface": "Alexa.Speaker",
    "version": "1.0",
    "properties.supported":[
    {
        "name": "muted",
    },
    {
        "name": "volume"
    }]
}