Zones and Geofencing: Home, Work, School, the Store

Zones and Geofencing: Home, Work, School, the Store

Module 16 · Lesson 6

In Lesson 5 you learned about presence and its real-world problems. Now we'll add zones: places outside the home that Home Assistant can recognize, say, work or school. You'll learn to do this sensibly, because zones are meant to help the home respond to context, not to track household members.

Up to now, presence has been simple: home or away. Zones add a third dimension. Instead of just not_home, you can know that someone is at Work or at School. That can be useful, but it also digs deeper into privacy. So in this lesson we'll spend as much time on the technique as on the conversation about what not to track.

Plan on about fifty to fifty-five minutes. By the end you'll create one additional test zone, say, Work, and check how Home Assistant recognizes entering and leaving it. No building a surveillance system, and no tracking other people without their consent.

This lesson's core rule
Zones are meant to help the home respond to context.
We're not turning them into a household tracking system.

What a zone is

A zone is an area on the map with a defined center and radius. When a phone shows up inside that area, Home Assistant considers the device to be in that zone. You already have the Home zone: it's the area around your house that decided the home and not_home states back in Lesson 5.

You can add your own zones, say, Work, School, or the Store. Then instead of just showing not_home, a phone's device_tracker can show the zone's name. That way Home Assistant knows not just that you left home, but roughly where you are, if it's one of your defined places.

A zone is an area, not a precise point
In this lesson we mainly care about whether the phone is in a given area, not its exact route. You don't need to, and shouldn't, build a system that watches every household member's movement. It's enough to know whether someone is home or in one of your defined places.

A zone versus plain not_home

Without your own zones, a phone away from home just shows not_home. There's no way to know whether you're at work, at the store, or across town. That's usually enough for simple scenarios like "nobody's home, lower the heat." Zones only add detail once you genuinely need it.

It's worth realizing this before you start adding places. If all you need is "home or away," you might not need extra zones at all. Fewer zones means less location data and simpler configuration. You add a zone because you have a specific idea, not because you can.

A zone has its own state too

In Home Assistant a zone isn't just a circle on a map. A zone can carry its own numeric state, showing how many people are currently inside it. That comes in handy later, when you're thinking about questions like: is anyone home, is anyone at work, is a given zone empty.

No automation yet
You don't need to use the zone's state yet. It's just worth knowing that a zone can answer "how many people are in this place," not only "is my phone there."

What geofencing actually is

Geofencing is simply detecting that a device has crossed the boundary of a defined area. A phone can tell Home Assistant that it entered or left a zone. In practice the app can also update location in other situations, say, when it's opened, refreshed, or after a significant change in position. The main idea stays simple: in this lesson we care about recognizing a handful of set places, not tracking a household member's entire route.

This matters for both privacy and battery. In a well-planned use of zones, we're not interested in a continuous map of someone's day, only in the fact that they entered or left a few specific places. That's exactly the difference between helpful context and a tracking system.

Privacy comes first

This is the most important part of this lesson. Zones touch people's location, and location is sensitive data. We're not building a system that tracks where someone is all day. We're building simple recognition of a few places that helps the home respond sensibly.

The right approach: a few zones with a clear purpose, agreed with household members, and used for comfort.

The wrong approach: tracking a household member's every movement, checking where someone's been, and building control out of it.

Agree on it with household members
Before you start recognizing who's at work or at school, talk to those people. Tracking someone's location without their knowledge and consent is a serious privacy violation, even within a family.

Exact location or just a zone name

In the Companion App you may come across settings related to how the phone sends location to Home Assistant. Depending on the platform and app version, it may be possible to send an exact position or just zone information. For a lot of household uses, it's enough to know that the phone is in the Home zone, the Work zone, or outside any known zone.

Way of thinking What it gives you When it's enough
Exact location Home Assistant knows the phone's more precise position. When you genuinely need more accuracy and accept a wider scope of data.
Zone name only Home Assistant sees a zone, say, Home, Work, or not_home. For most simple presence and notification scenarios.

Data minimization
If "I'm at work" or "I'm away" is enough for your automation, you don't need to build an exact route-tracking system. The less data you collect, the easier it is to protect privacy.

The Home zone and its radius

Before adding new zones, it's worth understanding the Home zone. It's centered on your house and has a radius that marks out the "home" area. That radius has a real effect on the presence behavior from Lesson 5.

Too small a radius: the phone easily drops out of the zone, so presence flickers between home and not_home.

Too large a radius: the phone shows home even though you're already several streets away, so a return gets detected too early.

A sensible radius: covers the house and its immediate surroundings, but not half the neighborhood. Matched to the phone's accuracy.

If presence flickered or changed strangely in Lesson 5, the Home zone's radius might well have been the cause. This is a good time to check it before adding more zones.

A good practice is matching the radius to how precisely your phone reports location around your house. In dense housing, GPS can be less accurate, so too small a zone will produce false departures. In open areas you can bring the radius down. There's no single ideal number for everyone, so it's worth watching presence after every change to the radius.

