Valve is open

The Valve is open condition passes when a targeted valve entityAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more] is currently open.

Use it when you want an automation to continue only if a valve is actively letting water, gas, or air through. For example, create an automation to avoid sending a “start irrigation” action when the main water valve is already open, or gate a water-conservation alert on whether an irrigation valve is still running.

Labs

Requires the Purpose-specific triggers and conditions Labs preview feature. Enable it at Settings > System > Labs.

Using this condition from the user interface

If you prefer building automations visually, Home Assistant walks you through this condition step by step. You pick what to check, tweak a few options, and save. No YAML knowledge required.

To use this condition in an automation:

  1. Go to Settings > Automations & scenes.
  2. Open an existing automation, or select Create automation > Create new automation.
  3. In the And if section, select Add condition.
  4. Select what you want to check. Under By target, pick the area the valve is in, like your garden or utility room. You can also select a floor, a device, a specific entity, or a label, as described in Targets.
  5. From the conditions shown for that target, select Valve is open.
  6. Under Condition passes if, pick Any or All to control how the check behaves when multiple valves are targeted, as described in Behavior.
  7. Under For at least, set how long the valve must have been open before the condition passes. Leave it at zero to pass immediately.
  8. Select Save.

Options in the UI

Condition passes if

When multiple valves are targeted, controls how results combine. Pick Any to pass if at least one targeted valve is open, or All to pass only when every targeted valve is open.

For at least

How long the valve must have been open before the condition passes. Set to zero to pass immediately. Useful to avoid acting on a valve that opened only momentarily.

Using this condition in YAML

If you work directly in YAML, or you want to know exactly what Home Assistant does under the hood, this section has the technical reference. It lists the field names you use in YAML, their types, and which ones are required.

In YAML, refer to this condition as valve.is_open. A basic example looks like this:

ConditionConditions are an optional part of an automation that will prevent an action from firing if they are not met. [Learn more]
condition: valve.is_open
target:
  entity_id: valve.garden_irrigation

This passes when valve.garden_irrigation is currently open.

Options in YAML

YAML sometimes provides additional options for more complex use cases that are not available through the UI.

behavior string

When multiple valves are targeted, controls how results combine. Accepts all or any.

for string

Duration the valve must have been open before the condition passes. Accepts a duration string like 00:05:00 for 5 minutes.

Targets of the condition

This condition requires a target. The target is the object that Home Assistant will check. You can point the condition at a single entityAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more], a device, an area, a floor, or a label, and Home Assistant will evaluate every matching valve entity behind that target.

  • Entity: one specific valve entity, such as valve.living_room.
  • Device: every valve entity that belongs to a device.
  • Area: every valve entity in a room or area.
  • Floor: every valve entity on a floor.
  • Label: every valve entity that shares a label.

You can also select different target types in one condition. For example, you can add a specific entity and an area as targets in the same condition to check both of them at once.

Behavior with multiple targets

When you target more than one entity (or select an area, floor, or label that contains several), the Condition passes if option controls how the results combine:

  • Any (default): the condition passes if at least one of the targeted entities matches. For example, if you check three smoke sensors and only one of them detects smoke, the condition still passes. This is useful for questions like “is there smoke anywhere in the house?”
  • All: the condition passes only when every targeted entity matches. For example, if you check the same three smoke sensors, the condition passes only once all three report cleared. This is useful for “is the entire house safe now?” checks, so your automation does not send an all-clear while one room still has a reading.

Good to know

  • Valves that are in the transitional Opening state do not satisfy this condition. The condition only passes once the valve is fully Open. You can check the available states in The state of a valve entity.
  • Valves reporting position (0 to 100%) are considered open as soon as their position is above 0. If you need to check for a fully open valve, combine this condition with a numeric state condition on the current_position attribute.
  • Valves that have an Unavailable or Unknown state are skipped from the condition evaluation.
  • This condition works with any valve entity in Home Assistant, including water, gas, and air valves from integrations such as MQTT, Z-Wave, Zigbee, and ESPHome.
  • Use the For at least option to make your automation more robust against brief, incidental openings, such as a valve that flickered open during a restart.

Try it yourself

Ready to test this? Go to Settings > Automations & scenes, open an automation, and add this condition. Trigger the automation with and without the condition met, and watch whether it continues or stops.

More examples

Real scenarios where this condition gates an automation. Copy any example and adapt it to your setup.

Tip

You don’t need to edit YAML to use these examples. Copy a YAML snippet from this page, open the automation editor in Home Assistant, and press Ctrl+V (or Cmd+V on Mac). Home Assistant automatically converts the pasted YAML into the visual editor format, whether it’s a full automation, a single trigger, a condition, or an action.

Automation: skip irrigation if the main water valve is already open

A water-conservation guard that prevents a scheduled irrigation run from starting if the main supply valve is already open, avoiding double water flow and reducing unnecessary water use.

  • Trigger: Time: at the scheduled irrigation start time (e.g. 06:00)
  • Condition: Valve is open
    • Target: valve.main_water_supply
  • Action: Send a notification message
    • Target: My Device (notify.my_device)
YAML example for skipping irrigation when the supply valve is already open
AutomationAutomations in Home Assistant allow you to automatically respond to things that happen in and around your home. [Learn more]
alias: "Skip irrigation if main supply valve is already open"
triggers:
  - trigger: time
    at: "06:00:00"
conditions:
  - condition: valve.is_open
    target:
      entity_id: valve.main_water_supply
actions:
  - action: notify.send_message
    target:
      entity_id: notify.my_device
    data:
      title: "Irrigation skipped"
      message: >
        The main water supply valve is already open.
        Scheduled irrigation was skipped to avoid wasting water.

Automation: turn off the water pump if any irrigation valve has been open for too long

This is a sustainability automation that protects against forgotten-open valves by shutting down the pump after a valve has been running longer than the expected watering window. It prevents overwatering and unnecessary energy use.

  • Trigger: Time pattern: every 5 minutes
  • Condition: Valve is open
    • Target: Irrigation valves (by label)
    • For at least: 00:30:00
  • Action: Turn off switch
    • Target: Water pump
  • Action: Send a notification message
    • Target: My Device (notify.my_device)
YAML example for turning off the pump after a valve has been open too long
AutomationAutomations in Home Assistant allow you to automatically respond to things that happen in and around your home. [Learn more]
alias: "Turn off pump if irrigation valve stays open too long"
triggers:
  - trigger: time_pattern
    minutes: "/5"
conditions:
  - condition: valve.is_open
    target:
      label_id: irrigation_valves
    options:
      for: "00:30:00"
actions:
  - action: switch.turn_off
    target:
      entity_id: switch.irrigation_pump
  - action: notify.send_message
    target:
      entity_id: notify.my_device
    data:
      title: "Irrigation pump stopped"
      message: >
        An irrigation valve has been open for over 30 minutes.
        The pump has been turned off to prevent overwatering.

Still stuck?

The Home Assistant community is quick to help: join Discord for real-time chat, post on the community forum with the condition you’re using and what you expected to happen, or share on our subreddit /r/homeassistant.

Tip

AI assistants like ChatGPT or Claude can also explain conditions or suggest the right one when you describe what you want in plain language.

Related conditions

These conditions work well alongside this one: