Valve
The Valve entity in Home Assistant provides an interface to control valves such as water, gas, or air valves.
Building block integration
This valve is a building block integration that cannot be added to your Home Assistant directly but is used and provided by other integrations.
A building block integration differs from the typical integration that connects to a device or service. Instead, other integrations that do integrate a device or service into Home Assistant use this valve building block to provide entities, services, and other functionality that you can use in your automations or dashboards.
If one of your integrations features this building block, this page documents the functionality the valve building block offers.
The state of a valve entity
The 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] can have the following states:
- Open: The valve is fully open.
- Opening: The valve is in the process of opening.
- Closed: The valve is fully closed.
- Closing: The valve is in the process of closing.
- Stopped: The valve has stopped moving before reaching a fully open or closed position.
- Unavailable: The entity is currently unavailable.
- Unknown: The state is not yet known.
Device class
A device class is a measurement categorization in Home Assistant. It influences how the entity is represented in the dashboard. This can be modified in the customize section. For example, different states may be represented by different icons, colors, or text.
The following device classes are supported for valves:
- None: Generic valve. This is the default and doesn’t need to be set.
- water: Valve that controls the flow of water through a system.
- gas: Valve that controls the flow of gas through a system.
Actions
Valve control actions
All valves respond to valve.open
, valve.close
, and valve.toggle
.
Valves that allow setting a specific position may also be controlled with valve.set_position
and valve.stop
.
Data attribute | Optional | Description |
---|---|---|
entity_id |
yes | String or list of strings that point at entity_id ’s of valves. Use entity_id: all to target all. |
Automation example
automation:
triggers:
- trigger: time
at: "07:15:00"
actions:
- action: valve.close
target:
entity_id: valve.demo
Action valve.set_position
Set the position of one or multiple valves if they support setting a specific position.
Data attribute | Optional | Description |
---|---|---|
entity_id |
yes | String or list of strings that point at entity_id ’s of valves. Use entity_id: all to target all. |
position |
no | Integer between 0 (fully closed) and 100 (fully open). |
Automation example
automation:
triggers:
- trigger: time
at: "07:15:00"
actions:
- action: valve.set_position
target:
entity_id: valve.demo
data:
position: 50