2017-07-19 76 views
1

我的Alexa Smart Home Skill for Entertainment Devices實現了API版本3的一些功能,包括Alexa.Speaker Interface實現Alexa.Speaker接口無法響應音量變化請求的智能家居設備

據我從文檔理解,應該響應語音如命令「的Alexa,裝置的體積設定爲5」,然而的Alexa總是與響應「對不起,我無法控制您的設備上的音量「

設備的發現響應看起來像這樣

{ 
    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和結果的任何請求在上面提到的響應中 - 或在屏蔽的情況下「枕頭不支持」

回答

1

而不是

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

這個JSON,使用此:

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

這是他們正在試圖解決一個bug,但直到那時,這將工作,請讓我知道,如果這特定的解決方案適用於您。

+0

感謝您的回答。這似乎已經完成了「靜音/取消靜音」命令。然而,當試圖設置音量(「將枕頭的體積設置爲5」)時,響應仍然是「抱歉,我無法控制設備上的音量」 - 或者有時「抱歉,枕頭不支持該音量」 這裏有趣的是,即使我使用相同的輸入命令,錯誤消息有時是一個,有時是另一個。結合你的提示,這告訴我這個API不穩定,錯誤可能不是在我的,但在亞馬遜的一面。 – WrongAboutMostThings

1

要添加到「properties.supported」,版本應該是1(而不是3)。揚聲器接口發現響應應該如下所示:

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