---
title: "Person"
description: "Spook adds actions to create, change and delete persons, and to add and remove their device trackers on the fly, and tells you when a person tracks device trackers that no longer exist."
canonical_url: "https://spook.boo/person"
---
# Person

> Spook adds actions to create, change and delete persons, and to add and remove their device trackers on the fly, and tells you when a person tracks device trackers that no longer exist.

The person integration in Home Assistant tracks where the people in your household are. A person is a collection of device trackers that together say where that person is. A person can also have a user account attached, to log in to Home Assistant.

Home Assistant lets you add, change and delete persons on the People page, by hand. Spook adds actions for it, so an automation or a script can do the same: make a person for a new housemate, link it to their user and phone, and delete it again when they move out. And to change the device trackers of a person on the fly. Spook also tells you when a person tracks something that is gone.

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

Spook adds some new actions to the person integration.

## Actions

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

### Add a device tracker

Adds one or more device trackers to a person.

The trackers of a person are set by hand on the People page, and stay that way. Real life does not. Somebody borrows the car with the GPS tracker for the weekend, or a kid takes the family tablet to school. With this action, an automation attaches the tracker to whoever has it right now, and [removes it](#remove-a-device-tracker) again later.

**How to use it**

1. Open the automation or script that should do this, and select **Add action**.
2. Search for **add a device tracker**, and select **Person: Add a device tracker 👻**.
3. Under **Person**, choose the person.
4. Under **Device tracker**, choose one or more device trackers.
5. Select **Save**.

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

![The Actions tool with Add a device tracker 👻 picked and filled in with an example.](https://spook.boo/images/screenshots/en/light/action-person-add-device-tracker.webp)

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

**Technical details**

| Action properties |
| --- |
| Action | Person: Add a device tracker 👻 |
| Action name | `person.add_device_tracker` |
| Action targets | No |
| Action response | No response |
| Spook's influence | Newly added action |
| Tools | [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=person.add_device_tracker) [![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=person.add_device_tracker) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `entity_id` | string | Yes | `person.frenck` |
| `device_tracker` | string \| list of strings | Yes | `device_tracker.iphone` |

**Example actions in YAML**

Add one device tracker:

```yaml
action: person.add_device_tracker
data:
  entity_id: person.frenck
  device_tracker: device_tracker.iphone
```

To add multiple device trackers at once, use a list:

```yaml
action: person.add_device_tracker
data:
  entity_id: person.frenck
  device_tracker:
    - device_tracker.iphone
    - device_tracker.ipad
```

**Known limitations**

- Only persons made in the UI can be changed. One set up in YAML is refused.
- A device tracker the person already has is not added twice.

### Remove a device tracker

Removes one or more device trackers from a person.

The other half of [Add a device tracker](#add-a-device-tracker): the car is back, so its tracker no longer says where that person is.

**How to use it**

1. Open the automation or script that should do this, and select **Add action**.
2. Search for **remove a device tracker**, and select **Person: Remove a device tracker 👻**.
3. Under **Person**, choose the person.
4. Under **Device tracker**, choose the device trackers to remove.
5. Select **Save**.

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

![The Actions tool with Remove a device tracker 👻 picked and filled in with an example.](https://spook.boo/images/screenshots/en/light/action-person-remove-device-tracker.webp)

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

**Technical details**

| Action properties |
| --- |
| Action | Person: Remove a device tracker 👻 |
| Action name | `person.remove_device_tracker` |
| Action targets | No |
| Action response | No response |
| Spook's influence | Newly added action |
| Tools | [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=person.remove_device_tracker) [![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=person.remove_device_tracker) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `entity_id` | string | Yes | `person.frenck` |
| `device_tracker` | string \| list of strings | Yes | `device_tracker.iphone` |

**Example actions in YAML**

Remove one device tracker:

```yaml
action: person.remove_device_tracker
data:
  entity_id: person.frenck
  device_tracker: device_tracker.iphone
```

To remove multiple device trackers at once, use a list:

```yaml
action: person.remove_device_tracker
data:
  entity_id: person.frenck
  device_tracker:
    - device_tracker.iphone
    - device_tracker.ipad
```

**Known limitations**

- Only persons made in the UI can be changed. One set up in YAML is refused.

### Create a person

Creates a new person, the same as adding one on the People page.

A new housemate moves in. Setting up their phone app, their user and their person is a trip through three settings pages. With this action, the script that sets up a new housemate makes the person too: linked to their user, so they log in as that person, and to their phone, so Home Assistant knows when they are home.

**How to use it**

1. Open the automation or script that should create the person, and select **Add action**.
2. Search for **create a person**, and select **Person: Create a person 👻**.
3. Fill in **Name**, like `Sam`.
4. Fill in whatever else you want to set: **User ID**, **Device trackers** or **Picture**. To pick the entity ID yourself, fill in **Person entity ID**.
5. Select **Save**.

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

**Technical details**

| Action properties |
| --- |
| Action | Person: Create a person 👻 |
| Action name | `person.create` |
| Action targets | No targets |
| Action response | Optional, the `entity_id` of the new person |
| Spook's influence | Newly added action |
| Tools | [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=person.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=person.create) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `name` | string | Yes | `Sam` |
| `person_id` | string | No | `sam` |
| `user_id` | string | No | `bf1f3b59c7a842c8a9de3e1c12345678` |
| `device_trackers` | list of strings | No | `device_tracker.sam_phone` |
| `picture` | string | No | `/local/people/sam.jpg` |

Without a `person_id`, the entity ID follows the name, as it does in the UI, and gets a number at the end if that name is already taken. With a `person_id`, you get exactly that entity ID or an error: one that is already taken is refused, and does not get a number at the end.

Home Assistant and its person dialog have a few rules for a person, and this action checks them before it makes anything. A user is linked to one person only: one that already has a person, from the UI or from YAML, is refused. So is a user Home Assistant made for itself, like the one of the Supervisor, since nobody logs in as one of those. A device tracker has to be there, the way the dialog only offers the ones that are. [List users](https://spook.boo/users#list-users) gives you the ID of every user.

**Example actions in YAML**

Sam moves in: a person, linked to their user and their phone, and the entity ID kept for the next steps:

```yaml
action: person.create
data:
  name: "Sam"
  user_id: bf1f3b59c7a842c8a9de3e1c12345678
  device_trackers:
    - device_tracker.sam_phone
response_variable: created
```

The new person's entity ID is then in `{{ created.entity_id }}`.

**Known limitations**

- This links an existing user, it does not make one. Make the user on the People page, or let the person dialog make one, and give its ID here.
- The name of the linked user stays what it is. The person dialog gives that user the name of the person, this action does not. To rename the user too, use [Update a user](https://spook.boo/users#update-a-user).
- This takes an admin when a user calls it, since it changes who lives in your home. Automations and scripts are not affected.

### Delete a person

Deletes one or more persons, disabled ones included.

The other half of [Create a person](#create-a-person): a guest who stayed for a few months moves out, and their person can go. Everything in the list is checked first: if one of them cannot be deleted, none of them are.

The user a person is linked to stays. Deleting a person on the People page deletes that user as well, this action leaves it be. Once the person is gone, that user only shows on the **Users** tab of the People page, which you see with advanced mode on in your user profile. A user that should go, you delete there, or disable from an automation with [Disable a user](https://spook.boo/users#disable-a-user).

**How to use it**

1. Open the automation or script that should delete the person, and select **Add action**.
2. Search for **delete a person**, and select **Person: Delete a person 👻**.
3. Under **Entity ID**, choose the persons to delete.
4. Select **Save**.

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

**Technical details**

| Action properties |
| --- |
| Action | Person: Delete a person 👻 |
| Action name | `person.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=person.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=person.delete) |

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

**Example actions in YAML**

The guest moved out:

```yaml
action: person.delete
data:
  entity_id: person.guest
```

**Known limitations**

- Only persons made in the UI or with [Create a person](#create-a-person) can be deleted. Persons set up in YAML can only be removed from the YAML.
- The user a person is linked to is not deleted.
- This takes an admin when a user calls it, since it changes who lives in your home. Automations and scripts are not affected.

### Update a person

Changes persons made in the UI, the same as editing them on the People page. The change stays, through a reload and a restart.

Somebody gets married and takes a new name, or a kid gets their first user account. Without this action, that is a trip to the People page. With it, the script that sets up the new account links it to the person too.

**How to use it**

1. Open the automation or script that should change the person, and select **Add action**.
2. Search for **update a person**, and select **Person: Update a person 👻**.
3. Under **Targets**, choose the person.
4. Fill in what should change: **Name**, **User ID**, **Device trackers** or **Picture**. What you leave out stays as it is.
5. Select **Save**.

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

**Technical details**

| Action properties |
| --- |
| Action | Person: Update a person 👻 |
| Action name | `person.update` |
| Action targets | Yes, `person` entities |
| Action response | No response |
| Spook's influence | Newly added action |
| Tools | [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=person.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=person.update) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `name` | string | No | `Anne de Vries` |
| `user_id` | string | No | `bf1f3b59c7a842c8a9de3e1c12345678` |
| `device_trackers` | list of strings | No | `device_tracker.anne_phone` |
| `picture` | string | No | `/local/people/anne.jpg` |

Give at least one field. What is given goes on top of what the person has, and what is left out keeps what it has. The change is stored, the same as editing the person on the People page, so it survives a reload and a restart. A new name changes the name, not the entity ID.

`device_trackers` replaces the device trackers the person has with the ones you give. To add one or take one off and keep the rest, use [Add a device tracker](#add-a-device-tracker) or [Remove a device tracker](#remove-a-device-tracker).

The same rules as for [Create a person](#create-a-person) apply, checked before anything changes: a user that already has another person, or that Home Assistant made for itself, is refused, and so is a device tracker that is not there. A user is linked to one person only, so a `user_id` for more than one person at once is refused too. With more than one person, each gets the change on top of its own settings, and all of them are checked before the first one changes: one that is refused stops the others too.

A `user_id` of `null` unlinks the user, and a `picture` of `null` takes the picture away.

**Example actions in YAML**

Anne's first user account, linked to her person:

```yaml
action: person.update
target:
  entity_id: person.anne
data:
  user_id: bf1f3b59c7a842c8a9de3e1c12345678
```

**Known limitations**

- Only persons made in the UI or with [Create a person](#create-a-person) can be changed. One set up in YAML is refused: only the YAML can change it.
- The name of the linked user stays what it is. The person dialog renames that user along with the person, this action does not. To rename the user too, use [Update a user](https://spook.boo/users#update-a-user).
- The entity ID stays what it is. To change it too, use [Entity: Update ID](https://spook.boo/actions#entity-update-id).
- This takes an admin when a user calls it, since it changes who lives in your home. Automations and scripts are not affected.

## Repairs

Spook looks through your persons for device trackers that no longer exist, and tells you in the repairs dashboard. The repair names the person and the trackers that are missing.

This one Spook can fix for you, straight from the repair. New to repairs? Follow [Fix your first repair](https://spook.boo/fix-your-first-repair).

Want Spook to leave one person alone? Keep it out on the **Exclusions** page of Spook's panel, or put the **Excluded from Spook** label on it. [How that works](https://spook.boo/troubleshooting#excluded-from-spook).

### Unknown device trackers

A person tracks a device tracker that no longer exists, usually because it was renamed, or the integration providing it was removed. The person keeps working on the trackers that remain. So somebody whose phone tracker disappeared is just located a little less accurately.

![The Unknown device trackers repair for a person still tracking an old phone, with the choice to remove it.](https://spook.boo/images/screenshots/en/light/repair-person-unknown-device-trackers.webp)

An old phone that is gone, still on the person, and the offer to take it off.

**How to fix it:** Open the repair, and choose **Remove the deleted device trackers** to have Spook take the ones it marks as deleted, which Home Assistant removed, off the person. Or choose **Let me fix it myself**, and change the person on the People page. If you want to keep them, **Keep them, stop telling me** does that. The repair disappears by itself once it is fixed.

**How Spook checks this**

A person is a collection of device trackers, and the person's location is whatever those trackers say it is. Spook looks at the trackers of every person. When one of them no longer exists, it raises a repair that names the person and the missing trackers.

A tracker counts as existing when the entity registry knows it, or when it has a state right now. Many device trackers, like those reporting over MQTT or from the old `known_devices.yaml`, never get into the registry, so both are checked before one is reported. That is also why Spook only offers to remove the ones Home Assistant deleted: a tracker from `known_devices.yaml` that has not reported in yet looks exactly like one that is gone. Spook looks again whenever an integration loads, the entity registry changes, persons are reloaded, or a device tracker appears or goes away.

Spook cannot edit a person set up in YAML. For those, the repair points you at your configuration.

## Use cases

What people use this for:

- Add or remove a temporary device tracker for a person. For example, attach the tracker in the car to whoever took the car.
- Set up a new housemate in one script: their person, linked to their user and their phone.
- Remove the person of a guest when they move out.


## Sitemap

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