Join us online for the "Hey Google" Smart Home Summit on July 8th! Register here to learn what's new, and what's coming up for Google Smart Home.

action.devices.EXECUTE

This intent sends commands to execute on smart home devices. Your fulfillment should process each command, transmit it to the corresponding device, and return the new state in the EXECUTE response.

A single EXECUTE intent can target multiple devices with multiple commands. For example, a triggered intent may set both brightness and color on a set of lights or may set multiple lights each to a different color.

For more details, see the developer guide.

Request format

{
    "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf",
    "inputs": [{
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [{
          "devices": [{
            "id": "123",
            "customData": {
              "fooValue": 74,
              "barValue": true,
              "bazValue": "sheepdip"
            }
          }, {
            "id": "456",
            "customData": {
              "fooValue": 36,
              "barValue": false,
              "bazValue": "moarsheep"
            }
          }],
          "execution": [{
            "command": "action.devices.commands.OnOff",
            "params": {
              "on": true
            }
          }]
        }]
      }
    }]
}
  • requestId: String. Required. ID of request.
  • inputs:
    • intent: String. Required. action.devices.EXECUTE
    • payload:
      • commands: Array<Object>. Required. Each object contains one or more devices to target with the attached commands.
        • devices: Array<Object>. Required.
          • id: Required. Partner ID to query, as per the id provided in SYNC.
          • customData: Optional. If the opaque customData object is provided in SYNC, it's sent here.
        • execution: Array<Object>. Required. The ordered list of execution commands for the attached ids.
          • command: String. Required. The command to execute, usually with accompanying parameters.
          • params: Map<string, Object> Optional, but aligned with the parameters for each command.
            • <name>: String. Required. The name of the param.
            • <value>: String | Number | Boolean

Response format

{
  "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "on": true,
          "online": true
        }
      },
      {
        "ids": [
          "456"
        ],
        "status": "ERROR",
        "errorCode": "deviceTurnedOff"
      }
    ]
  }
}
  • requestId: String. Required. ID of request.
  • payload:
    • errorCode: String. Optional. An error code for the entire transaction—for auth failures and partner system unavailability. For individual device errors, use the errorCode within the device object. See the error codes documentation for the valid values you can set.
    • debugString: String. Optional. Detailed error which will never be presented to users but may be logged or used during development.
    • commands: Array<Object>. Required. Each object contains one or more devices with response details. N.B. These may not be grouped the same way as in the request. For example, the request might turn 7 lights on, with 3 lights succeeding and 4 failing, thus with two groups in the response.
      • ids: Array<String>. Required. Partner device IDs of the response
      • status: String. Required. The valid status types include:
        • SUCCESS: Confirm that the command succeeded.
        • PENDING: Command is enqueued but expected to succeed.
        • OFFLINE: Target device is in offline state or unreachable.
        • EXCEPTIONS: There is an issue or alert associated with a command. The command could succeed or fail. This status type is typically set when you want to send additional information about another connected device, as shown in this example. See the exception codes documentation for a list of the valid values you can set.
        • ERROR: Target device is unable to perform the command.
      • errorCode: String. Optional. Expanding ERROR state if needed from the preset error codes, which will map to the errors presented to users. See the error codes documentation for the valid values you can set.
      • debugString: String. Optional. Detailed error which will never be presented to users but may be logged or used during development.
      • states: Object. Optional, but aligned with per-trait states as in Attributes below. These are the states after execution, if available.
        • online: Boolean. Optional. Indicates if the device is online (that is, reachable) or not.
        • name:value String. Required. Name of the state followed by its value, which can be a String, Number, or Boolean.