Skip to main content
Selora Homes Selora Homes
Recipe · v1.0.0 · Released Aug 28, 2026

Presence Thermostat Setback

Installs a Home Assistant automation that eases your thermostat into an energy-saving preset once everyone has left, and brings it back to a comfort preset the moment someone returns. Add extra occupancy sensors and any one of them counts as home.

Heating or cooling an empty house is the quiet waste in most homes: the thermostat holds the same comfort setting at noon on a workday as it does in the evening with everyone in. This recipe closes that gap. Once every sensor you pick has read clear for the delay you set, it moves the thermostat to an energy-saving preset, and the moment anyone comes back it returns to the comfort preset.

Because it switches presets rather than nudging the temperature by a fixed amount, it works the same in winter and summer: your thermostat decides what its eco and home presets mean, and the recipe just chooses between them. Set the delay long enough that a quick trip to the bin does not trigger a setback, fifteen minutes by default.

Matching the preset names

Thermostats do not all name their presets the same way. The recipe asks for an away preset and a home preset by name, defaulting to the two most common. If your thermostat uses different words for them, set the names to match what it shows in Home Assistant, and the setback lines up with the presets your thermostat actually has.

Counting more sensors as home

If a presence sensor cannot see the whole house, add occupancy sensors as the optional role. Any one of them reporting someone holds the comfort preset, and the setback only engages once every presence and occupancy sensor has been clear for the delay, so a person the main sensor misses does not get cooled or heated out of the room.

Files Selora AI's pipeline reads to install this recipe. The manifest declares roles, inputs, and integrations; the package files are Jinja-templated YAML applied to Home Assistant.

# Presence Thermostat Setback — switch the thermostat to an energy-saving
# preset when everyone is gone and back to a comfort preset when someone
# returns.
#
# The recipe combines the presence and occupancy sensors into one "is anyone
# home" picture: away is every sensor clear for the delay, home is any sensor
# seeing someone. It drives the thermostat with set_preset_mode rather than raw
# temperatures, so it works the same in heating and cooling season. The preset
# names are inputs, since thermostats name their presets differently.
slug: presence-thermostat-setback
version: 1.0.0
title: Presence Thermostat Setback
tagline: An empty house eases the thermostat into an eco preset, and the first person home brings comfort back.
description: >-
  Moves the thermostat to an energy-saving preset once every presence and
  occupancy sensor has been clear for the delay, and back to a comfort preset
  the moment anyone returns. Uses presets rather than raw temperatures, so it
  works in both heating and cooling season.
author: Selora AI
released: "2026-08-28"
min_integration_version: "0.12.0"
tags: [climate, presence, energy-saving, thermostat]
roles:
  # Thermostats — multi-select so a whole home's thermostats set back together.
  # kind climate. min_count 1.
  - id: thermostats
    title: Thermostats
    kind: climate
    min_count: 1
    selection: required
    description: >-
      The thermostats to set back. They must support presets; the recipe
      switches between an away and a home preset.
  # Presence sensors deciding home from away. binary_sensor + occupancy.
  # min_count 1.
  - id: presence_sensors
    title: Presence sensors
    kind: binary_sensor
    device_class: occupancy
    min_count: 1
    selection: required
    description: >-
      The sensors that tell the house apart as occupied or empty. Any one
      seeing someone holds comfort.
  # Optional extra occupancy sensors also counted as home. min_count 0.
  - id: occupancy
    title: Extra occupancy sensors
    kind: binary_sensor
    device_class: occupancy
    min_count: 0
    selection: required
    description: >-
      Optional. Additional occupancy sensors that also count as home, so a
      person the presence sensors miss still holds comfort. Leave empty to use
      the presence sensors alone.
inputs:
  # How long every sensor must be clear before the setback engages. 15 minutes
  # rides out a quick trip outside without setting back.
  - id: away_minutes
    type: number
    label: Away delay (minutes)
    description: >-
      How long every sensor must read clear before the thermostat sets back.
    default: 15
    min: 0
    max: 240
  # Preset applied when the house is empty. eco is the most common
  # energy-saving preset name.
  - id: away_preset
    type: string
    label: Away preset name
    description: >-
      The thermostat preset used when the house is empty, as it appears in Home
      Assistant.
    default: "eco"
  # Preset applied when someone returns. none returns most thermostats to their
  # normal schedule or manual setpoint.
  - id: home_preset
    type: string
    label: Home preset name
    description: >-
      The thermostat preset used when someone is home, as it appears in Home
      Assistant.
    default: "none"
package_files:
  - package/automations/setback.yaml.j2
{# Presence Thermostat Setback: one automation sets the away preset when the
   house empties, one sets the home preset when someone returns.

   The presence and occupancy sensors are combined into a single list. Away is
   every sensor in that list having been off for the away delay, confirmed with
   an all-off state condition so one sensor still seeing someone blocks the
   setback. Home is any sensor going on. Both drive every thermostat with
   climate.set_preset_mode. #}
{% set presence = roles.presence_sensors + roles.occupancy %}
automation:
  - id: selora_recipe_{{ slug | replace('-', '_') }}_away
    alias: "Presence Thermostat Setback: away"
    description: >-
      When every presence and occupancy sensor has been clear for the away
      delay, switch the thermostats to the away preset.
    mode: single
    trigger:
{% for sensor in presence %}
      - platform: state
        entity_id: {{ sensor }}
        to: "off"
        for:
          minutes: {{ inputs.away_minutes }}
{% endfor %}
    condition:
      # for: applies to every entity in the list, so all of them must have been
      # clear for the full delay. The trigger's for: only vouches for the sensor
      # that fired; without this a second sensor that cleared moments earlier is
      # accepted as soon as it reads off, cutting the delay short whenever more
      # than one sensor is picked.
      - condition: state
        state: "off"
        for:
          minutes: {{ inputs.away_minutes }}
        entity_id:
{% for sensor in presence %}
          - {{ sensor }}
{% endfor %}
    action:
      - service: climate.set_preset_mode
        target:
          entity_id:
{% for thermostat in roles.thermostats %}
            - {{ thermostat }}
{% endfor %}
        data:
          preset_mode: "{{ inputs.away_preset }}"
  - id: selora_recipe_{{ slug | replace('-', '_') }}_home
    alias: "Presence Thermostat Setback: home"
    description: >-
      When any presence or occupancy sensor reports someone home, switch the
      thermostats back to the home preset.
    mode: single
    trigger:
{% for sensor in presence %}
      - platform: state
        entity_id: {{ sensor }}
        to: "on"
{% endfor %}
    action:
      - service: climate.set_preset_mode
        target:
          entity_id:
{% for thermostat in roles.thermostats %}
            - {{ thermostat }}
{% endfor %}
        data:
          preset_mode: "{{ inputs.home_preset }}"

Type to search across

↑↓ navigate ↵ open
⌘K search