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.
- 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 or use an
input_number,number, orsensorentity as the threshold.
- Select Save.
Options in the UI
Controls which changes fire the trigger:
- Any change: fire 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 or reference an input_number, number, or sensor 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
options:
threshold:
type: between
value_min:
number: 40
value_max:
number: 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
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. Set type to one of any, above, below, between, or outside. For above and below, provide value with a number key or an entity key. For between and outside, provide value_min and value_max, each with a number key or an entity key. For any, no additional keys are needed.
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.
- 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 the humidity reading rises above 70%, keeping the room from getting damp.
- Trigger: Relative humidity changed
- Target: Bathroom humidity sensor
- Threshold type: Above 70%
- Action: Fan: Turn on
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
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: Notifications: Send a notification via 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.mobile_app_phone
data:
message: "Greenhouse humidity changed significantly."
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.