Relative humidity
The Relative humidity condition passes when a humidity reading meets a threshold you define. You can check that humidity is above, below, or within a specific range. The condition works with humidity sensors, climate devices, humidifiers, and weather entities. Use it to run an automation only when the bedroom feels too damp, or only when the air is dry enough to need attention.
When you target more than one entity, the condition’s Condition passes if option controls how the check combines results. You can require any targeted entity to meet the threshold, or demand that all of them do.
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 Relative humidity in an automation:
- Go to Settings > Automations & scenes.
- Open an existing automation, or select Create automation > Create new automation.
- In the And if section, select Add condition.
- Select what you want to check. Under By target (see Targets), pick the area your humidity sensor is in (like your bedroom or bathroom). You can also select a device, a specific entity, or a label.
- From the conditions shown for that target, select Relative humidity.
- Under Threshold type, set the humidity level the condition checks against:
- Pick whether the reading must be Above, Below, In range, or Outside range of the threshold.
- Select Number or Entity:
-
Number: Enter a fixed percentage directly, for example
65for 65%. For In range or Outside range, enter both a lower and upper bound. -
Entity: Use a sensor entity or a number helper entity as the threshold:
- Number helper: You can adjust the threshold value without editing the automation. The sensor reading is compared against the number helper’s current value.
- Sensor: Its current reading becomes the threshold and updates automatically as the sensor changes. This is useful for comparing two humidity readings, for example to check whether indoor humidity is higher than outdoor humidity.
- For In range or Outside range, you need two entities: one for the lower bound and one for the upper bound (for example, two separate number helpers).
- If you don’t have a number helper, you can create one by selecting Create a new number helper.
-
Number: Enter a fixed percentage directly, for example
- Under Condition passes if (see Behavior), pick Any or All.
- Select Save.
Options in the UI
The humidity level the entity has to meet for the condition to pass. Options are Above, Below, In range, or Outside range. Number provides a fixed percentage (0-100%) or both a lower and upper bound for ranges. Entity uses a sensor or number helper as a dynamic threshold.
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 humidity.is_value. A basic example looks like this:
condition: humidity.is_value
target:
entity_id: sensor.bedroom_humidity
options:
threshold:
type: above
value:
number: 60
behavior: any
This passes when the bedroom humidity sensor reads above 60%.
To check that humidity stays below a certain level:
condition: humidity.is_value
target:
area_id: basement
options:
threshold:
type: below
value:
number: 40
behavior: all
This passes when all humidity sensors in the basement area read below 40%.
To check that humidity stays within a comfortable range:
condition: humidity.is_value
target:
entity_id:
- sensor.bedroom_humidity
- sensor.bathroom_humidity
options:
threshold:
type: between
value_min:
number: 40
value_max:
number: 60
behavior: any
This passes when at least one of the humidity sensors reads between 40% and 60%.
To check that humidity stays outside a range:
condition: humidity.is_value
target:
entity_id: sensor.bedroom_humidity
options:
threshold:
type: outside
value_min:
number: 40
value_max:
number: 60
This passes when the bedroom humidity sensor reads below 40% or above 60%.
To use a number helper as a dynamic threshold that you can adjust without editing the automation:
condition: humidity.is_value
target:
entity_id: sensor.bedroom_humidity
options:
threshold:
type: above
value:
entity: input_number.humidity_alert_threshold
behavior: any
This passes when the bedroom humidity sensor reads above the number helper´s value.
Options in YAML
The humidity level the entity has to meet for the condition to pass:
-
above: Sets a minimum -
below: Sets a maximum -
between: Defines a range -
outside: Defines an outside-range
For above and below, use value with either number (0 to 100) or entity. For between and outside, use value_min and value_max, each with either number (0 to 100) or entity. For example:
- A fixed percentage (0-100%).
- A reference to an
input_number,number, orsensorentity.-
input_number: Lets you change the threshold without editing the automation. To create one, see Number helper. -
number: Uses the current value of a number entity as the threshold. -
sensor: Uses the current reading as the threshold when the condition is evaluated, which lets you compare two humidity readings dynamically, for example, checking whether indoor humidity is above outdoor humidity.
-
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 humidity entity behind that target.
-
Entity: one specific humidity entity, such as
humidity.living_room. - Device: every humidity entity that belongs to a device.
- Area: every humidity entity in a room or area.
- Floor: every humidity entity on a floor.
- Label: every humidity 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
- The condition works with humidity sensors, climate entities (using the current humidity reading), humidifier entities (using the current humidity reading), and weather entities.
- Entities that are unavailable (
unavailable) or have an unknown state (unknown) are skipped for Any and fail for All. - Humidity is expressed as a percentage. Indoor comfort is generally between 40% and 60%. Below 30% often feels dry and can irritate airways. Above 65% can encourage mold and dust mites.
- This condition checks the entity’s current humidity reading, not its target setpoint. To check a humidifier’s target setpoint instead, use the Humidifier target humidity condition.
- When you use a sensor as a dynamic threshold, its value is read at the moment the condition runs. The threshold is not continuously tracked; it is re-evaluated each time the automation fires.
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.
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: run a dehumidifier when the room gets too damp
When the bedroom humidity sensor reads above 65%, turn on the dehumidifier to bring levels back to a comfortable range. The condition prevents the dehumidifier from running when the air is already dry enough.
- Trigger: Time pattern: Every 15 minutes
-
Condition: Relative humidity (above 65%)
- Target: Bedroom humidity sensor
- Condition passes if: Any
-
Action: Turn on switch
- Target: switch.bedroom_dehumidifier
YAML example for running a dehumidifier when humidity is high
alias: "Run dehumidifier when bedroom is too damp"
triggers:
- trigger: time_pattern
minutes: "/15"
conditions:
- condition: humidity.is_value
target:
entity_id:
- sensor.bedroom_humidity
- sensor.closet_humidity
options:
threshold:
type: above
value:
number: 65
behavior: any
actions:
- action: switch.turn_on
target:
entity_id: switch.bedroom_dehumidifier
Automation: send an alert when the air gets too dry
At midnight, check the living room humidity. If it has dropped below 30%, send a notification so you can switch on a humidifier before you go to sleep.
- Trigger: Time: 00:00
-
Condition: Relative humidity (below 30%)
- Target: Living room humidity sensor
- Condition passes if: Any
-
Action: Send a notification
- Target: notify.mobile_app_phone
YAML example for a low humidity alert
alias: "Alert when living room air is too dry"
triggers:
- trigger: time
at: "00:00:00"
conditions:
- condition: humidity.is_value
target:
area_id: living_room
options:
threshold:
type: below
value:
number: 30
behavior: all
actions:
- action: notify.send_message
target:
entity_id: notify.mobile_app_phone
data:
message: >
The living room humidity is below 30%.
Consider switching on the humidifier.
Automation: adjust humidifier based on comfort range
Check every 15 minutes whether the bedroom humidity is outside your personal comfort range. Use number helpers to set the range, so you can easily adjust it through the UI without editing the automation.
- Trigger: Time pattern: Every 15 minutes
-
Condition: Relative humidity (outside range, using number helpers)
- Target: Bedroom humidity sensor
- Condition passes if: Any
-
Action: Turn on switch
- Target: switch.bedroom_humidifier
YAML example for using number helpers as threshold
alias: "Turn on humidifier when outside comfort range"
triggers:
- trigger: time_pattern
minutes: "/15"
conditions:
- condition: humidity.is_value
target:
entity_id: sensor.bedroom_humidity
options:
threshold:
type: outside
value_min:
entity: input_number.comfort_humidity_min
value_max:
entity: input_number.comfort_humidity_max
actions:
- action: switch.turn_on
target:
entity_id: switch.bedroom_humidifier
Automation: run the ventilation fan when indoor humidity exceeds outdoor humidity
Every 15 minutes, check whether the living room is more humid than the outside air. If so, open the ventilation to let drier air in. The outdoor humidity sensor acts as a live threshold, so the condition always compares the two current readings.
- Trigger: Time pattern: Every 15 minutes
-
Condition: Relative humidity (above, entity: outdoor humidity sensor)
- Target: Living room humidity sensor
- Condition passes if: Any
-
Action: Turn on switch
- Target: switch.ventilation_fan
YAML example for comparing indoor to outdoor humidity
alias: "Ventilate when indoor humidity exceeds outdoor"
triggers:
- trigger: time_pattern
minutes: "/15"
conditions:
- condition: humidity.is_value
target:
entity_id: sensor.living_room_humidity
options:
threshold:
type: above
value:
entity: sensor.outdoor_humidity
actions:
- action: switch.turn_on
target:
entity_id: switch.ventilation_fan
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.
AI assistants like ChatGPT or Claude can also explain conditions or suggest the right one when you describe what you want in plain language.