### EXECUTE Command Example: appInstall Source: https://developers.home.google.com/cloud-to-cloud/guides/streamingbox_hl=zh-tw Example of an EXECUTE command payload for installing an application on a `STREAMING_BOX` device using the `action.devices.commands.appInstall` command. ```APIDOC ### EXECUTE Command Example: appInstall Refer to the `action.devices.traits.AppSelector` reference for further details on command parameters. ```json { "requestId": "6894439706274654518", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.appInstall", "params": { "newApplication": "youtube" } } ] } ] } } ] } ``` **Success Response:** ```json { "requestId": "6894439706274654518", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "currentApplication": "youtube" } } ] } } ``` ``` -------------------------------- ### EXECUTE Command Example (appInstall) for Streaming Stick Source: https://developers.home.google.com/cloud-to-cloud/guides/streamingstick_hl=zh-cn Demonstrates an example EXECUTE command for installing an application on a streaming stick device, along with the corresponding success response. ```APIDOC ### EXECUTE Command Example #### appInstall Refer to the `action.devices.traits.AppSelector` documentation for command parameters. **Request:** ```json { "requestId": "6894439706274654516", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.appInstall", "params": { "newApplication": "youtube" } } ] } ] } } ] } ``` **Response:** ```json { "requestId": "6894439706274654516", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "currentApplication": "youtube" } } ] } } ``` ``` -------------------------------- ### Install App on Device with Google Cloud to Cloud Source: https://developers.home.google.com/cloud-to-cloud/guides/gameconsole This example demonstrates the JSON payloads for installing a new application on a device. It includes the command to initiate the app installation and the response confirming the installation status and updated device states. ```json { "requestId": "68944397062746516", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.appInstall", "params": { "newApplication": "youtube" } } ] } ] } } ] } ``` ```json { "requestId": "68944397062746516", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "currentApplication": "youtube" } } ] } } ``` -------------------------------- ### EXECUTE Command Example: appInstall Source: https://developers.home.google.com/cloud-to-cloud/guides/gameconsole_hl=zh-tw Demonstrates an EXECUTE command for installing an application on a game console. ```APIDOC ## EXECUTE Command Example: appInstall ### Description This example shows how to use the `EXECUTE` intent to install a new application on a game console using the `action.devices.commands.appInstall` command. ### Method N/A ### Endpoint N/A ### Parameters N/A ### Request Example ```json { "requestId": "6894439706274654516", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.appInstall", "params": { "newApplication": "youtube" } } ] } ] } } ] } ``` ### Response #### Success Response (200) * **requestId** (string) - Unique request identifier. * **payload** (object) - Contains the execution results for commands. * **commands** (array) - List of command execution results. * **ids** (array) - List of device IDs that the command was executed on. * **status** (string) - The status of the command execution (e.g., `SUCCESS`). * **states** (object) - The resulting states of the device after the command execution. * **online** (boolean) - Indicates if the device is online. * **currentApplication** (string) - The key of the application that is now running. #### Response Example ```json { "requestId": "6894439706274654516", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "currentApplication": "youtube" } } ] } } ``` ``` -------------------------------- ### Stand Mixer EXECUTE Command - StartStop Example Source: https://developers.home.google.com/cloud-to-cloud/guides/standmixer_hl=ko This JSON shows an example of an EXECUTE command for the 'StartStop' action on a stand mixer. It includes the device ID and a parameter to start the device. ```json { "requestId": "6894439706274654518", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.StartStop", "params": { "start": true } } ] } ] } } ] } { "requestId": "6894439706274654518", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "isRunning": true } } ] } } ``` -------------------------------- ### Washer EXECUTE Command Example: Start Source: https://developers.home.google.com/cloud-to-cloud/guides/washer An example of an EXECUTE command payload to start a smart home washer. This command targets the `action.devices.traits.StartStop` trait to initiate the washing cycle. ```json { "requestId": "ff36a380-0000-0000-0000-000000000000", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "washer-123", "deviceModel": { "manufacturer": "SmartLabs", "model": "washer-model-abc", "hwVersion": "3.2", "swVersion": "1.0.0" } } ], "execution": [ { "command": "action.devices.commands.StartStop", "params": { "start": true } } ] } ] } } ] } ``` -------------------------------- ### QUERY Request and Response Example Source: https://developers.home.google.com/cloud-to-cloud/guides/radiator_hl=fr Shows an example of a QUERY request to get the state of a radiator and the corresponding response. ```APIDOC ## QUERY Request for Radiator ### Description Requests the current state of specified devices. ### Method POST ### Endpoint `/query` (Example Endpoint) ### Request Body ```json { "requestId": "6894439706274654514", "inputs": [ { "intent": "action.devices.QUERY", "payload": { "devices": [ { "id": "123" } ] } } ] } ``` ## QUERY Response for Radiator ### Description Returns the current state of the requested devices. ### Method POST ### Endpoint `/query` (Example Endpoint) ### Response Body (Success - 200) ```json { "requestId": "6894439706274654514", "payload": { "devices": { "123": { "status": "SUCCESS", "online": true, "on": true } } } } ``` ``` -------------------------------- ### action.devices.commands.StartStop Source: https://developers.home.google.com/cloud-to-cloud/guides/shower_hl=id This section details the StartStop command for devices. It includes a reference to the action.devices.traits.StartStop trait for additional parameter information and provides example request and response payloads for executing the command. ```APIDOC ## POST /action.devices.EXECUTE ### Description Executes the StartStop command on a device. ### Method POST ### Endpoint /action.devices.EXECUTE ### Parameters #### Request Body - **requestId** (string) - Required - Unique identifier for the request. - **inputs** (array) - Required - An array containing the execution input. - **intent** (string) - Required - The intent to execute, should be 'action.devices.EXECUTE'. - **payload** (object) - Required - The payload for the EXECUTE intent. - **commands** (array) - Required - An array of commands to execute. - **devices** (array) - Required - A list of devices to execute the command on. - **id** (string) - Required - The ID of the device. - **execution** (array) - Required - A list of executions to perform on the devices. - **command** (string) - Required - The command to execute, e.g., 'action.devices.commands.StartStop'. - **params** (object) - Required - Parameters for the command. - **start** (boolean) - Optional - If true, starts the device; if false, stops it. ### Request Example ```json { "requestId": "6894439706274654518", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.StartStop", "params": { "start": true } } ] } ] } } ] } ``` ### Response #### Success Response (200) - **requestId** (string) - Unique identifier for the request. - **payload** (object) - The payload containing the results of the commands. - **commands** (array) - An array of command results. - **ids** (array) - An array of device IDs that were targeted. - **status** (string) - The status of the command execution (e.g., 'SUCCESS', 'ERROR'). - **states** (object) - The current states of the device after the command execution. - **online** (boolean) - Indicates if the device is online. - **isRunning** (boolean) - Indicates if the device is currently running. #### Response Example ```json { "requestId": "6894439706274654518", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "isRunning": true } } ] } } ``` ### Error Handling Refer to the list of device errors and exceptions for comprehensive error information. ``` -------------------------------- ### Sprinkler EXECUTE Command Examples Source: https://developers.home.google.com/cloud-to-cloud/guides/sprinkler_hl=pt-br Illustrative examples of EXECUTE commands for controlling sprinkler devices, including starting, stopping, and managing timers. ```APIDOC ## POST /execute ### Description Handles the EXECUTE intent for controlling sprinkler devices. ### Method POST ### Endpoint /execute ### Request Body Example (Start command) ```json { "requestId": "ff36a281-4567-4021-8600-4526f2f9f351", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.StartStop", "params": { "start": true } } ] } ] } } ] } ``` ### Request Body Example (Set Timer command) ```json { "requestId": "ff36a281-4567-4021-8600-4526f2f9f351", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.SetTimer", "params": { "timer": { "duration": { "seconds": 1800 } } } } ] } ] } } ] } ``` ### Response #### Success Response (200) - **requestId** (string) - Unique request identifier. - **payload** (object) - **commands** (array) - List of command results. - **ids** (array) - Device IDs that the command was executed on. - **status** (string) - Status of the command execution (e.g., "SUCCESS", "PENDING", "ERROR"). - **debugString** (string) - Optional debug information. - **"[customDataFieldName]"** (any) - Optional custom data returned by the device. #### Response Example ```json { "requestId": "ff36a281-4567-4021-8600-4526f2f9f351", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "debugString": "Command executed successfully." } ] } } ``` ``` -------------------------------- ### EXECUTE Command Examples (Cook and StartStop) Source: https://developers.home.google.com/cloud-to-cloud/guides/standmixer_hl=zh-tw Examples of EXECUTE requests and responses for the Cook and StartStop commands. ```APIDOC ## EXECUTE Command: Cook ### Request ```json { "requestId": "6894439706274654516", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.Cook", "params": { "start": false, "cookingMode": "MIX" } } ] } ] } } ] } ``` ### Response ```json { "requestId": "6894439706274654516", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "currentCookingMode": "NONE" } } ] } } ``` ## EXECUTE Command: StartStop ### Request ```json { "requestId": "6894439706274654518", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.StartStop", "params": { "start": true } } ] } ] } } ] } ``` ### Response ```json { "requestId": "6894439706274654518", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "isRunning": true } } ] } } ``` ``` -------------------------------- ### Simple Dishwasher Example - EXECUTE Commands Source: https://developers.home.google.com/cloud-to-cloud/guides/dishwasher Illustrates example payloads for executing commands on a simple dishwasher device, such as starting a cycle or turning it on/off. ```APIDOC ## Sample EXECUTE Commands for a Simple Dishwasher ### Method POST ### Endpoint /execute ### Description This section provides examples of `action.devices.EXECUTE` commands for controlling a simple dishwasher, demonstrating how to start, stop, pause, resume, and change cycles. ### Request Example (Start Cycle) ```json { "requestId": "ff35aee8-610d-496c-857f-f337960d7b01", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123", "name": { "name": "Simple dishwasher" } } ], "execution": [ { "command": "action.devices.commands.RunCycle", "params": { "cycle": "sanitize", "lang": "en" } } ] } ] } } ] } ``` ### Response Example (Start Cycle Success) ```json { "requestId": "ff35aee8-610d-496c-857f-f337960d7b01", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "types": [ "action.devices.types.DISHWASHER" ] } ] } } ``` ### Request Example (Pause) ```json { "requestId": "2f410748-1544-4c1c-b78c-6110a5e17b7a", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123", "name": { "name": "Simple dishwasher" } } ], "execution": [ { "command": "action.devices.commands.Pause", "params": {} } ] } ] } } ] } ``` ### Response Example (Pause Success) ```json { "requestId": "2f410748-1544-4c1c-b78c-6110a5e17b7a", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "types": [ "action.devices.types.DISHWASHER" ] } ] } } ``` ``` -------------------------------- ### Example Device: Simple Closet Source: https://developers.home.google.com/cloud-to-cloud/guides/closet_hl=pt Provides example payloads for SYNC, QUERY, and EXECUTE intents representing a common 'Simple Closet' device. ```APIDOC ## Example Device: Simple Closet ### Description This section provides example intent payloads for a common 'Closet' device based on the defined type and traits. Modifications should be made to reflect any added or removed features in your implementation. ### SYNC Intent Example #### Request ```json { "requestId": "6894439706274654512", "inputs": [ { "intent": "action.devices.SYNC" } ] } ``` #### Response ```json { "requestId": "6894439706274654512", "payload": { "agentUserId": "user123", "devices": [ { "id": "123", "type": "action.devices.types.CLOSET", "traits": [ "action.devices.traits.OpenClose" ], "name": { "name": "Simple closet" }, "willReportState": true, "attributes": { "openDirection": [ "LEFT", "RIGHT" ] }, "deviceInfo": { "manufacturer": "smart-home-inc", "model": "hs1234", "hwVersion": "3.2", "swVersion": "11.4" } } ] } } ``` ### QUERY Intent Example #### Request ```json { "requestId": "6894439706274654514", "inputs": [ { "intent": "action.devices.QUERY", "payload": { "devices": [ { "id": "123" } ] } } ] } ``` #### Response ```json { "requestId": "6894439706274654514", "payload": { "devices": { "123": { "status": "SUCCESS", "online": true, "openState": [ { "openPercent": 30, "openDirection": "LEFT" }, { "openPercent": 50, "openDirection": "RIGHT" } ] } } } } ``` ### EXECUTE Commands Example *Details for EXECUTE commands are typically found in separate documentation for each trait.* ``` -------------------------------- ### Example Mop Device: EXECUTE Commands Source: https://developers.home.google.com/cloud-to-cloud/guides/mop_hl=pl Illustrates example EXECUTE commands for controlling a mop device, such as starting, stopping, or pausing cleaning operations. ```APIDOC ## EXECUTE Commands Example for a Simple Mop ### Description This section provides examples of EXECUTE commands that can be sent to control a mop device, demonstrating how to initiate, stop, or pause cleaning. ### Request Example: Start Cleaning ```json { "requestId": "ff367437-02f1-4b7f-87b0-7557c4722045", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.StartStop", "params": { "start": true } } ] } ] } } ] } ``` ### Request Example: Pause Cleaning ```json { "requestId": "ff367437-02f1-4b7f-87b0-7557c4722046", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.StartStop", "params": { "pause": true } } ] } ] } } ] } ``` ``` -------------------------------- ### EXECUTE StartStop Command Example Source: https://developers.home.google.com/cloud-to-cloud/guides/blender_hl=es Provides an example of an EXECUTE request to start/stop a device and its success response. The response indicates the device is now running and not paused. ```json { "requestId": "6894439706274654518", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.StartStop", "params": { "start": true } } ] } ] } } ] } ``` ```json { "requestId": "6894439706274654518", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "isRunning": true, "isPaused": false } } ] } } ``` -------------------------------- ### Action Devices QUERY Endpoint Example Source: https://developers.home.google.com/cloud-to-cloud/guides/switch_hl=fr Example request and response for the action.devices.QUERY intent, used to get the current state of devices. ```APIDOC ## POST /query ### Description This endpoint handles the QUERY intent, allowing Google to retrieve the current state of specified devices. ### Method POST ### Endpoint /query ### Request Body This is an example of the request body Google sends to your QUERY endpoint. ```json { "requestId": "6894439706274654514", "inputs": [ { "intent": "action.devices.QUERY", "payload": { "devices": [ { "id": "123" } ] } } ] } ``` ### Response #### Success Response (200) This is an example of a successful response from your QUERY endpoint, providing the status of the requested devices. * **devices** (object) - Required - An object containing the status of each device. * **[deviceId]** (object) - Required - Status for a specific device ID. * **status** (string) - Required - The overall status (e.g., "SUCCESS"). * **online** (boolean) - Required - Whether the device is online. * **on** (boolean) - Required - The on/off state of the switch. #### Response Example ```json { "requestId": "6894439706274654514", "payload": { "devices": { "123": { "status": "SUCCESS", "online": true, "on": true } } } } ``` ``` -------------------------------- ### Example Device: Simple Window EXECUTE Commands Source: https://developers.home.google.com/cloud-to-cloud/guides/window_hl=pt Provides examples of EXECUTE intent payloads for controlling a simple window device, demonstrating commands for opening, closing, locking, and unlocking. ```APIDOC ## Example Device: Simple Window - EXECUTE Commands ### Description These are example EXECUTE payloads for controlling a simple window. They illustrate how to send commands to open, close, lock, and unlock the device. ### Request Example (Open Command) ```json { "requestId": "ff367237-4578-4102-990f-323391c5f3c6", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.OpenClose", "params": { "openPercent": 50 } } ] } ] } } ] } ``` ### Request Example (Lock Command) ```json { "requestId": "ab123cd4-56ef-7890-abcd-ef0123456789", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.LockUnlock", "params": { "lock": true } } ] } ] } } ] } ``` ``` -------------------------------- ### Example EXECUTE Commands for Set-top Box Source: https://developers.home.google.com/cloud-to-cloud/guides/settop Demonstrates sample EXECUTE commands for controlling a set-top box, such as turning it on/off, changing volume, and controlling playback. ```APIDOC ## Example EXECUTE Commands for Set-top Box ### Description These examples show how to execute various commands on a set-top box device, including power, volume, transport controls, and app selection. ### Commands **Turn On/Off:** ```json { "commands": [ { "devices": [ { "id": "setTopBox123" } ], "action": "action.devices.commands.OnOff", "params": { "on": true } } ] } ``` **Set Volume:** ```json { "commands": [ { "devices": [ { "id": "setTopBox123" } ], "action": "action.devices.commands.setVolume", "params": { "volumeLevel": 75 } } ] } ``` **Mute/Unmute:** ```json { "commands": [ { "devices": [ { "id": "setTopBox123" } ], "action": "action.devices.commands.mute", "params": { "mute": true } } ] } ``` **Play/Pause/Stop:** ```json { "commands": [ { "devices": [ { "id": "setTopBox123" } ], "action": "action.devices.commands.mediaPause", "params": {} } ] } ``` **Next/Previous Track:** ```json { "commands": [ { "devices": [ { "id": "setTopBox123" } ], "action": "action.devices.commands.mediaNext", "params": {} } ] } ``` **Select Input:** ```json { "commands": [ { "devices": [ { "id": "setTopBox123" } ], "action": "action.devices.commands.setInput", "params": { "newInput": "HDMI 2" } } ] } ``` **Select App:** ```json { "commands": [ { "devices": [ { "id": "setTopBox123" } ], "action": "action.devices.commands.appSelect", "params": { "app": "Netflix" } } ] } ``` ``` -------------------------------- ### Smart Sprinkler EXECUTE Command: TimerStart Example Source: https://developers.home.google.com/cloud-to-cloud/guides/sprinkler_hl=zh-cn This example demonstrates the EXECUTE command for starting a timer on a smart sprinkler. It specifies the command and parameters for the timer duration. ```json { "requestId": "6894439706274654518", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.TimerStart", "params": { "timerTimeSec": 300 } } ] } ] } } ] } { "requestId": "6894439706274654518", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "timerRemainingSec": 300 } } ] } } ``` -------------------------------- ### Simple Mop Example - EXECUTE Commands Source: https://developers.home.google.com/cloud-to-cloud/guides/mop This section is intended to contain example EXECUTE commands for a simple mop device. Typically, this would include examples for actions like StartStop, Dock, or RunCycle traits. ```APIDOC ## POST /execute ### Description This endpoint is used to execute commands on one or more devices. It processes the requested commands and returns the status of the execution. ### Method POST ### Endpoint /execute ### Request Body - **requestId** (string) - Required - Unique identifier for the request. - **inputs** (array) - Required - List of inputs for the execution. - **intent** (string) - Required - The intent, typically `action.devices.EXECUTE`. - **payload** (object) - Required - Payload containing commands to execute. - **commands** (array) - Required - List of commands to execute. - **devices** (array) - Required - List of devices to perform the command on. - **id** (string) - Required - The unique identifier of the device. - **execution** (array) - Required - List of executions for the command. - **command** (string) - Required - The command to execute (e.g., `action.devices.commands.StartStop`). - **params** (object) - Optional - Parameters for the command. ### Request Example ```json { "requestId": "123456789", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.StartStop", "params": { "start": true } } ] } ] } } ] } ``` ### Response #### Success Response (200) - **requestId** (string) - Unique identifier for the request. - **payload** (object) - Contains the results of the command execution. - **commands** (array) - List of command results. - **ids** (array) - List of device IDs that the command was applied to. - **status** (string) - The status of the command execution (e.g., `SUCCESS`, `PENDING`, `ERROR`). - **errorCode** (string) - If status is `ERROR`, provides an error code. #### Response Example ```json { "requestId": "123456789", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "isRunning": true, "online": true } } ] } } ``` ``` -------------------------------- ### Example QUERY Response for Set-top Box Source: https://developers.home.google.com/cloud-to-cloud/guides/settop Illustrates a sample QUERY response for a set-top box, showing how to report the current states of its supported traits. ```APIDOC ## Example QUERY Response for Set-top Box ### Description This sample QUERY response provides the current state for a set-top box, including volume level and on/off status. ### Response Body ```json { "requestId": "ff36a3cc-ab23-4f43-90b9-08401232031f", "payload": { "devices": { "setTopBox123": { "onOff": { "on": true }, "volume": { "level": 50, "mute": false }, "queryErrors": [] } } } } ``` ``` -------------------------------- ### Example: Simple Microwave EXECUTE Commands Source: https://developers.home.google.com/cloud-to-cloud/guides/microwave_hl=de Provides example command payloads for executing actions on a simple microwave device, such as starting, stopping, or setting timers. ```APIDOC ### Example EXECUTE Commands Not provided in the source text. ``` -------------------------------- ### EXECUTE - StartStop Command Source: https://developers.home.google.com/cloud-to-cloud/guides/yogurtmaker_hl=es Example of executing the `action.devices.commands.StartStop` command for a device. ```APIDOC ## EXECUTE - StartStop Command ### Description This endpoint allows you to execute the `action.devices.commands.StartStop` command to control the running state of a device. Consult the `action.devices.traits.StartStop` documentation for detailed parameter information. ### Method POST ### Endpoint /execute ### Parameters #### Request Body - **requestId** (string) - Required - Unique identifier for the request. - **inputs** (array) - Required - List of inputs for the execution. - **intent** (string) - Required - The intent, which must be `action.devices.EXECUTE`. - **payload** (object) - Required - Payload for the execution. - **commands** (array) - Required - List of commands to execute. - **devices** (array) - Required - List of devices to command. - **id** (string) - Required - The ID of the device. - **execution** (array) - Required - List of executions for the command. - **command** (string) - Required - The command to execute (e.g., `action.devices.commands.StartStop`). - **params** (object) - Required - Parameters for the command. - **start** (boolean) - Required - Whether to start or stop the device. ### Request Example ```json { "requestId": "6894439706274654518", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.StartStop", "params": { "start": true } } ] } ] } } ] } ``` ### Response #### Success Response (200) - **requestId** (string) - Unique identifier for the request. - **payload** (object) - Contains command execution results. - **commands** (array) - List of executed commands. - **ids** (array) - List of device IDs the command was applied to. - **status** (string) - The status of the command execution (e.g., `SUCCESS`). - **states** (object) - The resulting states of the device after the command. - **online** (boolean) - Indicates if the device is online. - **isRunning** (boolean) - Indicates if the device is running. - **isPaused** (boolean) - Indicates if the device is paused. #### Response Example ```json { "requestId": "6894439706274654518", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "isRunning": true, "isPaused": false } } ] } } ``` ``` -------------------------------- ### EXECUTE Commands Example for KETTLE Source: https://developers.home.google.com/cloud-to-cloud/guides/kettle_hl=fr Examples of EXECUTE commands for a kettle device, covering actions like turning the device on/off and setting the temperature. ```APIDOC ## EXECUTE Commands Example ### Description This section provides examples of `action.devices.EXECUTE` commands for a kettle, including turning the device on/off and setting the temperature. The exact command structure depends on the traits implemented. ### Method POST ### Endpoint `/execute` ### Request Example (Turn On) ```json { "requestId": "12345", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.OnOff", "params": { "on": true } } ] } ] } } ] } ``` ### Request Example (Set Temperature) ```json { "requestId": "67890", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.SetTemperature", "params": { "temperatureSetpointCelsius": 90 } } ] } ] } } ] } ``` ### Response Example (200 OK - for OnOff command) ```json { "requestId": "12345", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "on": true, "online": true } } ] } } ``` ### Response Example (200 OK - for SetTemperature command) ```json { "requestId": "67890", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "temperatureSetpointCelsius": 90 } } ] } } ``` ``` -------------------------------- ### Device Example: Simple Microwave (EXECUTE Command - TimerStart) Source: https://developers.home.google.com/cloud-to-cloud/guides/microwave_hl=zh-cn Shows an example EXECUTE command for the `TimerStart` trait, demonstrating how to set and start a timer on a microwave device. ```APIDOC #### TimerStart **Request Example:** ```json { "requestId": "6894439706274654522", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.TimerStart", "params": { "timerTimeSec": 60 } } ] } ] } } ] } ``` **Response Example:** ```json { "requestId": "6894439706274654522", "payload": { "commands": [ { "ids": ["123"], "status": "SUCCESS", "states": { "online": true, "timerRemainingSec": 60 } } ] } } ``` ``` -------------------------------- ### Sample EXECUTE Commands for a Simple Camera Source: https://developers.home.google.com/cloud-to-cloud/guides/camera_hl=es-419 This section is intended to provide example EXECUTE commands for a simple camera, but the provided text does not contain specific examples. Typically, this would include commands for actions like starting/stopping streams, etc. ```APIDOC ## Sample EXECUTE Commands ### Description This section would typically detail example payloads for the `EXECUTE` intent, demonstrating how to control device features. The provided documentation does not include specific examples for camera EXECUTE commands. Please refer to the `action.devices.traits.CameraStream` documentation for details on available commands. ``` -------------------------------- ### SYNC Response Example for Scene Device - JSON Source: https://developers.home.google.com/cloud-to-cloud/guides/scene_hl=ar This is an example of a SYNC response for a device of type `action.devices.types.SCENE`. It includes device ID, type, traits, name, and optional attributes like `sceneReversible`. ```JSON { "requestId": "6894439706274654512", "inputs": [ { "intent": "action.devices.SYNC" } ] } ``` ```JSON { "requestId": "6894439706274654512", "payload": { "agentUserId": "user123", "devices": [ { "id": "123", "type": "action.devices.types.SCENE", "traits": [ "action.devices.traits.Scene" ], "name": { "name": "Simple scene" }, "willReportState": true, "attributes": { "sceneReversible": true }, "deviceInfo": { "manufacturer": "smart-home-inc", "model": "hs1234", "hwVersion": "3.2", "swVersion": "11.4" } } ] } } ```