0

Using the Execute intent, Is it possible to execute more than one command at the same time?

For example: Ok Google, turn on the lights and turn off the switch

{
  "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
                }
              }
            ]
          }
        ]
      }
    }
  ]
}  

In my JSON example, I have lights and switch, and both using the OnOff trait, If it is possible, how to identify them? on the lights and off the switch?

bad_coder
  • 11,289
  • 20
  • 44
  • 72

1 Answers1

0

Unfortunately, this isn't possible, Execute intents can manage a single command.

Something can could get you close to this type of functionality is SCENE trait https://developers.google.com/assistant/smarthome/traits/scene