This automation watches your phone's location and sets your thermostat back when the last person leaves the geofence around your home, then restores it as you head back. It saves the hours a fixed schedule would spend heating or cooling an empty house.
Get weekly smart home insights delivered to your inbox.
What you need
- A smart thermostat your platform can write a setpoint or a preset to, not one it can only switch on and off. Setback and restore are setpoint changes, not power changes.
- A phone running your platform's companion app with location tracking enabled. The phone is the sensor here, so there is no extra hardware to buy, and no permission means no geofence.
- A home zone with an editable radius. Most apps let you drop a perimeter on a map. The size of that circle is the setting that matters most on this page, and the default is rarely the right one.
- Per-person tracking if more than one of you lives there, so the setback waits for the last person out instead of firing on the first.
How it works
Leaving is the clean half. The last tracked phone crosses the perimeter, the thermostat drops to its away setpoint, and the system stops conditioning an empty house. This is the part a schedule genuinely cannot do. A timer warms the house at five whether anyone is in it or not, and the evening you stay out late is the evening it wastes the most. Geofencing is what covers the unplanned absence, which is why thermostats bolt geolocation onto a schedule rather than selling it as a replacement for one.
Arrival is a different problem wearing the same trigger.
A geofence is honest about leaving and optimistic about coming back. Crossing the perimeter on the way home is the moment the house should already be recovering, not the moment it starts, and the deeper the setback the longer that recovery runs. That is why thermostats ship geolocation for absences but hand arrival to a separate, schedule-driven anticipation feature.
Sizing the geofence to your house
The fix is to stop using one perimeter for both directions. Departure fires on a tight circle around the house, where the signal you want is "gone." Arrival fires on a wider circle, sized to how long your house actually takes to recover. You can measure that instead of guessing: set the thermostat back, let the house settle, then time the climb to your comfort setpoint. A house that needs twenty minutes wants a radius you cross roughly twenty minutes out, which for most commutes is measured in miles, not in yards.
Two things make that radius easier to live with. Keep the setback proportionate. A single degree is worth roughly 1-3% on the bill, which sets the scale of what is on offer: a modest, incremental saving, not a jackpot that rewards going as deep as you can. The recovery grows with depth, and it is the part you actually experience. Ten degrees of setback is not ten times better to come home to, and a deep one ends up running a long catch-up cycle you spend in your coat.
Then pick the right detector for each direction. GPS is the obvious one, but it is slow and coarse. Your phone dropping off the home Wi-Fi is both faster and more precise, which is why that same signal is the better trigger for locking up as you drive away. Use Wi-Fi for the instant departure and a GPS zone for the approach, and each direction gets the trigger it is actually good at.
Watch out for
- The action end is rarely the problem. A Matter thermostat hands its setpoint to Apple Home, Google Home, Alexa, and SmartThings alike. The trigger end is where platforms diverge, so check yours before you buy anything: can it wait for the last person out rather than firing when the first one goes, and will it hold that as a condition? Home Assistant, Homey, and SmartThings give you the full version. Alexa routines take one trigger each with little conditional logic, so a per-person departure routine is the ceiling there, with no way to wait for the last person. On Apple Home and Google Home, verify what their presence triggers can express before you plan around them.
- The approach zone contains the home zone, which catches people building this by hand. A circle wide enough to buy you twenty minutes of lead time also covers the corner shop, so a short trip never leaves it and therefore never re-enters it, and the restore never fires. You walk back into a house still sitting on its away setpoint. Add an arrival at the home zone itself as a second restore trigger and the short trip is covered.
- Location permission is a hard dependency and it fails quietly. If the app loses it, the geofence stops working and nothing tells you. Keep the schedule underneath as a floor rather than trusting the geofence on its own.
- Anyone without a tracked phone is invisible to this. A guest, a contractor, or someone working from home on a dead battery all look like an empty house, and the thermostat will happily set back on them.
- This is whole-home logic driven by your distance from the building. It says nothing about which rooms you occupy once you are inside, which is occupancy-driven HVAC. The two stack cleanly: the geofence decides whether the house is conditioned at all, occupancy decides where. Pausing HVAC when a window opens is the third layer, and it overrides both.
Example automation (Home Assistant). A starting point; swap in your own entity names.
alias: Set the thermostat back on leaving, restore on the way home
description: >-
Sets the thermostat to its away preset once the LAST tracked person leaves the
home zone, and back to the home preset when anyone returns, either by entering
a wider "almost home" zone sized to how long the house takes to recover, or by
reaching home directly on a short trip. List every person who lives there, swap
in your own entity names, and set the radius of zone.almost_home to your own
measured recovery time.
mode: restart
trigger:
- platform: zone
entity_id:
- person.alex
- person.sam
zone: zone.home
event: leave
id: left
- platform: zone
entity_id:
- person.alex
- person.sam
zone: zone.almost_home
event: enter
id: returning
- platform: zone
entity_id:
- person.alex
- person.sam
zone: zone.home
event: enter
id: returning
action:
- choose:
- conditions:
- condition: trigger
id: left
- condition: numeric_state
entity_id: zone.home
below: 1
sequence:
- service: climate.set_preset_mode
target:
entity_id: climate.hallway
data:
preset_mode: away
- conditions:
- condition: trigger
id: returning
sequence:
- service: climate.set_preset_mode
target:
entity_id: climate.hallway
data:
preset_mode: home
Tagged: energy-saving, climate-control, presence-detection