<br />

## Description

A general automation condition. This is a
[Typed Struct](https://developers.home.google.com/automation/schema/basics#typed_struct).

## One of Fields

| Type | Extended Struct |
|---|---|
| and | [AndCondition](https://developers.home.google.com/automations/schema/reference/standard/and_condition.md.txt) |
| device.state.AppSelector | [AppSelectorState](https://developers.home.google.com/automations/schema/reference/entity/sht_device/app_selector_state.md.txt) |
| device.state.ArmDisarm | [ArmDisarmState](https://developers.home.google.com/automations/schema/reference/entity/sht_device/arm_disarm_state.md.txt) |
| device.state.Brightness | [BrightnessState](https://developers.home.google.com/automations/schema/reference/entity/sht_device/brightness_state.md.txt) |
| device.state.Channel | [ChannelState](https://developers.home.google.com/automations/schema/reference/entity/sht_device/channel_state.md.txt) |
| device.state.ColorSetting | [ColorSettingState](https://developers.home.google.com/automations/schema/reference/entity/sht_device/color_setting_state.md.txt) |
| device.state.Cook | [CookState](https://developers.home.google.com/automations/schema/reference/entity/sht_device/cook_state.md.txt) |
| device.state.Dock | [DockState](https://developers.home.google.com/automations/schema/reference/entity/sht_device/dock_state.md.txt) |
| device.state.EnergyStorage | [EnergyStorageState](https://developers.home.google.com/automations/schema/reference/entity/sht_device/energy_storage_state.md.txt) |
| device.state.FanSpeed | [FanSpeedState](https://developers.home.google.com/automations/schema/reference/entity/sht_device/fan_speed_state.md.txt) |
| device.state.Fill | [FillState](https://developers.home.google.com/automations/schema/reference/entity/sht_device/fill_state.md.txt) |
| device.state.HumiditySetting | [HumiditySettingState](https://developers.home.google.com/automations/schema/reference/entity/sht_device/humidity_setting_state.md.txt) |
| device.state.InputSelector | [InputSelectorState](https://developers.home.google.com/automations/schema/reference/entity/sht_device/input_selector_state.md.txt) |
| device.state.LightEffects | [LightEffectsState](https://developers.home.google.com/automations/schema/reference/entity/sht_device/light_effects_state.md.txt) |
| device.state.LockUnlock | [LockUnlockState](https://developers.home.google.com/automations/schema/reference/entity/sht_device/lock_unlock_state.md.txt) |
| device.state.MediaState | [MediaStateState](https://developers.home.google.com/automations/schema/reference/entity/sht_device/media_state_state.md.txt) |
| device.state.MotionDetection | [MotionDetectionState](https://developers.home.google.com/automations/schema/reference/entity/sht_device/motion_detection_state.md.txt) |
| device.state.OccupancySensing | [OccupancySensingState](https://developers.home.google.com/automations/schema/reference/entity/sht_device/occupancy_sensing_state.md.txt) |
| device.state.Online | [OnlineState](https://developers.home.google.com/automations/schema/reference/entity/sht_device/online_state.md.txt) |
| device.state.OnOff | [OnOffState](https://developers.home.google.com/automations/schema/reference/entity/sht_device/on_off_state.md.txt) |
| device.state.OpenClose | [OpenCloseState](https://developers.home.google.com/automations/schema/reference/entity/sht_device/open_close_state.md.txt) |
| device.state.Record | [RecordState](https://developers.home.google.com/automations/schema/reference/entity/sht_device/record_state.md.txt) |
| device.state.Rotation | [RotationState](https://developers.home.google.com/automations/schema/reference/entity/sht_device/rotation_state.md.txt) |
| device.state.RunCycle | [RunCycleState](https://developers.home.google.com/automations/schema/reference/entity/sht_device/run_cycle_state.md.txt) |
| device.state.SensorState | [SensorStateState](https://developers.home.google.com/automations/schema/reference/entity/sht_device/sensor_state_state.md.txt) |
| device.state.StartStop | [StartStopState](https://developers.home.google.com/automations/schema/reference/entity/sht_device/start_stop_state.md.txt) |
| device.state.TemperatureControl | [TemperatureControlState](https://developers.home.google.com/automations/schema/reference/entity/sht_device/temperature_control_state.md.txt) |
| device.state.TemperatureSetting | [TemperatureSettingState](https://developers.home.google.com/automations/schema/reference/entity/sht_device/temperature_setting_state.md.txt) |
| device.state.Timer | [TimerState](https://developers.home.google.com/automations/schema/reference/entity/sht_device/timer_state.md.txt) |
| device.state.Volume | [VolumeState](https://developers.home.google.com/automations/schema/reference/entity/sht_device/volume_state.md.txt) |
| home.state.HomePresence | [ModeState](https://developers.home.google.com/automations/schema/reference/entity/sht_structure/home_presence_state.md.txt) |
| not | [NotCondition](https://developers.home.google.com/automations/schema/reference/standard/not_condition.md.txt) |
| or | [OrCondition](https://developers.home.google.com/automations/schema/reference/standard/or_condition.md.txt) |
| time.between | [TimeBetweenState](https://developers.home.google.com/automations/schema/reference/standard/time_between_state.md.txt) |

## Examples

Simple condition: if someone is at home.

```yaml
condition:
  type: home.state.HomePresence
  state: homePresenceMode
  is: HOME
```

Use an AND condition: if TV is on AND the time is after 6pm.

```yaml
condition:
  type: and
  conditions:
  - type: device.state.OnOff
    device: TV - Living Room
    state: on
    is: true
  - type: time.between
    after: 6:00 pm
```