Thermostat target temperature
The Thermostat target temperature condition passes when a thermostat 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]’s target temperature setting meets a threshold you define. The target temperature is the setpoint you configure on the device, not the actual current temperature reading. For example, you can use this condition in an automation to turn on a dehumidifier only if the thermostat is set to an unusually high or low temperature.
When you target more than one thermostat, the condition’s Condition passes if option controls how the check combines results. You can require any targeted thermostat 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 Thermostat target 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 thermostat 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 Thermostat target temperature.
- Under Threshold type, set the temperature level the condition checks against:
- Pick whether the setpoint 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. You can compare the setpoint against another temperature value or use a number helper that you can adjust without editing the automation.
-
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.
- Under For at least, set how long the thermostat must have been at the threshold before the condition passes. Leave it at zero to pass immediately.
- Select Save.
Options in the UI
The temperature level the thermostat setpoint 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).
When multiple thermostats are targeted, controls how results combine. Pick Any to pass if at least one targeted thermostat meets the threshold, or All to pass only when every targeted thermostat does. Default is Any.
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, Thermostat target temperature is referred to as climate.target_temperature. A basic example looks like this:
alias: "Close window covers when heating setpoint is high"
triggers:
- trigger: state
entity_id: climate.living_room
attribute: temperature
conditions:
- condition: climate.target_temperature
target:
entity_id: climate.living_room
options:
threshold:
type: above
value:
number: 22
unit_of_measurement: "°C"
actions:
- action: cover.close_cover
target:
entity_id: cover.living_room_blinds
This passes when the living room thermostat’s target temperature is set above 22°C.
To check that the setpoint stays below a certain level:
alias: "Open windows when cooling setpoint is very low"
triggers:
- trigger: state
entity_id: climate.bedroom
attribute: temperature
conditions:
- condition: climate.target_temperature
target:
entity_id: climate.bedroom
options:
threshold:
type: below
value:
number: 18
unit_of_measurement: "°C"
actions:
- action: cover.open_cover
target:
area_id: bedroom
This passes when the bedroom thermostat’s target temperature is set below 18°C.
Options in YAML
The temperature level the thermostat setpoint 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:
number: 20
unit_of_measurement: °C
value_max:
number: 24
unit_of_measurement: °C
When using an entity, its current reading is used as the threshold at the moment the condition is evaluated.
Controls how results combine when multiple thermostats are targeted. Accepts all or any.
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 climate entity behind that target.
-
Entity: one specific climate entity, such as
climate.living_room. - Device: every climate entity that belongs to a device.
- Area: every climate entity in a room or area.
- Floor: every climate entity on a floor.
- Label: every climate 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
- This condition checks the thermostat’s target temperature setpoint, not the actual measured temperature in the room. To react to the measured temperature, use the Temperature value condition instead.
- Thermostats that are unavailable (
unavailable) or have an unknown state (unknown) are skipped for Any and fail for All. - Not all thermostats support target temperature control in all modes. Only thermostats that expose a target temperature attribute will be evaluated by this condition.
- For thermostats in heat-cool mode that support dual setpoints (separate heating and cooling targets), this condition checks the single target temperature attribute. If the thermostat doesn’t expose a single target temperature in that mode, it will be skipped.
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: close window covers when heating setpoint is high
When the living room thermostat’s target temperature is set to 22°C or above, close the window covers to help retain heat. This automation triggers when the thermostat’s temperature setpoint changes.
-
Trigger: State change of the living room thermostat’s
temperatureattribute - Condition: Target temperature is 22°C or higher
- Action: Close the living room blinds
alias: "Close blinds for efficient heating"
triggers:
- trigger: state
entity_id: climate.living_room
attribute: temperature
conditions:
- condition: climate.target_temperature
target:
entity_id: climate.living_room
options:
threshold:
type: above
value:
number: 22
unit_of_measurement: "°C"
actions:
- action: cover.close_cover
target:
entity_id: cover.living_room_blinds
Automation: adjust fan speed based on temperature setpoint
When the bedroom thermostat’s target temperature is set within the comfort range of 20-22°C, set the ceiling fan to low speed. This provides gentle air circulation without creating drafts.
-
Trigger: State change of the bedroom thermostat’s
temperatureattribute - Condition: Target temperature is between 20°C and 22°C
- Action: Set ceiling fan to low speed
alias: "Fan speed for comfort range"
triggers:
- trigger: state
entity_id: climate.bedroom
attribute: temperature
conditions:
- condition: climate.target_temperature
target:
entity_id: climate.bedroom
options:
threshold:
type: between
value_min:
number: 20
unit_of_measurement: "°C"
value_max:
number: 22
unit_of_measurement: "°C"
actions:
- action: fan.set_percentage
target:
entity_id: fan.bedroom_ceiling
data:
percentage: 20