Use geofencing to adjust your thermostat when you leave and come home

Last updated:

Includes Home Assistant automation

This automation uses your phone's location to set the thermostat back when everyone leaves and bring it up to comfort when the first person returns. A fixed schedule keeps heating an empty house on the days your plans change; geofencing follows the people, not the clock.

everyone_leftheading_homearrivedeveryone leaves home for10 minutessomeone enters nearhomesomeone enters homeSet living room to 16°Set living room to 20°
Trigger Condition Action Wait Nothing

What you need

  • A smart thermostat your platform can set from an automation. Nest, Ecobee and Netatmo are typical.
  • A phone with location sharing, added through the Home Assistant Companion app and attached to a person entity. The automation names people rather than handsets, so a device_tracker that belongs to nobody has nothing to hang the rule on.
  • One person entity per household member, if you want the rule to tell an empty house from a half-empty one.
  • A second zone drawn on the same spot as home, wide enough to cover the last few minutes of your drive, with its passive switch turned on. That is the arrival ring.
  • Home Assistant 2026.6 or newer, which is where these zone triggers arrived.

How it works

Both halves are boundary crossings, but not the same boundary. Leaving is the home zone emptying. When the last person crosses out and stays out for ten minutes, the thermostat drops to a setback temperature. The ten minutes are there so a five-minute errand does not start a heating swing you then have to undo.

Coming back is the wider ring. Crossing into it restores the comfort setpoint while you are still minutes from the door. A thermostat that finds out at the doormat starts from the away setpoint, and the first stretch of the evening goes on waiting for the radiators to catch up.

The setback names everyone who lives there and waits for the last of them to go. Key it to your handset alone and it fires while your partner is still home on the sofa. One caveat on that promise: a person entity that has gone unknown or unavailable is skipped rather than waited for.

A schedule cannot do any of this. It warms the house at 5pm whether you are pulling into the driveway or still two towns over. Geofencing follows where you actually are, so the afternoon you stay out late, the heating never comes on at all. A degree Fahrenheit off the thermostat is worth roughly 1 to 3% on the bill, and an empty house is the easiest place to give up a few.

Why the arrival ring has to be passive

Drawing the second zone is the easy part. Leaving it visible is the mistake.

Home Assistant hands a phone the smallest zone it is standing in, so an ordinary ring around home becomes what your presence reports for the last stretch of every trip. The person entity reads Near home instead of not_home, and every rule you ever wrote against not_home quietly stops matching. The zone's passive switch fixes that in one click. A passive zone still counts you as inside for triggers, it just never becomes the state.

The trips the ring cannot catch

A ring only fires when you cross into it, so it only helps on journeys that began outside it. Walk the dog round the block, take twenty minutes, and the setback lands while you are still well inside the ring. On the way back there is no crossing left to make.

So the automation listens for the home zone as well, and repeats the comfort setpoint there. It is the plainest trigger of the three and the one that keeps the house from sitting on the away setpoint on a technicality. The ring buys the head start. The home zone makes sure you get warm at all.

The ring cannot call off a setback that is already counting down, either. Leave the ring, turn back inside the leave delay, and the warm-up fires on the way in. The setback still lands when the timer runs out. Your arrival at the door is what undoes it.

Direction is the other thing the ring does not know. Anyone in the household who clips it and drives on starts a warm-up, and nothing puts it back down until they come home and leave again. That is the standing price of starting early. A wider ring buys more head start and more stray warm-ups, so keep it to roughly the last part of your commute. Gating on direction is the obvious refinement, and the Proximity integration reports it. It buys less than it looks like. A boundary you cross inward is inbound by definition. On the trips where the reading comes back stationary or unknown, the check throws the warm-up away instead.

None of this is a warm house waiting on the doorstep. It is a head start, and a modest setback is what keeps that promise realistic. Cooling season flips the arithmetic, with the away setpoint the higher one. That is a swap of two numbers rather than a different automation, though a thermostat running a heat and cool range wants a high and a low rather than the single target this one sets.

Which platforms can run it

Several thermostats do a version of this on their own. Nest, Ecobee and Netatmo ship an eco or geolocation mode that follows your phone once you grant location permission, with no separate automation platform involved. SmartThings, Apple Home, Google Home and Alexa can all drive a Matter thermostat directly. Layering two boundaries, an inner zone for the setback and an outer one that never shows, is Home Assistant's trick.

This idea is shared for inspiration only, not professional advice. If it involves wiring, breakers, or high-draw appliances, verify ratings and your local electrical code, or hire a licensed electrician. Read our full disclaimer.

Get the Home Assistant Automation YAML

Validated against Home Assistant 2026.9.3 Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Example automation (Home Assistant). A starting point; swap in your own entity names.

alias: Warm the house as someone heads home, set back once everyone leaves
description: >-
  Set the thermostat back once the last person has left the home zone, and start
  warming as soon as anyone crosses a wider passive zone drawn around it. Entering
  the home zone repeats the comfort setpoint, so a missed ring still gets the
  heating on. Needs Home Assistant 2026.6 or newer. Setpoints below are Celsius.
mode: restart
triggers:
  - trigger: zone.left
    target:
      entity_id:
        - person.alex
        - person.nina
    options:
      zone: zone.home
      behavior: all
      for: "00:10:00"
    id: everyone_left
  - trigger: zone.entered
    target:
      entity_id:
        - person.alex
        - person.nina
    options:
      zone: zone.near_home
      behavior: first
    id: heading_home
  - trigger: zone.entered
    target:
      entity_id:
        - person.alex
        - person.nina
    options:
      zone: zone.home
      behavior: first
    id: arrived
actions:
  - choose:
      - conditions:
          - condition: trigger
            id: everyone_left
        sequence:
          - action: climate.set_temperature
            target:
              entity_id: climate.living_room
            data:
              temperature: 16
      - conditions:
          - condition: trigger
            id:
              - heading_home
              - arrived
        sequence:
          - action: climate.set_temperature
            target:
              entity_id: climate.living_room
            data:
              temperature: 20

That automation is yours to keep

Get a fresh idea like it - plus the week's smart home news and gear - in your inbox every Friday. Free, and unsubscribing is one click.

Related Ideas

Tagged: presence-detection, energy-saving, climate-control

Want more ideas like this?

Fresh automation ideas plus the smart home news and gear worth knowing, in your inbox every Friday.