【问题标题】:Devices with the same commands具有相同命令的设备
【发布时间】:2021-09-14 16:34:27
【问题描述】:

使用执行意图,是否可以同时执行多个命令?

例如:Ok Google,开灯关开关

{
  "requestId": "6894439706274654516",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123",
                "customData": {
                  "deviceName": "action.devices.types.OUTLET"
                }
              },
              {
                "id": "456",
                "customData": {
                  "deviceName": "action.devices.types.OUTLET"
                }
              },
              {
                "id": "789",
                "customData": {
                  "deviceName": "action.devices.types.SWITCH"
                }
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.OnOff",
                "params": {
                  "on": true
                }
              },
              {
                "command": "action.devices.commands.OnOff",
                "params": {
                  "on": false
                }
              }
            ]
          }
        ]
      }
    }
  ]
}  

在我的 JSON 示例中,我有灯和开关,并且都使用 OnOff 特征, 如果可能,如何识别它们?开灯关开关?

【问题讨论】:

    标签: actions-on-google google-smart-home


    【解决方案1】:

    很遗憾,这是不可能的,执行意图可以管理单个命令。

    SCENE trait https://developers.google.com/assistant/smarthome/traits/scene可以让你接近这种类型的功能

    【讨论】:

      猜你喜欢
      • 2021-12-11
      • 2013-09-29
      • 2014-11-12
      • 1970-01-01
      • 2015-09-10
      • 2019-06-28
      • 1970-01-01
      • 1970-01-01
      • 2021-12-11
      相关资源
      最近更新 更多