Where to find zones in Home Assistant

You'll find zones in Home Assistant's settings, in the section covering areas, labels, and zones. The exact wording in the interface may vary slightly between versions and languages, but the idea is the same: you're looking for the place where Home Assistant shows a map and lets you add location areas.

The simplest path
  • Go to Settings.
  • Open Areas, Labels and Zones.
  • Switch to the Zones tab.
  • You'll see the Home zone and any zones you added before.
  • Only add a new zone once you know why you need it.

Don't start with YAML
Zones can also be configured through files, but in this beginner course we start with the interface. A map, a name, a radius, and saving the zone are enough to get started.

How to add a zone

You add zones in Home Assistant's settings. For learning purposes, it's best to start with one test zone, say, Work. Don't add ten places right away. One zone is enough to understand how entering and leaving works.

Adding a zone, step by step
  • Go to Settings, then Areas, Labels and Zones.
  • Switch to the Zones tab and add a new zone.
  • Give it a readable name, say, Work.
  • Set the zone's center on the map in the right spot.
  • Choose a radius that covers the building and its immediate surroundings, but not the whole area.
  • Save the zone and check that it appears on the zone list.

Start with one zone
One test zone will let you understand how entering and leaving behaves without creating a mess. Add more only once you know what you need them for.

Just like naming your phone back in Lesson 3, it's worth giving zones readable names right away. Work, School, or Store will tell you more than zone1 or place2, especially a few weeks from now when you've forgotten what you set up where. A good name is one every household member will understand, not just you on the day you created the zone.

Also avoid names that reveal too much or could put someone in an awkward spot. A zone's name will be visible in Home Assistant, in history, and potentially in notifications. A simple, neutral name is the safest choice.

Radius, GPS accuracy, and delays

Zones inherit all of presence's problems from Lesson 5. GPS can be imprecise, the phone saves battery, and entering a zone is detected with a delay. Too small a radius means entering the zone might go unnoticed. Too large a radius will show you as at work when you're only approaching the building.

A delayed entry: the phone only recognizes the Work zone a little while after actually entering its area.

Flickering at the edge: if you're right at the zone's border, the state can jump back and forth between the zone and not_home.

Overlapping zones: if two zones overlap, the phone might show a different one than you expected.

The same safeguard as with presence
Just like in Lesson 5, with zones it's worth reacting only once a state has held for a while. Don't build logic that switches the whole home on a zone's first flicker.

It's also worth remembering that the more zones you have close together, the greater the chance the phone shows a different one than you expect. In practice it's better to have a handful of well-chosen zones you actually use than ten places you've never tested. Every zone you don't test is a potential source of surprises in your automations.

Passive zones: leave for later

When configuring a zone, you may see a passive zone option. Its behavior depends on your Home Assistant and Companion App version. Starting around version 2026.6, zone reporting was expanded, and the app may report every matching zone, including passive ones. Older versions behaved differently. Don't state flatly that "passive never changes state" without checking your own version. At the start, it's still better to use a regular test zone.

At this stage
Don't turn on the passive option if you don't know why you'd need it. A plain Work or School zone is enough to learn geofencing.

Several people and zones: different daily rhythms

In Lesson 5 you learned the difference between one person and the whole household. With zones, that difference becomes even more important. Each household member has a different daily rhythm and different places. One person's Work zone isn't the same as someone else's Work or School.

Zones are shared: a zone added in Home Assistant applies to the whole system, but whether a given person enters it depends on their own phone.

Don't mix up places: if two people have different workplaces and both want to use this feature, give the zones readable, neutral names, say, Marek's Work and Anna's Work.

Consent applies separately to each person: one household member agreeing to place recognition doesn't mean everyone else does.

Your own phone and one test zone are enough to start with either way. Save expanding to several people for later, once you understand how zones behave in practice and once you've talked with household members about what works for them.

Good examples of using zones

Zones work best in scenarios that help but don't hurt when they're off by a few minutes. We're not building these yet in this lesson. The point is knowing what zones are well suited to.

A reminder after leaving: once everyone leaves the house, a reminder about an open window, if the family wants that.

A welcome-home scene: when you get back to the Home zone in the evening, a soft hallway light turns on after a moment.

A note for the family: when a child arrives at School, a parent gets a reassuring note, but only with clear rules, consent, and an age-appropriate conversation.

Context for notifications: don't send home alerts to someone at work if they can't act on them anyway.

What not to do with zones

Just as presence isn't a security system, zones aren't a surveillance system. A few things are worth ruling out from the start.

Don't track routes across an entire day, and don't log where anyone's been.

Don't add zones for someone's private life, say, places they wouldn't want disclosed.

Don't control critical things, like an alarm, a gate, or a lock, based on a zone alone.

Don't set up tracking for a child or a partner without their knowledge and consent. That's a matter of trust, not just technique.

How many zones to add at the start

One extra zone is enough to start. Two at most, if you genuinely have a second simple case, say, Work and School. Don't add every place that comes to mind. Every zone should have a purpose, household members' consent, and a real-world test.

