Actions on google Trait action.devices.traits.Modes似乎不起作用

Actions on google Trait action.devices.traits.Modes似乎不起作用,actions-on-google,google-home,google-smart-home,Actions On Google,Google Home,Google Smart Home,我正在努力让动作、设备、特征、模式、特征发挥作用。在action.devices.SYNC请求中,我返回以下响应: { "payload":{ "devices":[ { "id":"12345", "type":"action.devices.types.SWITCH", "traits":[ "action.devices.traits.OnOff",

我正在努力让动作、设备、特征、模式、特征发挥作用。在action.devices.SYNC请求中,我返回以下响应:

{
   "payload":{
      "devices":[
         {
            "id":"12345",
            "type":"action.devices.types.SWITCH",
            "traits":[
               "action.devices.traits.OnOff",
               "action.devices.traits.StartStop",
               "action.devices.traits.Modes"
            ],
            "name":{
               "defaultNames":null,
               "name":"David",
               "nicknames":null
            },
            "willReportState":false,
            "roomHint":"living room",
            "attributes":{
               "pausable":true,
               "availableModes":[
                  {
                     "name":"speed",
                     "name_values":[
                        {
                           "name_synonym":[
                              "speed"
                           ],
                           "lang":"en"
                        }
                     ],
                     "settings":[
                        {
                           "setting_name":"slow",
                           "setting_values":[
                              {
                                 "setting_synonym":[
                                    "slow"
                                 ],
                                 "lang":"en"
                              }
                           ]
                        },
                        {
                           "setting_name":"normal",
                           "setting_values":[
                              {
                                 "setting_synonym":[
                                    "normal"
                                 ],
                                 "lang":"en"
                              }
                           ]
                        },
                        {
                           "setting_name":"fast",
                           "setting_values":[
                              {
                                 "setting_synonym":[
                                    "fast"
                                 ],
                                 "lang":"en"
                              }
                           ]
                        }
                     ],
                     "ordered":true
                  }
               ]
            }
         }
      ]
   }
}
我在上验证了这个回答,得到的反馈是可以的

现在,当我在智能手机的控制台或助手中键入以下短语之一时,不会调用履行服务:

What mode is David in?
What speed is David in?
What is the David's speed?
Set the speed of David to normal.
Set David's speed to normal.
Set David to normal speed.
...
所有这些都只能依靠谷歌搜索

但是,traits action.devices.traits.OnOff和action.devices.traits.StartStop工作正常。以下短语按预期工作:

Turn David on
Resume David.
...

我不知道出了什么问题,也不知道应该如何调试它。顺便说一句,智能家居服务或多或少是一个黑匣子,所以我不确定这里到底出了什么问题。

如可用模块文档中所述:

目前,您必须使用示例JSON中的名称;尚不支持自定义名称

可以通过将问题提交到上,以个人为单位手动创建名称

然而,在你特定的速度情况下,你应该看看这个特点。它提供相同的功能,您可以在其中定义多个速度模式,然后在它们之间切换。您可以更新设备JSON,使其看起来更像:

{
 "payload":{
   "devices":[
     {
        "id":"12345",
        "type":"action.devices.types.SWITCH",
        "traits":[
           "action.devices.traits.OnOff",
           "action.devices.traits.StartStop",
           "action.devices.traits.FanSpeed"
        ],
        "name":{
           "defaultNames":null,
           "name":"David",
           "nicknames":null
        },
        "willReportState":false,
        "roomHint":"living room",
        "attributes":{
           "pausable":true,
           "availableFanSpeeds": {
             "speeds": [{
               "speed_name": "Low",
               "speed_values": [{
                 "speed_synonym": ["low", "slow"],
                 "lang": "en"
               },
               {
                 "speed_synonym": ["low", "slow"],
                 "lang": "de"
               }]
             },
             {
               "speed_name": "High",
               "speed_values": [{
                 "speed_synonym": ["high"],
                 "lang": "en"
               },
               {
                 "speed_synonym": ["high"],
                 "lang": "de"
               }]
           }],
           "ordered": true
         },
         "reversible": true
        }
     }
  ]}
}

非常感谢。我必须承认,我并不真正理解文档当前所指的内容,您必须使用示例JSON中的名称;自定义名称还不受支持,但现在我知道了。FanSpeed特性对于这个用例也很有用,谢谢。