Relative humidity changed
The Relative humidity changed trigger fires after a humidity reading changes. Humidity creeps up slowly in a bathroom after a shower, climbs in a greenhouse overnight, or drops when the sun beats down on a dry afternoon. Use the threshold type to filter which changes matter to your automation.
The threshold type controls where the new reading must land for the trigger to fire. You can require the new value to be above a level, below a level, within a range, or outside a range. You can also select Any change to fire on any change at all.
Use Relative humidity changed to log humidity trends, trigger a fan when the air in a room becomes noticeably more humid, or alert you when a sensor reading shifts in a way that might signal a problem.
Requires the Purpose-specific triggers and conditions Labs preview feature. Enable it at Settings > System > Labs.
Using this trigger from the user interface
If you prefer building automations visually, Home Assistant walks you through this trigger step by step. You pick what to watch, tweak a few options, and save. No YAML knowledge required.
To use Relative humidity changed in an automation:
- Go to Settings > Automations & scenes.
- Open an existing automation, or select Create automation > Create new automation.
- In the When section, select Add trigger.
- Select what you want to monitor. Under By target (see Targets), pick the area your humidity sensor is in (like your bathroom or bedroom). You can also select a device, a specific entity, or a label. When you target multiple entities (via area, label, or multiple entity selections), the trigger fires whenever any of them changes.
- From the triggers shown for that target, select Relative humidity changed.
- Under Threshold type, configure what kind of change fires the trigger:
- Select Any change to fire on any change, regardless of direction or new value.
- Select Above or Below and enter a value to fire only when the new reading is above or below that value.
- Select In range and enter a lower and upper bound to fire only when the new reading falls inside the range.
- Select Outside range and enter a lower and upper bound to fire only when the new reading is outside the range.
- For each option, you can enter a fixed percentage (0-100%), pick a sensor entity or a number helper entity as the threshold.
- If you don’t have a number helper, you can create one by selecting Create a new number helper.
- Select Save.
Options in the UI
Controls which changes fire the trigger:
- Any change: fires on any change, regardless of direction or new value.
- Above or Below: enter a value to fire only when the new reading is above or below that value.
- In range: enter a lower and upper bound to fire only when the new reading falls between them.
- Outside range: enter a lower and upper bound to fire only when the new reading is below the lower bound or above the upper bound.
For each mode you can enter a fixed percentage (0-100%), reference a sensor entity or a number helper entity.
Using this trigger 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, Relative humidity changed is referred to as humidity.changed. A basic example looks like this:
trigger: humidity.changed
target:
entity_id: sensor.bedroom_humidity
options:
threshold:
type: above
value:
number: 5
This fires whenever the bedroom humidity sensor reading moves to a value above 5%. To fire on any change regardless of direction or value, use type: any and omit value.
To fire only when the new reading is within a comfort range:
trigger: humidity.changed
target:
entity_id:
- sensor.bedroom_humidity
- sensor.bathroom_humidity
options:
threshold:
type: between
value_min:
number: 40
value_max:
number: 60
This fires whenever any of the humidity sensors changes to a value within the comfort range (40-60%).
To fire only when the new reading is outside a comfort range:
trigger: humidity.changed
target:
entity_id: sensor.bedroom_humidity
options:
threshold:
type: outside
value_min:
number: 40
value_max:
number: 60
To use a number helper as a dynamic threshold that you can adjust without editing the automation:
trigger: humidity.changed
target:
entity_id: sensor.bedroom_humidity
options:
threshold:
type: above
value:
entity: input_number.humidity_alert_threshold
To monitor all humidity sensors in an area and trigger when any changes outside the comfort range:
trigger: humidity.changed
target:
area_id: basement
options:
threshold:
type: outside
value_min:
number: 40
value_max:
number: 60
This fires whenever any humidity sensor in the basement area changes to a value outside the 40-60% range.
Options in YAML
YAML sometimes provides additional options for more complex use cases that are not available through the UI.
A mapping that defines which kind of change fires the trigger:
-
type: any: Fires on any change (no additional keys needed). -
type: aboveortype: below: Providevaluewith anumberkey (for a literal number) or anentitykey (for aninput_number,number, orsensorentity). -
type: betweenortype: outside: Providevalue_minandvalue_max, each with anumberkey (for a literal number) or anentitykey (for aninput_number,number, orsensorentity).
Targets of the trigger
This trigger requires a target. The target is the object that Home Assistant will watch. You can select 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 as a target, and Home Assistant will watch 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 trigger. For example, you can add a specific entity and an area as targets in the same trigger to monitor both of them at once.
Good to know
- The threshold type controls both the direction and the landing zone of the change. Use Above or Below to filter by direction, In range to fire only when the new value is inside a range, and Outside range to fire only when it escapes a range.
- Use Any change to fire on every change regardless of direction or where the new value lands.
- To react only when humidity first crosses a specific level, use Relative humidity crossed threshold instead.
- Pair this trigger with Relative humidity in follow-up conditions to verify the reading meets a threshold before continuing the automation.
- The trigger works with climate entities, humidifier entities, weather entities, and sensors with the humidity device class.
Try it yourself
Ready to test this? Go to Settings > Automations & scenes, create a new automation, and add this trigger. Save the automation, then change the state of the targeted entity to watch the trigger fire on your actual entitiesAn 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].
More examples
Real scenarios where this trigger fires in automations and scripts. 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 the bathroom fan after a shower
After a shower, humidity in a bathroom can spike quickly. This automation turns on the bathroom fan whenever either bathroom humidity sensor rises above 70%, keeping the room from getting damp.
-
Trigger: Relative humidity changed
- Target: Bathroom and shower humidity sensors
- Threshold type: Above 70%
-
Action: Turn on fan
- Target: fan.bathroom
YAML example for a post-shower bathroom fan
alias: "Run bathroom fan on humidity spike"
triggers:
- trigger: humidity.changed
target:
entity_id:
- sensor.bathroom_humidity
- sensor.shower_humidity
options:
threshold:
type: above
value:
number: 70
actions:
- action: fan.turn_on
target:
entity_id: fan.bathroom
Automation: log humidity changes in the greenhouse
Track how much the humidity in your greenhouse shifts throughout the day by sending a notification whenever the reading changes.
-
Trigger: Relative humidity changed
- Target: Greenhouse humidity sensor
- Threshold type: Any change
-
Action: Send a notification
- Target: notify.mobile_app_phone
YAML example for greenhouse humidity logging
alias: "Log greenhouse humidity changes"
triggers:
- trigger: humidity.changed
target:
entity_id: sensor.greenhouse_humidity
options:
threshold:
type: any
actions:
- action: notify.send_message
target:
entity_id: notify.mobile_app_phone
data:
message: "Greenhouse humidity changed significantly."
Automation: alert when humidity changes above comfort level
Send a notification whenever the bedroom humidity changes to a level above your personal comfort threshold. Use a number helper as the threshold so you can easily adjust your preferred level through the UI.
-
Trigger: Relative humidity changed
- Target: Bedroom humidity sensor
- Threshold type: Above (entity: comfort humidity threshold)
-
Action: Send a notification
- Target: notify.mobile_app_phone
YAML example for using a number helper as threshold
alias: "Alert when humidity changes above comfort level"
triggers:
- trigger: humidity.changed
target:
entity_id: sensor.bedroom_humidity
options:
threshold:
type: above
value:
entity: input_number.comfort_humidity_threshold
actions:
- action: notify.send_message
target:
entity_id: notify.mobile_app_phone
data:
message: >-
Bedroom humidity is now {{ trigger.to_state.state }}%, above
your comfort threshold.
Still stuck?
The Home Assistant community is quick to help: join Discord for real-time chat, post on the community forum with the trigger 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 triggers or suggest the right one when you describe what you want in plain language.
Related triggers
These triggers work well alongside this one:
- Relative humidity crossed threshold: Triggers after one or more relative humidity readings cross a threshold.