Good: Home plus one Work zone, tested for a few days.

Proceed carefully: several zones for different household members, only after a conversation and after you understand how they behave.

Bad: ten zones added on day one, untested and with no specific use.

A zone as context, not as a trigger for everything

The safest way to think about a zone is as extra context, not as the home's main switch. A zone answers "is it worth doing something now" reasonably well, but it's a poor fit for decisions that need to be certain. When it's off by a few minutes, comfort scenarios lose nothing, while critical scenarios can cause real trouble.

A zone as context: "since no one's here and everyone's away, lower the heat" is a safe use.

A zone as a certain switch: "when I enter the Home zone, open the gate" is a risky use, because a GPS error will open the gate for no reason.

This distinction will come back in later modules when we get to automations. For now, remember the simple line: comfort, yes, critical things, no. If a mistake's consequence is serious, a zone shouldn't be the only condition.

How to test a zone

The best test is an ordinary day, just like with presence. Next time you head to your test zone, say, to work, check whether the phone's device_tracker showed the zone's name, and when.

What's worth checking
  • Whether, after entering the zone, the device_tracker showed its name instead of not_home.
  • How long passed between actually entering and the state changing.
  • Whether the zone switched back to not_home on the way out.
  • Whether the state flickered at the zone's boundary.
  • Whether the entity history confirms the entry and exit times.
  • Whether the zone shows a person count when someone is inside its area.

A first practical test of a zone automation

Zones can be used directly in triggers and conditions. Build a test zone, deploy the examples below, and test entering, leaving, overlapping zones, and a loss of internet.

Overlapping zones and the store
Overlapping radii confuse beginners. A "store" zone tends to be a weak example, a short visit may not get detected at all. On Android check Zone Based Tracking. On iOS, location relies partly on significant location changes.

Entering the test zone

alias: "TEST - entering the test zone"
description: "A safe geofencing test with no gate opening"
triggers:
  - trigger: zone
    entity_id: person.marek
    zone: zone.test_zone
    event: enter
conditions:
  - condition: time
    after: "07:00:00"
    before: "22:00:00"
actions:
  - action: notify.mobile_app_marek_phone
    data:
      title: "Test zone"
      message: "Entry into the test zone detected."
mode: single

Leaving the test zone

alias: "TEST - leaving the test zone"
triggers:
  - trigger: zone
    entity_id: person.marek
    zone: zone.test_zone
    event: leave
actions:
  - action: notify.mobile_app_marek_phone
    data:
      title: "Test zone"
      message: "Exit from the test zone detected."
mode: single

No gate, no alarm
Don't open a gate or disarm an alarm based on geofencing alone. Do a real drive-by test instead.

What can go wrong

You build a tracking system: zones are meant to give context, not to keep tabs on household members.

You add several zones at once: it's easy to lose track of places you never tested.

A zone's radius is too large: the zone catches too early or covers half the neighborhood.

You don't ask household members for consent: recognizing other people's places without a conversation violates privacy.

You react to a single zone flicker: a brief GPS error shouldn't trigger an automation.

You turn on the passive option without understanding it: the device might not show the zone's name the way you expect.

You expect an exact route: zones are meant to recognize entering and leaving an area, not to watch every movement.

You don't check a zone's state: a zone by itself can show a person count inside it, which is useful for diagnostics.

You give zones names that are too personal: names can appear in history, notifications, and dashboards.

Assignment: create one test zone

To do

☐ Check your Home zone's radius and judge whether it's too small or too large.

☐ Find where Zones live in your version of Home Assistant.

☐ Add one test zone, say, Work, with a sensible radius.

☐ Check whether you see a passive option when adding the zone, and leave it off for now.

☐ Next time you head there, check whether the device_tracker showed the zone's name after entering.

☐ Note the delay between actually entering and the state change.

☐ Check whether the zone shows a person count when someone is inside its area.

☐ Check the Companion App's location-sending settings and whether zone-name mode is enough for you.

☐ If you want to recognize other household members' places, talk to them first and get their consent.

☐ Write down one good idea for using a zone, and one you're deliberately not doing for privacy reasons.

☐ Delete or leave inactive any zone you don't have a clear use for.

Key takeaways

A zone is an area on the map, it has a center and a radius, and a phone is either in the zone or outside it.

Privacy matters more than the feature, zones get set up together with household members, not quietly on your own.

The radius matters, too small flickers, too large catches too early, match it to your phone's accuracy.

Zones inherit presence's problems, delays, flickering, and GPS errors apply to zones too.

Start with one zone, one extra zone is enough at first, two at most after testing.

A zone also has a numeric state, it can show how many people are in a given place, not just whether your phone is there.

What's next

In Lesson 7 we'll move on to notifications: the basics of notify, sending your first message from Home Assistant to a phone, and how to avoid spamming yourself. That's the first moment your phone starts actively talking back to you.

For now you have presence and zones built with good sense: the home knows who's home, and optionally who's in one of your set places too, all while respecting privacy and without controlling anything critical based on location alone.

Finished this lesson?