Moisture content changed

The Moisture content changed trigger fires after a moisture reading changes. Soil moisture in a plant pot drops slowly as the soil dries out, climbs after watering, or hovers in a target zone when conditions are stable. Use the threshold type to filter which changes matter to your automation.

Use Moisture content changed to log soil moisture trends, trigger plant watering when the soil becomes too dry, or alert you when a reading shifts in a way that might signal a problem.

Labs

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 Moisture content changed in an automation:

  1. Go to Settings > Automations & scenes.
  2. Open an existing automation, or select Create automation > Create new automation.
  3. In the When section, select Add trigger.
  4. Select what you want to monitor. Under By target (see Targets), pick the moisture sensor (for example, a soil moisture probe). You can also select an area, a device, or a label.
  5. From the triggers shown for that target, select Moisture content changed.
  6. 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.
  7. Select Save.

Options in the UI

Threshold type

Controls which changes fire the trigger:

  • Any change: fires on any change, regardless of direction or new value.
  • Above or Below (exclusive): fires only when the new reading is strictly above or below the threshold. A reading equal to the threshold does not fire the trigger.
  • In range (exclusive): fires only when the new reading is strictly between the two bounds. A reading equal to either bound does not fire the trigger.
  • Outside range (inclusive): fires when the new reading is at or below the lower bound, or at or above the upper bound. A reading equal to either bound fires the trigger.

For each mode you can enter a fixed percentage (0–100%) or 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, Moisture content changed is referred to as moisture.changed. A basic example looks like this:

TriggerA trigger is a set of values or conditions of a platform that are defined to cause an automation to run. [Learn more]
trigger: moisture.changed
target:
  entity_id: sensor.fiddle_leaf_soil_moisture
options:
  threshold:
    type: below
    value:
      number: 25

This fires whenever the soil moisture sensor for the fiddle leaf fig moves to a value below 25%.

To fire only when the reading stays within a target range:

TriggerA trigger is a set of values or conditions of a platform that are defined to cause an automation to run. [Learn more]
trigger: moisture.changed
target:
  entity_id:
    - sensor.tomato_soil_moisture
    - sensor.basil_soil_moisture
options:
  threshold:
    type: between
    value_min:
      number: 40
    value_max:
      number: 70

To use a number helper as a dynamic threshold that you can adjust without editing the automation:

TriggerA trigger is a set of values or conditions of a platform that are defined to cause an automation to run. [Learn more]
trigger: moisture.changed
target:
  entity_id: sensor.fiddle_leaf_soil_moisture
options:
  threshold:
    type: below
    value:
      entity: input_number.plant_dry_threshold

Options in YAML

threshold map Required

A mapping that defines which kind of change fires the trigger:

  • type: any: Fires on any moisture change (no additional keys needed).
  • type: above (exclusive): Sets a minimum. Fires when the reading is strictly above value. A reading equal to value does not fire the trigger. Provide value with a number key (for a literal percentage 0–100) or an entity key (for an input_number, number, or sensor entity).
  • type: below (exclusive): Sets a maximum. Fires when the reading is strictly below value. A reading equal to value does not fire the trigger. Provide value with a number key (for a literal percentage 0–100) or an entity key (for an input_number, number, or sensor entity).
  • type: between (exclusive): Defines a range. Fires when the reading is strictly between value_min and value_max. Readings equal to either bound do not fire the trigger. Provide value_min and value_max, each with a number key (for a literal percentage 0–100) or an entity key (for an input_number, number, or sensor entity).
  • type: outside (inclusive): Defines an outside-range. Fires when the reading is at or below value_min, or at or above value_max. Readings equal to either bound fire the trigger. Provide value_min and value_max, each with a number key (for a literal percentage 0–100) or an entity key (for an input_number, number, or sensor entity).

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 moisture entity behind that target.

  • Entity: one specific moisture entity, such as moisture.living_room.
  • Device: every moisture entity that belongs to a device.
  • Area: every moisture entity in a room or area.
  • Floor: every moisture entity on a floor.
  • Label: every moisture 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

  • This trigger works with sensors that have the moisture device class, such as soil moisture probes. For wet/dry leak sensors, use Moisture detected or Moisture cleared instead.
  • 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 moisture first crosses a specific level, use Moisture content crossed threshold instead.

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.

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: water a plant when its soil dries out

When the soil moisture for a houseplant drops below 25%, briefly turn on a smart plug connected to a small pump to water it.

  • Trigger: Moisture content changed
    • Target: Soil moisture sensor
    • Threshold type: Below 25%
  • Action: Turn on switch (the watering pump)
YAML example for an automatic plant watering
AutomationAutomations in Home Assistant allow you to automatically respond to things that happen in and around your home. [Learn more]
alias: "Water the fiddle leaf when soil is dry"
triggers:
  - trigger: moisture.changed
    target:
      entity_id: sensor.fiddle_leaf_soil_moisture
    options:
      threshold:
        type: below
        value:
          number: 25
actions:
  - action: switch.turn_on
    target:
      entity_id: switch.plant_pump
  - delay: "00:00:10"
  - action: switch.turn_off
    target:
      entity_id: switch.plant_pump

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.

Tip

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: