Numeric state
The Numeric state trigger is useful when you want an automation to react when a value crosses a threshold. Use it for temperatures, power readings, battery levels, humidity, and other values that matter only when they move above, below, or into a range.
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 this trigger 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 the type of trigger to add.
- Select Numeric state.
- In Entity, select the entity whose numeric value Home Assistant should watch.
- Optional: In Attribute, select an attribute instead of the main state.
- Set Above, Below, or both.
- Optional: In For, enter how long the value must stay in range before the trigger fires.
- Select Save.
Options in the UI
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, use trigger: numeric_state. A basic example looks like this:
trigger: numeric_state
entity_id: sensor.outdoor_temperature
above: 30
This runs when the outdoor temperature crosses from 30 or below to above 30.
Options in YAML
When you use attribute, Home Assistant evaluates that attribute instead of the main entity state.
When you use value_template, the state variable is the state object for the entity you selected with entity_id.
Targets of the trigger
This trigger watches one or more entities selected by entity_id. Each selected entity must provide a numeric state, or a numeric value in the attribute you choose.
- Use a single
entity_idto watch one entity. - Use a list of
entity_idvalues in YAML to watch more than one entity.
Good to know
- This trigger fires when a value crosses a threshold. It does not keep firing while the value stays on the same side of the threshold.
- If you set both Above and Below, the trigger fires when the value enters that range.
- If you use another entity in
aboveorbelow, Home Assistant compares against that entity only when the watched entity updates. - If you use
for, the timer resets if Home Assistant restarts or automations reload.
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: send a notification when the freezer gets too warm
If the freezer temperature rises above a safe value, this automation sends a message to your phone.
-
Trigger: Numeric state
-
Entity: Freezer temperature sensor (
sensor.freezer_temperature) -
Above:
-10
-
Entity: Freezer temperature sensor (
-
Action: Send a notification message
-
Target: My Device (
notify.my_device)
-
Target: My Device (
YAML example for a freezer temperature alert
alias: "Alert when the freezer gets too warm"
triggers:
- trigger: numeric_state
entity_id: sensor.freezer_temperature
above: -10
actions:
- action: notify.send_message
target:
entity_id: notify.my_device
data:
message: "The freezer temperature is above -10°C."
Automation: remind me when battery level stays low for 30 minutes
If a battery-powered device stays below a set level for a while, this automation reminds you to charge or replace it.
-
Trigger: Numeric state
-
Entity: Door lock battery sensor (
sensor.front_door_lock_battery) -
Below:
20 - For: 30 minutes
-
Entity: Door lock battery sensor (
-
Action: Send a notification message
-
Target: My Device (
notify.my_device)
-
Target: My Device (
YAML example for a low-battery reminder
alias: "Remind me when the door lock battery stays low"
triggers:
- trigger: numeric_state
entity_id: sensor.front_door_lock_battery
below: 20
for: "00:30:00"
actions:
- action: notify.send_message
target:
entity_id: notify.my_device
data:
message: "The front door lock battery has been below 20% for 30 minutes."
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: