Is in zone
The Is in zone condition passes when a selected person or device tracker is in a selected zone. Use it to make an automation continue only when someone is home, at work, or in another zone that matters to the automation.
When you target more than one person or device tracker, the Check when option controls whether one matching target is enough or every selected target must be in the zone.
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 this condition 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.
- From the search box, search for and select Is in zone.
- Select what you want to check. Under By target, choose one or more people or device trackers.
- Under Zone, select the zone to check against.
- If you selected more than one target, under Check when, pick Any or All.
- Under For at least, you can set how long the target must have been in the zone before the condition passes. Leave it at zero for the condition to pass immediately.
- Select Save.
Options in the UI
Pick Any to pass if at least one selected target is in the zone, or All to pass only when every selected target is in the zone. The 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, refer to this condition as zone.in_zone. A basic example looks like this:
condition: zone.in_zone
target:
entity_id: person.nina
options:
zone: zone.home
This passes when person.nina is in zone.home.
Options in YAML
YAML sometimes provides additional options for more complex use cases that are not available through the UI.
When multiple people or device trackers are targeted, controls how results combine. Accepts any or all.
Targets of the condition
This condition requires a target. The target is the person or device tracker that Home Assistant will check.
-
Entity: one specific person or device tracker entity, such as
person.ninaordevice_tracker.phone. - Device: every matching person or device tracker entity that belongs to a device.
- Area: every matching person or device tracker entity in a room or area.
- Floor: every matching person or device tracker entity on a floor.
- Label: every matching person or device tracker entity that shares a label.
You can also select different target types in one condition.
Behavior with multiple targets
When you target more than one person or device tracker, the Check when option controls how the results combine:
- Any (default): the condition passes if at least one of the selected people or device trackers is in the zone.
- All: the condition passes only when every selected person or device tracker is in the zone.
Good to know
- This condition uses the
in_zonesattribute reported by person and device tracker entities. - If a selected person or device tracker is
unknownorunavailable, Home Assistant does not treat that target as being in the zone. - To check the opposite state, use Is not in zone.
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: unlock the side door only when Nina is home
When the front door contact sensor turns on, this automation unlocks the side door only if Nina is already in the home zone.
-
Trigger: State changes to on
-
Target: Front door contact sensor (
binary_sensor.front_door)
-
Target: Front door contact sensor (
-
Condition: Is in zone
-
Target: Nina (
person.nina) -
Zone: Home (
zone.home)
-
Target: Nina (
-
Action: Unlock lock
-
Target: Side door (
lock.side_door)
-
Target: Side door (
YAML example for unlocking a side door only when Nina is home
alias: "Unlock the side door when Nina is home"
triggers:
- trigger: state
entity_id: binary_sensor.front_door
to: "on"
conditions:
- condition: zone.in_zone
target:
entity_id: person.nina
options:
zone: zone.home
actions:
- action: lock.unlock
target:
entity_id: lock.side_door
Automation: send a reminder when everyone is at work
At 09:00, this automation sends a reminder if both selected people are in the work zone.
- Trigger: Time is 09:00
-
Condition: Is in zone
- Target: Nina and Alex
-
Zone: Work (
zone.work) - Check when: All
-
Action: Send a notification message
-
Target: My Device (
notify.my_device)
-
Target: My Device (
YAML example for a reminder when everyone is at work
alias: "Send a reminder when everyone is at work"
triggers:
- trigger: time
at: "09:00:00"
conditions:
- condition: zone.in_zone
target:
entity_id:
- person.nina
- person.alex
options:
zone: zone.work
behavior: all
actions:
- action: notify.send_message
target:
entity_id: notify.my_device
data:
message: "Everyone is at work."
Still stuck?
The Home Assistant community is quick to help: join Discord for real-time chat, post on the community forum with the condition you’re using and what you expected to happen, or share on our subreddit /r/homeassistant.
AI assistants like ChatGPT or Claude can also explain conditions or suggest the right one when you describe what you want in plain language.
Related conditions
These conditions work well alongside this one:
-
Is not in zone: Tests if one or more people or device trackers are not in a zone.
-
Zone occupancy is detected: Tests if a zone is occupied.