### Install Application Command Example Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/app_install_command This example demonstrates how to use the AppInstallCommand to install the YouTube application on a specified device. It requires the device name and the application's name as input. ```yaml actions: - type: device.command.AppInstall devices: My Device - Room Name newApplicationName: YouTube ``` -------------------------------- ### Start Device Command Example - YAML Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/start_stop_command This example demonstrates how to use the StartStop command in YAML to initiate a device's operation. It specifies the device to be controlled and sets the 'start' parameter to true. ```yaml actions: - type: device.command.StartStop devices: My Device - Room Name start: true ``` -------------------------------- ### RotationState Starter and Condition Examples Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/rotation_state Provides examples of how to define a device starter and a condition using the RotationState schema. These examples demonstrate checking the 'rotationPercent' state of a device against a specific numerical value. ```yaml starters: - type: device.state.Rotation device: My Device - Room Name state: rotationPercent is: Some Number condition: type: device.state.Rotation device: My Device - Room Name state: rotationPercent is: Some Number ``` -------------------------------- ### Start Timer Command Example (YAML) Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/timer_start_command This example demonstrates how to use the TimerStart command within an automation script. It specifies the target device and the duration for the timer to count down from. ```yaml actions: - type: device.command.TimerStart devices: My Device - Room Name duration: 10min ``` -------------------------------- ### OccupancySensing Starter Example Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/occupancy_sensing_state Example of how to define a starter for the OccupancySensing state. This starter triggers when a device's occupancy state becomes 'OCCUPIED'. ```yaml starters: - type: device.state.OccupancySensing device: My Device - Room Name state: occupancy is: OCCUPIED ``` -------------------------------- ### EnergyStorage Starter Example - YAML Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/energy_storage_state An example demonstrating how to use the EnergyStorage state as a starter in an automation. It checks if a specific device is plugged in. ```yaml starters: - type: device.state.EnergyStorage device: My Device - Room Name state: isPluggedIn is: true ``` -------------------------------- ### MotionDetection Starter Example Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/motion_detection_state An example of how to configure a starter for motion detection. This starter will trigger when motion is detected by a specific device. ```yaml starters: - type: device.state.MotionDetection device: My Device - Room Name state: motionDetectionEventInProgress is: true ``` -------------------------------- ### RunCycle State Starter Example Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/run_cycle_state An example of how to configure a starter for the RunCycle device state. It specifies the device, the state to monitor ('currentRunCycle'), and the condition for triggering ('is: Some Text'). ```yaml starters: - type: device.state.RunCycle device: My Device - Room Name state: currentRunCycle is: Some Text ``` -------------------------------- ### Home Presence Starter Example Source: https://developers.home.google.com/automations/schema/automations An example of a starter based on the home's presence mode. This starter triggers when the presence mode changes to `HOME`. ```yaml type: home.state.HomePresence state: homePresenceMode is: HOME ``` -------------------------------- ### StartStop State Examples Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/start_stop_state Provides practical examples of how to use the StartStop state in automation configurations, demonstrating its use in starters and conditions. ```APIDOC ## Examples ``` starters: - type: device.state.StartStop device: My Device - Room Name state: isRunning is: true condition: type: device.state.StartStop device: My Device - Room Name state: isRunning is: false ``` ``` -------------------------------- ### OkGoogleCommand Examples Source: https://developers.home.google.com/automations/schema/reference/entity/assistant/ok_google_command Provides examples of how to use the OkGoogleCommand schema to trigger various 'Ok Google' commands for different purposes. ```APIDOC ## OkGoogleCommand Examples ### Description These examples demonstrate the usage of the OkGoogleCommand within an automation flow, specifying the device and the 'Ok Google' command. ### Request Example ```yaml actions: - type: assistant.command.OkGoogle devices: My Speaker - Room Name okGoogle: Tell me the weather ``` ### Request Example ```yaml actions: - type: assistant.command.OkGoogle devices: My Speaker - Room Name okGoogle: Play music ``` ### Request Example ```yaml actions: - type: assistant.command.OkGoogle devices: My Speaker - Room Name okGoogle: Bark ``` ``` -------------------------------- ### SensorState Starter Examples (YAML) Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/sensor_state_state Examples demonstrating how to use the SensorState type as a starter in automation scripts. These examples cover checking for specific string states like 'high' smoke level and numerical states using 'greaterThan'. They are defined in YAML format. ```yaml starters: - type: device.state.SensorState device: My Device - Room Name state: currentSensorStateData.SmokeLevel.currentSensorState is: high starters: - type: device.state.SensorState device: My Device - Room Name state: currentSensorStateData.SmokeLevel.rawValue greaterThan: 200 starters: - type: device.state.SensorState device: My Device - Room Name state: currentSensorStateData.CarbonMonoxideLevel.currentSensorState is: carbon monoxide detected ``` -------------------------------- ### InputSelector Examples Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/input_selector_state Examples demonstrating how to use the InputSelector state for device automations and conditions. ```APIDOC ## Examples ### Starter Example ```yaml starters: - type: device.state.InputSelector device: My Device - Room Name state: currentInput is: HDMI 1 ``` ### Condition Example ```yaml condition: type: device.state.InputSelector device: My Device - Room Name state: currentInput is: HDMI 1 ``` ``` -------------------------------- ### Automations Struct Examples Source: https://developers.home.google.com/automations/schema/automations Demonstrates two examples of the `automations` struct. The first triggers when a TV turns on and adjusts lights. The second schedules actions based on sunset and specific weekdays. These examples illustrate the use of device state starters and device command actions. ```yaml automations: - name: Dim the lights starters: - type: device.state.OnOff device: My TV - Living Room state: on is: true actions: - type: device.command.OnOff devices: - Light A - Living Room - Light B - Living Room on: true - type: device.command.BrightnessAbsolute devices: - Light A - Living Room - Light B - Living Room brightness: 50 ``` ```yaml automations: - name: Dim the lights starters: - type: time.schedule at: SUNSET weekday: - MONDAY - THURSDAY state: on is: true actions: - type: device.command.OnOff devices: - Light A - Living Room - Light B - Living Room on: true - type: device.command.BrightnessAbsolute devices: - Light A - Living Room - Light B - Living Room brightness: 50 ``` -------------------------------- ### Device Channel State Starter Example Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/channel_state An example of how to use the Channel state as a starter for automations. This starter triggers when a specific device's channel state changes. ```yaml starters: - type: device.state.Channel device: My Device - Room Name ``` -------------------------------- ### Time Schedule Starter Example Source: https://developers.home.google.com/automations/schema/automations An example of a `time.schedule` starter configuration. It specifies triggering an automation at a relative time (e.g., 30 minutes after sunrise) on specific weekdays. ```yaml type: time.schedule at: sunrise+30min weekdays: - MON - TUE ``` -------------------------------- ### Device Event Doorbell Starter Example Source: https://developers.home.google.com/automations/schema/automations A simple starter example that triggers when a specific device event occurs, such as a doorbell press. It requires the `device` name. ```yaml type: device.event.DoorbellPress device: My doorbell - Frontdoor ``` -------------------------------- ### MediaShuffleCommand Example (YAML) Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/media_shuffle_command This example demonstrates how to use the MediaShuffleCommand to shuffle a media playlist. It specifies the command type and the target device for playback control. ```yaml actions: - type: device.command.MediaShuffle devices: My Device - Room Name ``` -------------------------------- ### TemperatureControl State Examples Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/temperature_control_state Provides examples of how to use the TemperatureControl state as a starter or condition in automation scripts. It demonstrates checking the ambient temperature against a specific value. ```yaml starters: - type: device.state.TemperatureControl device: My Device - Room Name state: temperatureAmbient is: 70F condition: type: device.state.TemperatureControl device: My Device - Room Name state: temperatureAmbient is: 70F ``` -------------------------------- ### OnOffState Starter Example - YAML Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/on_off_state Example of how to use the OnOffState schema as a starter in Google Automations. This starter triggers when the 'on' state of 'My Device - Room Name' becomes true. ```yaml starters: - type: device.state.OnOff device: My Device - Room Name state: on is: true ``` -------------------------------- ### DispenseCommand Example (YAML) Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/dispense_command This example demonstrates how to use the DispenseCommand to dispense a specified amount of an item. It requires specifying the target device, the item name, the amount, and the unit of measurement. ```yaml actions: - type: device.command.Dispense devices: My Device - Room Name item: Some String amount: 10 unit: Some String ``` -------------------------------- ### HumiditySetting Starter Example - YAML Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/humidity_setting_state This example demonstrates how to use the HumiditySetting state as a starter in Google Automations. It specifies the device, the state to monitor (humidity setpoint percentage), and the condition (is 50%). ```yaml starters: - type: device.state.HumiditySetting device: My Device - Room Name state: humiditySetpointPercent is: 50 ``` -------------------------------- ### MediaNextCommand Example (YAML) Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/media_next_command This example demonstrates how to use the MediaNextCommand in a YAML configuration to advance media playback on specified devices. It requires the 'devices' field to be populated with the names or identifiers of the target devices. ```yaml actions: - type: device.command.MediaNext devices: My Device - Room Name ``` -------------------------------- ### Turn Light On and Off after Delay using Google Automations Schema Source: https://developers.home.google.com/automations/schema/reference/standard/action This example illustrates a sequence of actions to turn a light on, wait for 5 minutes, and then turn it off. It uses device.command.OnOff for light control and time.delay for the pause. ```yaml actions: - type: device.command.OnOff devices: Light A - Living Room on: true - type: time.delay for: 5min - type: device.command.OnOff devices: Light A - Living Room on: false ``` -------------------------------- ### MotionDetectionEvent Starter Example (YAML) Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/motion_detection_event This example demonstrates how to use the MotionDetectionEvent as a starter in Google Automations. It specifies the event type and the target device. This starter is triggered when motion is detected by the specified device. ```yaml starters: - type: device.event.MotionDetection device: My Device - Room Name ``` -------------------------------- ### LightEffectPulseCommand Example (YAML) Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/light_effect_pulse_command This example demonstrates how to use the LightEffectPulseCommand to create a pulsing light effect. It specifies the device, the command type, and the duration of the effect. ```yaml actions: - type: device.command.LightEffectPulse devices: My Device - Room Name duration: 10min ``` -------------------------------- ### Activate Scene Command Example (YAML) Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/activate_scene_command This example demonstrates how to use the ActivateSceneCommand to activate a scene on a specified device. It requires the device identifier and a boolean to indicate activation. ```yaml actions: - type: device.command.ActivateScene devices: My Device - Room Name activate: true ``` -------------------------------- ### SetInputCommand Example (YAML) Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/set_input_command This example demonstrates how to use the SetInputCommand to change the media input on a specified device. It requires the device identifier and the desired new input name. ```yaml actions: - type: device.command.SetInput devices: My Device - Room Name newInput: InputName ``` -------------------------------- ### MovingVehicleDetectionEvent Starter Example Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/moving_vehicle_detection_event This example demonstrates how to configure the MovingVehicleDetectionEvent starter in an automation. It specifies the event type and the camera device to monitor. This starter is used to initiate an automation when a vehicle is detected. ```yaml starters: - type: device.event.MovingVehicleDetection device: My Camera - Room Name ``` -------------------------------- ### AppSearchCommand Example for Searching YouTube Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/app_search_command This example demonstrates how to use the AppSearchCommand to find the 'YouTube' application on a specified device. It requires the device identifier and the application name as input. ```yaml actions: - type: device.command.AppSearch devices: My Device - Room Name applicationName: YouTube ``` -------------------------------- ### PersonTalkingEvent Starter Example Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/person_talking_event This example demonstrates how to configure the PersonTalkingEvent as a starter in an automation script. It specifies the type of event and the target device. This is a basic configuration for detecting when a person is talking on a specific device. ```yaml starters: - type: device.event.PersonTalking device: My Camera - Room Name ``` -------------------------------- ### Control Cooking Device with Cook Command Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/cook_command This example demonstrates how to use the `device.command.Cook` command to control a cooking device. It specifies the target device, whether to start or stop cooking, and optionally sets the cooking mode. ```yaml actions: - type: device.command.Cook devices: My Device - Room Name start: true cookingMode: Some String ``` -------------------------------- ### TimeScheduleEvent Configuration Example Source: https://developers.home.google.com/automations/schema/reference/standard/time_schedule_event Configures a time schedule event to start an automation at a specific time on chosen weekdays. The 'at' field specifies the time, and 'weekdays' lists the applicable days. If 'weekdays' is empty, the schedule applies daily. ```YAML starters: type: time.schedule at: 12:00 pm weekdays: - SUN - SAT ``` -------------------------------- ### YAML String Value Quoting Examples Source: https://developers.home.google.com/automations/schema/basics Illustrates correct and incorrect quoting for YAML string values. Quotes are necessary when a string starts with special characters like '[', '{', '"', "'", '#' or contains ': '. Mismatched quotes are invalid. ```yaml name: 'TV on lights off' name: "TV on lights off" ``` ```yaml name: 'TV on lights off" ``` ```yaml name: "[1] TV" name: '{1} TV' name: '#TV' name: '"1" TV' name: "'1' TV" name: "\"1\" TV" name: "TV: bedroom" ``` -------------------------------- ### Turn on TV and Light using Google Automations Schema Source: https://developers.home.google.com/automations/schema/reference/standard/action This example shows a single action to turn on both a TV and a light using the device.command.OnOff type in the Google Automations schema. It targets specific devices and sets their state to 'on'. ```yaml actions: type: device.command.OnOff devices: - TV - Living Room - Light A - Living Room on: true ``` -------------------------------- ### OkGoogleEvent Starter Example Source: https://developers.home.google.com/automations/schema/reference/entity/assistant/ok_google_event This example demonstrates how to use the OkGoogleEvent starter to trigger an automation when a specific Google Assistant query is detected. It utilizes the 'eventData' field to specify the query type and the 'is' field to match the exact phrase. This starter is designed for use within Google Assistant automations. ```yaml starters: - type: assistant.event.OkGoogle eventData: query is: Movie time # No need to add "Ok Google" to the query here. ``` -------------------------------- ### OrCondition Usage Example Source: https://developers.home.google.com/automations/schema/reference/standard/or_condition Example demonstrating how to use the OrCondition to check if the TV is on OR the time is after 6 pm. ```APIDOC ## Example Usage: OrCondition ### Description This example shows how to use the `OrCondition` to trigger an automation if either the TV is on OR the current time is after 6:00 PM. ### Method N/A (Schema Definition Example) ### Endpoint N/A (Schema Definition Example) ### Parameters None directly in this example, as it illustrates the structure within a larger automation context. ### Request Example ```yaml condition: type: or conditions: - type: device.state.OnOff device: TV - Living Room state: on is: true - type: time.between after: 6:00 pm ``` ### Response N/A (Schema Definition Example) ``` -------------------------------- ### BrightnessState Starter Example Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/brightness_state This example shows how to use the BrightnessState schema as a starter for an automation. It triggers when the 'My Device - Room Name' device's brightness state reaches exactly 50. The 'for' field can be used to specify a duration, but is omitted here. ```yaml starters: - type: device.state.Brightness device: My Device - Room Name state: brightness is: 50 ``` -------------------------------- ### AND Condition Example (YAML) Source: https://developers.home.google.com/automations/schema/reference/standard/condition An example demonstrating the use of an AND condition to combine multiple criteria, such as a device being on and a specific time being met. ```yaml condition: type: and conditions: - type: device.state.OnOff device: TV - Living Room state: on is: true - type: time.between after: 6:00 pm ``` -------------------------------- ### Rotation State Examples Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/rotation_state Provides example configurations for using the Rotation state as a starter or a condition in automations. ```APIDOC ## Examples ### Description Illustrates how to use the `Rotation` state in different automation contexts. ### Request Example **Starter Example:** ```yaml starters: - type: device.state.Rotation device: My Device - Room Name state: rotationPercent is: Some Number ``` **Condition Example:** ```yaml condition: type: device.state.Rotation device: My Device - Room Name state: rotationPercent is: Some Number ``` ``` -------------------------------- ### OpenClose State Starter Example Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/open_close_state This code snippet demonstrates how to configure a starter for the OpenClose device state. It specifies the device, the state to monitor ('openPercent'), and the condition for triggering (state 'is' 100). ```yaml starters: - type: device.state.OpenClose device: My Device - Room Name state: openPercent is: 100 ``` -------------------------------- ### AppInstallCommand Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/app_install_command This command allows you to install a specified application onto one or more devices that support app installations, such as TVs. ```APIDOC ## POST /automations/schema/commands/appInstall ### Description Install an application on the given device. ### Method POST ### Endpoint `/automations/schema/commands/appInstall` ### Parameters #### Request Body - **devices** (Device) - Required - Devices that support apps such as TVs. - **newApplicationName** (String) - Required - Name of the application to install. ### Request Example ```json { "actions": [ { "type": "device.command.AppInstall", "devices": "My Device - Room Name", "newApplicationName": "YouTube" } ] } ``` ### Response #### Success Response (200) - **status** (String) - Indicates the success or failure of the command execution. - **error_code** (String) - If an error occurred, this field provides a specific error code. #### Response Example ```json { "status": "SUCCESS" } ``` ``` -------------------------------- ### OkGoogleCommand Examples (YAML) Source: https://developers.home.google.com/automations/schema/reference/entity/assistant/ok_google_command These examples demonstrate how to use the OkGoogleCommand within an automation. They specify the command type, target devices, and the 'okGoogle' command to be executed. This allows for hands-free control of smart home devices and services. ```yaml actions: - type: assistant.command.OkGoogle devices: My Speaker - Room Name okGoogle: Tell me the weather actions: - type: assistant.command.OkGoogle devices: My Speaker - Room Name okGoogle: Play music actions: - type: assistant.command.OkGoogle devices: My Speaker - Room Name okGoogle: Bark ``` -------------------------------- ### StartStop State - YAML Example Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/start_stop_state This snippet demonstrates how to use the device.state.StartStop type in YAML for creating starters and conditions. It shows how to specify the device, the state to check (e.g., isRunning), and the desired value (true or false). ```yaml starters: - type: device.state.StartStop device: My Device - Room Name state: isRunning is: true condition: type: device.state.StartStop device: My Device - Room Name state: isRunning is: false ``` -------------------------------- ### OccupancySensing Condition Example Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/occupancy_sensing_state Example of how to define a condition for the OccupancySensing state. This condition checks if a device's occupancy state is 'UNOCCUPIED'. ```yaml condition: type: device.state.OccupancySensing device: My Device - Room Name state: occupancy is: UNOCCUPIED ``` -------------------------------- ### Device State Volume Starter Example Source: https://developers.home.google.com/automations/schema/automations Illustrates a starter that triggers based on a device's state, specifically the volume level of a TV. It uses `greaterThan` and `lessThan` to define a volume range. ```yaml type: device.state.Volume device: My TV - Living Room state: currentVolume greaterThan: 1 lessThan: 10 ``` -------------------------------- ### Array of Starters (Standard Format) Source: https://developers.home.google.com/automations/schema/basics Demonstrates the standard YAML format for defining an array of starter Structs. Each item in the array is a starter with its own type and parameters. ```yaml starters: - type: time.schedule at: sunset - type: time.schedule at: sunrise ``` -------------------------------- ### BrightnessRelativeCommand Example Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/brightness_relative_command An example demonstrating how to use the BrightnessRelativeCommand to adjust device brightness by a percentage. This command can turn devices on or off based on the brightness value. ```yaml actions: type: device.command.BrightnessRelative devices: My Device - Room Name brightnessRelativePercent: 50 ``` -------------------------------- ### Single Automation Configuration using YAML Source: https://developers.home.google.com/automations/schema/reference/standard/automation This example demonstrates how to configure a single automation to turn on a light at a specific time. It uses a time-based starter and a device command action. ```yaml automations: starters: type: time.schedule at: 6:00 pm actions: type: device.command.OnOff devices: Light A - Living Room on: true ``` -------------------------------- ### Home Presence Condition Example Source: https://developers.home.google.com/automations/schema/automations An example of a condition using `home.state.HomePresence`. This condition checks if the home presence mode is set to `AWAY`. ```yaml type: home.state.HomePresence state: homePresenceMode is: AWAY ``` -------------------------------- ### MotionDetection Condition Example Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/motion_detection_state An example of how to configure a condition for motion detection. This condition checks if motion is currently detected by a specific device. ```yaml condition: type: device.state.MotionDetection device: My Device - Room Name state: motionDetectionEventInProgress is: true ``` -------------------------------- ### Check if Device is Armed (Starter) Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/arm_disarm_state This example demonstrates how to set up a starter that triggers when a device's `isArmed` state becomes true. It requires the device name and specifies the `isArmed` field with an expected value of `true`. ```yaml starters: - type: device.state.ArmDisarm device: My Device - Room Name state: isArmed is: true ``` -------------------------------- ### HumidityRelativeCommand Example - YAML Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/humidity_relative_command This example demonstrates how to use the HumidityRelativeCommand to adjust the humidity level of a device. It specifies the device and the desired relative humidity adjustment. ```yaml actions: - type: device.command.HumidityRelative devices: My Device - Room Name relativeHumidityPercent: 10 ``` -------------------------------- ### MotionDetectionEvent Starter Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/motion_detection_event This example shows how to configure the MotionDetectionEvent starter in your automations.yaml file. It specifies the type of event and the device from which to detect motion. ```APIDOC ## POST /automations/schema/starters/device.event.MotionDetection ### Description This starter triggers when motion is detected by a specified Nest camera device. ### Method POST ### Endpoint /automations/schema/starters/device.event.MotionDetection ### Parameters #### Request Body - **type** (string) - Required - Specifies the type of starter, which is 'device.event.MotionDetection'. - **device** (Device) - Required - The Nest camera device that has this feature enabled. - **eventData** (FieldPath) - Optional - A specific piece of event data to check. Requires at least one of the comparison fields (_is_, _isNot_, _greaterThan_, _greaterThanOrEqualTo_, _lessThan_, _lessThanOrEqualTo_) to be used. - **is** (Dynamic) - Optional - Checks if the event data is equal to a value. Cannot be used with _isNot_, _greaterThanOrEqualTo_, _greaterThan_, _lessThanOrEqualTo_, _lessThan_. Requires _eventData_. - **isNot** (Dynamic) - Optional - Checks if the event data is not equal to a value. Cannot be used with _is_, _greaterThanOrEqualTo_, _greaterThan_, _lessThanOrEqualTo_, _lessThan_. Requires _eventData_. - **greaterThan** (Dynamic) - Optional - Checks if the event data is greater than a value. Cannot be used with _isNot_, _is_, _greaterThanOrEqualTo_. - **greaterThanOrEqualTo** (Dynamic) - Optional - Checks if the event data is greater than or equal to a value. Cannot be used with _isNot_, _is_, _greaterThan_. - **lessThan** (Dynamic) - Optional - Checks if the event data is less than a value. Cannot be used with _isNot_, _is_, _lessThanOrEqualTo_. - **lessThanOrEqualTo** (Dynamic) - Optional - Checks if the event data is less than or equal to a value. Cannot be used with _isNot_, _is_, _lessThan_. - **for** (Duration) - Optional - Checks if the elapsed time duration since the last valid event has exceeded this value. Only applicable for Starters, cannot be used with Conditions. - **suppressFor** (Duration) - Optional - Suppresses the triggering of the starter for a certain time period. ### Request Example ```json { "starters": [ { "type": "device.event.MotionDetection", "device": "My Device - Room Name" } ] } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### EnergyStorage Condition Example - YAML Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/energy_storage_state An example illustrating the use of the EnergyStorage state as a condition in an automation. It checks if a specific device is not currently charging. ```yaml condition: type: device.state.EnergyStorage device: My Device - Room Name state: isCharging is: false ``` -------------------------------- ### BroadcastCommand Usage Example - YAML Source: https://developers.home.google.com/automations/schema/reference/entity/assistant/broadcast_command This example demonstrates how to use the BroadcastCommand in YAML format. It shows how to specify devices and messages for broadcasting content. ```yaml actions: - type: assistant.command.Broadcast devices: - My Speaker 1 - Room Name - My Speaker 2 - Room Name message: Some message actions: - type: assistant.command.Broadcast message: Some message ``` -------------------------------- ### ColorSetting State Examples for Automations Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/color_setting_state Demonstrates how to use the ColorSetting state in Google Automations scripts. This includes defining starters and conditions to trigger automations based on device color temperature. ```yaml starters: - type: device.state.ColorSetting device: My Device - Room Name state: color.colorTemperature is: 2000K condition: type: device.state.ColorSetting device: My Device - Room Name state: color.colorTemperature is: 2000K ``` -------------------------------- ### Resume Timer Command Example (YAML) Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/timer_resume_command This example demonstrates how to use the TimerResumeCommand in an automation script. It specifies the command type and the target devices for resuming the timer. ```YAML actions: - type: device.command.TimerResume devices: My Device - Room Name ``` -------------------------------- ### ThermostatTemperatureSetpointCommand Example (YAML) Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/thermostat_temperature_setpoint_command This example demonstrates how to use the ThermostatTemperatureSetpointCommand to set a thermostat to a specific temperature. It requires the device name and the desired temperature setpoint. ```yaml actions: - type: device.command.ThermostatTemperatureSetpoint devices: My Device - Room Name thermostatTemperatureSetpoint: 68F ``` -------------------------------- ### SoundEvent Starter Example for Google Automations Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/sound_event This example demonstrates how to configure the SoundEvent starter in Google Automations. It specifies the type of event ('device.event.Sound') and the target device. This starter is used to detect sound events from a specified device. ```YAML starters: - type: device.event.Sound device: My Camera - Room Name ``` -------------------------------- ### PackageDeliveredEvent Starter Example Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/package_delivered_event This example demonstrates how to set up a starter for the PackageDeliveredEvent, which triggers an automation when a package is detected by a specified Nest camera device. It requires the 'device' field to be set to the name of the camera. ```yaml starters: - type: device.event.PackageDelivered device: My Camera - Room Name ``` -------------------------------- ### Stop Light Effect Command Example Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/stop_light_effect_command This example demonstrates how to use the StopLightEffectCommand to stop a light effect on a device. It specifies the type of command and the target device. ```YAML actions: - type: device.command.StopLightEffect devices: My Device - Room Name ``` -------------------------------- ### AppSelectorState Starter and Condition Examples Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/app_selector_state Demonstrates how to use the AppSelectorState schema for device starters and conditions. It specifies the device, the state to monitor (currentApplication), and the desired value using the 'is' field. This configuration triggers an automation when the specified device's current application matches 'Some Text'. ```yaml starters: - type: device.state.AppSelector device: My Device - Room Name state: currentApplication is: Some Text condition: type: device.state.AppSelector device: My Device - Room Name state: currentApplication is: Some Text ``` -------------------------------- ### MediaState Starter and Condition Examples (YAML) Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/media_state_state Demonstrates how to use the MediaState state for media playback status in both 'starters' and 'conditions' within Google Automations. It specifies the device, the state to check (playbackState), and the desired value (PLAYING). ```yaml starters: - type: device.state.MediaState device: My Device - Room Name state: playbackState is: PLAYING condition: type: device.state.MediaState device: My Device - Room Name state: playbackState is: PLAYING ``` -------------------------------- ### Reboot Device Command Example - YAML Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/reboot_command This example demonstrates how to use the Reboot command in YAML format for device automation. It specifies the command type and the target device. ```yaml actions: type: device.command.Reboot devices: My Device - Room Name ``` -------------------------------- ### Cook State Condition Example Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/cook_state This example shows how to use the 'device.state.Cook' type as a condition in Google Automations. It verifies if the 'currentCookingMode' of a specified device is 'COOK'. ```yaml condition: type: device.state.Cook device: My Device - Room Name state: currentCookingMode is: COOK ``` -------------------------------- ### Cook State Starter Example Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/cook_state This example demonstrates how to use the 'device.state.Cook' type as a starter in Google Automations. It checks if the 'currentCookingMode' of a specific device is 'WARM'. ```yaml starters: - type: device.state.Cook device: My Device - Room Name state: currentCookingMode is: WARM ``` -------------------------------- ### Fill Command Example for Device Automation Source: https://developers.home.google.com/automations/schema/reference/entity/sht_device/fill_command This example demonstrates how to use the Fill command to fill a device to a specified level. It requires specifying the target device and the desired fill state (true for filling). The 'fillLevel' parameter is optional and sets a specific level like 'full'. ```yaml actions: - type: device.command.Fill devices: My Device - Room Name fill: true fillLevel: full ```