---
title: "Zone"
description: "Spook adds actions to create, update and delete zones in Home Assistant from your automations and scripts, the home zone included."
canonical_url: "https://spook.boo/zone"
---
# Zone

> Spook adds actions to create, update and delete zones in Home Assistant from your automations and scripts, the home zone included.

A zone in Home Assistant is a circle on the map: home, work, the school, the gym. Home Assistant uses zones to tell where people and devices are, and automations can act when somebody enters or leaves one.

Home Assistant lets you draw zones by hand, in the settings. Spook adds actions for it, so an automation or a script can make a zone, move or resize it, and delete it again.

![The Add action dialog, searched for zone, with the actions Spook adds marked with a ghost.](https://spook.boo/images/screenshots/en/light/actions-search-zone.webp)

Spook adds actions to create, update and delete zones.

## Actions

Spook adds three actions for zones. You find them wherever you add an action, marked with a 👻.

### Create a zone

Adds a new zone, the same as drawing one in the settings.

A zone does not have to be a place you go to every week. Make one around the spot you just parked, and get a reminder when you walk back to it. Or around a friend's house for the evening, and delete it again tomorrow. Make it passive, and it is only there for your automations: not on the map, and it does not change where anybody is.

**How to use it**

1. Open the automation or script that should make the zone, and select **Add action**.
2. Search for **create a zone**, and select **Zone: Create a zone 👻**.
3. Fill in the **Name**, the **Latitude** and the **Longitude**.
4. Optionally, set the **Radius** in meters, the **Icon**, and turn on **Passive**. A passive zone only works for automations: nobody is shown as being in it.
5. Select **Save**.

Just want to see it work? [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=zone.create) opens it in your Home Assistant, ready to run once.

![The Actions tool with Create a zone 👻 picked and filled in with an example.](https://spook.boo/images/screenshots/en/light/action-zone-create.webp)

What **Try this action** opens, filled in with an example.

**Technical details**

| Action properties |
| --- |
| Action | Zone: Create a zone 👻 |
| Action name | `zone.create` |
| Action targets | No targets |
| Action response | No response |
| Spook's influence | Newly added action |
| Tools | [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=zone.create) [![Open your Home Assistant instance and show the Actions tool with a specific action selected.](https://my.home-assistant.io/badges/developer_call_service.svg)](https://my.home-assistant.io/redirect/developer_call_service/?service=zone.create) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `name` | string | Yes | `Statue of Liberty` |
| `icon` | string | No | `mdi:map-marker` |
| `latitude` | float | Yes | `40.6892494` |
| `longitude` | float | Yes | -74.0445004 |
| `radius` | float | No | 100 |
| `passive` | boolean | No | `false` |

The `radius` is in meters.

A passive zone is only there for automations: it is not shown on the map, and does not change where people and device trackers are. Handy for a zone an automation creates for itself, like the spot you parked, and deletes again once it is done with it.

**Example actions in YAML**

A zone around the Statue of Liberty:

```yaml
action: zone.create
data:
  name: "Statue of Liberty"
  icon: mdi:human-female-dance
  latitude: 40.6892494
  longitude: -74.0445004
  radius: 250
```

### Update a zone

Changes an existing zone: its name, icon, place, size, or whether it is passive.

Zones do not always stay put. Move the "car" zone to where the car is now. Make the home zone bigger in winter, when the drive home takes longer and the heating needs a head start. Only what you fill in changes; everything else stays as it is.

**How to use it**

1. Open the automation or script that should change the zone, and select **Add action**.
2. Search for **update a zone**, and select **Zone: Update a zone 👻**.
3. Under **Entity ID**, pick the zone.
4. Fill in only what should change, like the **Latitude** and **Longitude** to move it, or the **Radius** to resize it.
5. Select **Save**.

Just want to see it work? [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=zone.update) opens it in your Home Assistant, ready to run once.

![The Actions tool with Update a zone 👻 picked and filled in with an example.](https://spook.boo/images/screenshots/en/light/action-zone-update.webp)

What **Try this action** opens, filled in with an example.

**Technical details**

| Action properties |
| --- |
| Action | Zone: Update a zone 👻 |
| Action name | `zone.update` |
| Action targets | No targets |
| Action response | No response |
| Spook's influence | Newly added action |
| Tools | [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=zone.update) [![Open your Home Assistant instance and show the Actions tool with a specific action selected.](https://my.home-assistant.io/badges/developer_call_service.svg)](https://my.home-assistant.io/redirect/developer_call_service/?service=zone.update) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `entity_id` | string | Yes | `zone.statue_of_liberty` |
| `name` | string | No | `Statue of Liberty` |
| `icon` | string | No | `mdi:map-marker` |
| `latitude` | float | No | `40.6892494` |
| `longitude` | float | No | -74.0445004 |
| `radius` | float | No | 100 |
| `passive` | boolean | No | `true` |

The `radius` is in meters. Only the parameters you give are updated. The rest stays as it is. Set `passive` to make a zone only there for automations, or to make a passive zone an ordinary one again.

The home zone (`zone.home`) can be moved and resized too, with `latitude`, `longitude` and `radius`. It is drawn from the location of your whole Home Assistant instance, so that is what changes: the same location Home Assistant's own `homeassistant.set_location` sets, and the one everything else that uses your location follows. Its name and icon cannot be changed this way, its radius is in whole meters, and it is never passive.

**Example actions in YAML**

A new name, and a bigger circle:

```yaml
action: zone.update
data:
  entity_id: zone.statue_of_liberty
  name: "Statue of Liberty, New York"
  radius: 250
```

Resizing the home zone:

```yaml
action: zone.update
data:
  entity_id: zone.home
  radius: 250
```

**Known limitations**

- Zones set up in YAML cannot be updated. Change those in the YAML.
- Moving the home zone moves the location of your whole Home Assistant instance, and everything that follows it, like the sun.

### Delete a zone

Deletes one or more zones.

The other half of [Create a zone](#create-a-zone). A zone an automation made for the evening is gone again the next morning, and your map stays clean.

**How to use it**

1. Open the automation or script that should do the deleting, and select **Add action**.
2. Search for **delete a zone**, and select **Zone: Delete a zone 👻**.
3. Under **Entity ID**, pick the zones to delete.
4. Select **Save**.

Just want to see it work? [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=zone.delete) opens it in your Home Assistant, ready to run once. Mind that it really deletes.

![The Actions tool with Delete a zone 👻 picked and filled in with an example.](https://spook.boo/images/screenshots/en/light/action-zone-delete.webp)

What **Try this action** opens, filled in with an example.

**Technical details**

| Action properties |
| --- |
| Action | Zone: Delete a zone 👻 |
| Action name | `zone.delete` |
| Action targets | No targets |
| Action response | No response |
| Spook's influence | Newly added action |
| Tools | [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=zone.delete) [![Open your Home Assistant instance and show the Actions tool with a specific action selected.](https://my.home-assistant.io/badges/developer_call_service.svg)](https://my.home-assistant.io/redirect/developer_call_service/?service=zone.delete) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `entity_id` | string \| list of strings | Yes | `zone.statue_of_liberty` |

**Example actions in YAML**

Delete one zone:

```yaml
action: zone.delete
data:
  entity_id: zone.statue_of_liberty
```

Or several at once:

```yaml
action: zone.delete
data:
  entity_id:
    - zone.central_park
    - zone.statue_of_liberty
```

**Known limitations**

- Only zones made in the UI, or with [Create a zone](#create-a-zone), can be deleted. Zones set up in YAML cannot.

## Use cases

What people use this for:

- Create and update zones around a car or a person from an automation. That way you can tell who is close to the car, or get notified when you are near a certain person.


## Sitemap

See the full [sitemap](https://spook.boo/sitemap.md) for all pages.
