Temperature value
The Temperature value condition passes when a temperature reading meets a threshold you define. You can check that the temperature is above, below, or within a specific range. The condition works with temperature sensors, climate devices, water heaters, and weather entities. Use it to run an automation only when the bedroom is too warm, or only when the temperature is low enough to need heating.
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 Temperature 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 temperature sensor is in (like your bedroom or living room). You can also select a device, a specific entity, or a label.
- From the conditions shown for that target, select Temperature value.
- Under Threshold type, set the temperature 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 temperature directly, for example
20for 20°C. 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 temperature readings, for example to check whether indoor temperature is higher than outdoor temperature.
- 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 temperature directly, for example
- Under Unit, select the temperature unit (°C or °F) to use for the threshold comparison.
- Under Condition passes if (see Behavior), pick Any or All.
- Select Save.
Options in the UI
The temperature level the entity has to meet for the condition to pass. Options are Above, Below, In range, or Outside range. Number provides a fixed temperature value (or both a lower and upper bound for ranges). Entity uses a sensor or number helper as a dynamic threshold.
The temperature unit to use for threshold comparison. Accepts °C or °F. Required when using numerical thresholds (not required when using entity references).
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 temperature.is_value. A basic example looks like this:
condition: temperature.is_value
target:
entity_id: sensor.living_room_temperature
options:
threshold:
type: above
value:
number: 20
unit_of_measurement: "°C"
behavior: any
This passes when the living room temperature sensor reads above 20°C.
To check that temperature stays below a certain level:
condition: temperature.is_value
target:
entity_id: sensor.living_room_temperature
options:
threshold:
type: below
value:
number: 24
unit_of_measurement: "°C"
behavior: any
This passes when the living room temperature sensor reads below 24°C.
To check that temperature stays within a comfortable range:
condition: temperature.is_value
target:
entity_id: sensor.living_room_temperature
options:
threshold:
type: between
value_min:
number: 20
unit_of_measurement: "°C"
value_max:
number: 22
unit_of_measurement: "°C"
behavior: any
This passes when the living room temperature sensor reads between 20 and 22°C.
Options in YAML
The temperature 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 and unit_of_measurement, or entity. For between and outside, use value_min and value_max, each with either number and unit_of_measurement, or entity. For example:
threshold:
type: between
value_min:
entity: input_number.comfort_temperature_min
value_max:
number: 22
unit_of_measurement: °C
When using an entity, its current reading is used as the threshold at the moment the condition is evaluated, which lets you compare two temperature readings dynamically.
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 temperature entity behind that target.
-
Entity: one specific temperature entity, such as
temperature.living_room. - Device: every temperature entity that belongs to a device.
- Area: every temperature entity in a room or area.
- Floor: every temperature entity on a floor.
- Label: every temperature 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 temperature sensors, climate entities (using the current temperature reading), water heater entities (using the current temperature reading), and weather entities.
- Climate, water heater, and weather entities that don’t report a current temperature attribute are automatically excluded from evaluation. Only entities with a valid temperature value are considered.
- Entities that have an
unavailableorunknownstate are skipped for Any and fail for All. - This condition checks the entity’s current temperature reading, not its target setpoint. To check a climate device’s target setpoint instead, use the climate target temperature 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.
- All temperature values are automatically converted to the unit you specify. For example, if your sensor reports in Fahrenheit but you configure the condition in Celsius, the conversion happens automatically.
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: cool only when temperature is high
This automation runs a fan only when the bedroom temperature is above 24°C, helping you save energy by avoiding unnecessary cooling.
- Trigger: State: Fan is off
- Condition: Temperature (above 24°C)
- Target: Bedroom temperature sensor
- Condition passes if: Any
- Action: Fan: Turn on
YAML example for cooling when warm
alias: "Run fan when bedroom is warm"
triggers:
- trigger: state
entity_id: fan.bedroom_fan
to: "off"
conditions:
- condition: temperature.is_value
target:
entity_id: sensor.bedroom_temperature
options:
threshold:
type: above
value:
number: 24
unit_of_measurement: "°C"
behavior: any
actions:
- action: fan.turn_on
target:
entity_id: fan.bedroom_fan
Automation: alert when temperature is outside comfort range
This automation sends a notification only when the living room temperature is outside the comfort range of 20 to 22°C, helping you maintain consistent conditions.
- Trigger: Time pattern (every hour)
- Condition: Temperature value (outside 20-22°C range)
- Target: Living room temperature sensor
- Condition passes if: Any
- Action: Send a notification
YAML example for temperature out of range alert
alias: "Alert when temperature is uncomfortable"
triggers:
- trigger: time_pattern
hours: "/1"
conditions:
- condition: temperature.is_value
target:
entity_id: sensor.living_room_temperature
options:
threshold:
type: outside
value_min:
number: 20
unit_of_measurement: "°C"
value_max:
number: 22
unit_of_measurement: "°C"
behavior: any
actions:
- action: notify.mobile_app
data:
message: >
Living room temperature is
{{ states('sensor.living_room_temperature') }}°C
Automation: turn off climate when temperature is comfortable
When the bedroom temperature is already within your comfort range, this automation turns off the climate system to save energy. Use number helpers to define your preferred temperature range so you can easily adjust it without editing the automation.
- Trigger: Time pattern (every 30 minutes)
- Condition: Temperature (in range, using number helpers)
- Target: Bedroom temperature sensor
- Condition passes if: Any
- Action: Set thermostat HVAC mode (state: off)
YAML example for turning off climate when comfortable
alias: "Turn off climate when bedroom is comfortable"
triggers:
- trigger: time_pattern
minutes: "/30"
conditions:
- condition: temperature.is_value
target:
entity_id: sensor.bedroom_temperature
options:
threshold:
type: between
value_min:
entity: input_number.comfort_temperature_min
value_max:
entity: input_number.comfort_temperature_max
behavior: any
actions:
- action: climate.set_hvac_mode
target:
entity_id: climate.bedroom
data:
hvac_mode: "off"
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.