---
title: "Label management"
description: "Spook adds actions to Home Assistant to create, update and delete labels, and to put them on or take them off areas, devices and entities, all from your own automations and scripts."
canonical_url: "https://spook.boo/labels"
---
# Label management

> Spook adds actions to Home Assistant to create, update and delete labels, and to put them on or take them off areas, devices and entities, all from your own automations and scripts.

Labels in Home Assistant are yours to make up. You use them to build your own way of organizing things, by tagging devices, entities, or areas with one or more labels. Labels filter the tables in the user interface, and they work as a target for actions in automations and scripts: "turn off everything labeled Christmas".

In Home Assistant you hand out labels yourself, one by one. Spook adds actions so your automations and scripts can do it too. That makes labels that keep themselves up to date: a "Replace battery" label that lands on a device when its battery runs low, and comes off again once you swapped it. Or labels that are made on the fly, the moment you need one.

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

Search for label when you add an action: Spook's actions have the 👻.

## Actions

Spook adds nine actions for labels. You find them wherever you add an action, marked with a 👻. They all belong to the Home Assistant Core Integration, so that is the name in front of them in the list.

Run by hand, these actions need a user that is an administrator. Your automations and scripts can always run them.

### Create a label

Adds a new label to your Home Assistant instance.

Handy when an automation or script needs a label that is not there yet, like a setup script that prepares the labels your other automations use, or a label per guest that arrives.

**How to use it**

1. Open the automation or script that should do this, and select **Add action**.
2. Search for **create a label**, and select **Home Assistant Core Integration: Create a label 👻**.
3. Give it a **Name** and a **Description**, like `Battery powered` and `Everything that runs on batteries`.
4. If you like, pick an **Icon** and a **Color**.
5. Select **Save**.

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

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

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

**Technical details**

| Action properties |
| --- |
| Action | Create a label 👻 |
| Action name | `homeassistant.create_label` |
| 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=homeassistant.create_label) [![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=homeassistant.create_label) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `name` | string | Yes | `Battery powered` |
| `description` | string | No | `Label to tag all battery powered devices` |
| `icon` | string | No | `mdi:battery` |
| `color` | string | No | `indigo` |

Home Assistant makes the label ID from the name, so `Battery powered` becomes `battery_powered`. Besides the theme colors in the list, `color` also takes a hex color, like `#ff9800`.

**Example actions in YAML**

A label for everything that runs on batteries:

```yaml
action: homeassistant.create_label
data:
  name: "Battery powered"
  description: "Label to tag all battery powered devices"
  icon: "mdi:battery"
  color: "indigo"
```

**Known limitations**

- A name another label already has is refused. Home Assistant keeps label names unique.
- The action does not respond with the ID of the new label. Since it is made from the name, you can look it up with the `label_id` template, like `{{ label_id('Battery powered') }}`.

### Update a label

Changes the name, description, icon or color of a label that already exists.

Without this, the only way to change a label from an automation was to delete it and create it again. Deleting a label takes it off everything it was on. A lot to lose over a new icon. This changes the label and leaves it where it is.

Anything you leave out keeps the value it already has.

**How to use it**

1. Open the automation or script that should do this, and select **Add action**.
2. Search for **update a label**, and select **Home Assistant Core Integration: Update a label 👻**.
3. Under **Label ID**, pick the label to change.
4. Fill in only what should change: **Name**, **Description**, **Icon** or **Color**.
5. Select **Save**.

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

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

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

**Technical details**

| Action properties |
| --- |
| Action | Update a label 👻 |
| Action name | `homeassistant.update_label` |
| 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=homeassistant.update_label) [![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=homeassistant.update_label) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `label_id` | string | Yes | `battery_powered` |
| `name` | string | No | `Battery powered` |
| `description` | string or `null` | No | `Label to tag all battery powered devices` |
| `icon` | string or `null` | No | `mdi:battery` |
| `color` | string or `null` | No | `indigo` |

Setting `description`, `icon` or `color` to `null` clears it. Leaving a field out is not the same as giving it an empty string: `description: ""` empties the description, and that counts as a change.

**Example actions in YAML**

Give a label a better description:

```yaml
action: homeassistant.update_label
data:
  label_id: "battery_powered"
  description: "Label to tag all battery powered devices"
```

**Known limitations**

- You need to give at least one thing to change. A call with only a `label_id` is refused, so a misspelled field gives you an error.
- Renaming a label to a name another label already has is refused too, since Home Assistant keeps label names unique.
- Renaming a label does not change its ID. The ID stays what it was made from, the first name.

### Delete a label

Removes a label from your Home Assistant instance.

For cleaning up after yourself: the label for a guest who went home, or the one a script made for a party that is over. The label comes off every area, device and entity it was on.

**How to use it**

1. Open the automation or script that should do this, and select **Add action**.
2. Search for **delete a label**, and select **Home Assistant Core Integration: Delete a label 👻**.
3. Under **Label ID**, pick the label to delete.
4. Select **Save**.

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

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

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

**Technical details**

| Action properties |
| --- |
| Action | Delete a label 👻 |
| Action name | `homeassistant.delete_label` |
| 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=homeassistant.delete_label) [![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=homeassistant.delete_label) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `label_id` | string | Yes | `battery_powered` |

**Getting a label ID from a label name**

Not sure what the `label_id` of a label is? The `label_id` field also takes templates, so you can use the label's name instead:

```yaml
label_id: "{{ label_id('Battery powered') }}"
```

That template finds the ID of the label with the name "Battery powered".

**Example actions in YAML**

Delete a label by its ID:

```yaml
action: homeassistant.delete_label
data:
  label_id: "battery_powered"
```

The same, using the label's name instead of its ID:

```yaml
action: homeassistant.delete_label
data:
  label_id: "{{ label_id('Battery powered') }}"
```

**Known limitations**

- There is no undo. Creating the label again gives you the label back, not the places it was on.

### Add a label to an area

Puts one or more labels on one or more areas.

Areas change with the seasons and with how you use them. Label the rooms with heating on as "Heated" in winter, or the guest room as "Occupied" while somebody stays over, and target everything with that label from your other automations.

**How to use it**

1. Open the automation or script that should do this, and select **Add action**.
2. Search for **add a label to an area**, and select **Home Assistant Core Integration: Add a label to an area 👻**.
3. Under **Label ID**, pick the labels to add.
4. Under **Area ID**, pick the areas that should get them.
5. Select **Save**.

Every label you picked goes on every area you picked. Labels an area already has stay on it.

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

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

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

**Technical details**

| Action properties |
| --- |
| Action | Add a label to an area 👻 |
| Action name | `homeassistant.add_label_to_area` |
| 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=homeassistant.add_label_to_area) [![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=homeassistant.add_label_to_area) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `label_id` | string \| list of strings | Yes | `living_space` |
| `area_id` | string \| list of strings | Yes | `living_room` |

Every label and every area is looked up before anything changes. If one of them does not exist, the action stops with an error that names it, and nothing is changed.

**Getting a label ID from a label name**

Not sure what the `label_id` of a label is? The `label_id` field also takes templates, so you can use the label's name instead:

```yaml
label_id: "{{ label_id('Living space') }}"
```

That template finds the ID of the label with the name "Living space".

**Getting an area ID from an area name**

Not sure what the `area_id` of an area is? The `area_id` field also takes templates, so you can use the area's name instead:

```yaml
area_id: "{{ area_id('Living room') }}"
```

That template finds the ID of the area with the name "Living room".

**Example actions in YAML**

Label the living room as living space:

```yaml
action: homeassistant.add_label_to_area
data:
  label_id: "living_space"
  area_id: "living_room"
```

The same, using the names of the area and the label instead of their IDs:

```yaml
action: homeassistant.add_label_to_area
data:
  label_id: "{{ label_id('Living space') }}"
  area_id: "{{ area_id('Living room') }}"
```

Several labels and areas at once. Each label is added to each area:

```yaml
action: homeassistant.add_label_to_area
data:
  label_id:
    - "living_space"
    - "chill_zone"
  area_id:
    - "living_room"
    - "games_room"
```

### Remove a label from an area

Takes one or more labels off one or more areas.

The other half of [Add a label to an area](#add-a-label-to-an-area). Winter is over, the "Heated" label comes off. The guest went home, the guest room is no longer "Occupied".

**How to use it**

1. Open the automation or script that should do this, and select **Add action**.
2. Search for **remove a label from an area**, and select **Home Assistant Core Integration: Remove a label from an area 👻**.
3. Under **Label ID**, pick the labels to take off.
4. Under **Area ID**, pick the areas to take them off.
5. Select **Save**.

Every label you picked comes off every area you picked. An area that did not have the label is left as it is, and other labels stay on.

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

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

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

**Technical details**

| Action properties |
| --- |
| Action | Remove a label from an area 👻 |
| Action name | `homeassistant.remove_label_from_area` |
| 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=homeassistant.remove_label_from_area) [![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=homeassistant.remove_label_from_area) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `label_id` | string \| list of strings | Yes | `living_space` |
| `area_id` | string \| list of strings | Yes | `living_room` |

Every label and every area is looked up before anything changes. If one of them does not exist, the action stops with an error that names it, and nothing is changed.

**Getting a label ID from a label name**

Not sure what the `label_id` of a label is? The `label_id` field also takes templates, so you can use the label's name instead:

```yaml
label_id: "{{ label_id('Living space') }}"
```

That template finds the ID of the label with the name "Living space".

**Getting an area ID from an area name**

Not sure what the `area_id` of an area is? The `area_id` field also takes templates, so you can use the area's name instead:

```yaml
area_id: "{{ area_id('Living room') }}"
```

That template finds the ID of the area with the name "Living room".

**Example actions in YAML**

Take the living space label off the living room:

```yaml
action: homeassistant.remove_label_from_area
data:
  label_id: "living_space"
  area_id: "living_room"
```

The same, using the names of the area and the label instead of their IDs:

```yaml
action: homeassistant.remove_label_from_area
data:
  label_id: "{{ label_id('Living space') }}"
  area_id: "{{ area_id('Living room') }}"
```

Several labels and areas at once. Each label is removed from each area:

```yaml
action: homeassistant.remove_label_from_area
data:
  label_id:
    - "living_space"
    - "chill_zone"
  area_id:
    - "living_room"
    - "games_room"
```

### Add a label to a device

Puts one or more labels on one or more devices.

Let your automations do the bookkeeping. A battery runs low, the device gets the "Replace battery" label, and the devices table filtered on that label is your shopping list. A device drops off the network, and it gets "Needs attention".

**How to use it**

1. Open the automation or script that should do this, and select **Add action**.
2. Search for **add a label to a device**, and select **Home Assistant Core Integration: Add a label to a device 👻**.
3. Under **Label ID**, pick the labels to add.
4. Under **Device ID**, pick the devices that should get them.
5. Select **Save**.

Every label you picked goes on every device you picked. Labels a device already has stay on it.

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

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

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

**Technical details**

| Action properties |
| --- |
| Action | Add a label to a device 👻 |
| Action name | `homeassistant.add_label_to_device` |
| 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=homeassistant.add_label_to_device) [![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=homeassistant.add_label_to_device) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `label_id` | string \| list of strings | Yes | `battery_powered` |
| `device_id` | string \| list of strings | Yes | `dc23e666e6100f184e642a0ac345d3eb` |

Every label and every device is looked up before anything changes. If one of them does not exist, the action stops with an error that names it, and nothing is changed.

**Getting a label ID from a label name**

Not sure what the `label_id` of a label is? The `label_id` field also takes templates, so you can use the label's name instead:

```yaml
label_id: "{{ label_id('Battery powered') }}"
```

That template finds the ID of the label with the name "Battery powered".

**Finding a device ID**

Not sure what the `device_id` of your device is? There are a few ways to find it.

Open this action in the Actions tool, pick the device under **Device ID**, and select **Go to YAML mode**. The YAML shows the device ID.

Or open the page of the device in the UI and look at the address bar. The device ID is the last part of the URL, and looks something like this: `dc23e666e6100f184e642a0ac345d3eb`.

**Example actions in YAML**

Label a device as battery powered:

```yaml
action: homeassistant.add_label_to_device
data:
  label_id: "battery_powered"
  device_id: "dc23e666e6100f184e642a0ac345d3eb"
```

The same, using the label's name instead of its ID:

```yaml
action: homeassistant.add_label_to_device
data:
  label_id: "{{ label_id('Battery powered') }}"
  device_id: "dc23e666e6100f184e642a0ac345d3eb"
```

Several labels and devices at once. Each label is added to each device:

```yaml
action: homeassistant.add_label_to_device
data:
  label_id:
    - "battery_powered"
    - "cr2023"
  device_id:
    - "dc23e666e6100f184e642a0ac345d3eb"
    - "df98a97c9341a0f184e642a0ac345d3b"
```

### Remove a label from a device

Takes one or more labels off one or more devices.

The other half of [Add a label to a device](#add-a-label-to-a-device). The battery is swapped, "Replace battery" comes off. The device is back online, "Needs attention" goes.

**How to use it**

1. Open the automation or script that should do this, and select **Add action**.
2. Search for **remove a label from a device**, and select **Home Assistant Core Integration: Remove a label from a device 👻**.
3. Under **Label ID**, pick the labels to take off.
4. Under **Device ID**, pick the devices to take them off.
5. Select **Save**.

Every label you picked comes off every device you picked. A device that did not have the label is left as it is, and other labels stay on.

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

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

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

**Technical details**

| Action properties |
| --- |
| Action | Remove a label from a device 👻 |
| Action name | `homeassistant.remove_label_from_device` |
| 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=homeassistant.remove_label_from_device) [![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=homeassistant.remove_label_from_device) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `label_id` | string \| list of strings | Yes | `battery_powered` |
| `device_id` | string \| list of strings | Yes | `dc23e666e6100f184e642a0ac345d3eb` |

Every label and every device is looked up before anything changes. If one of them does not exist, the action stops with an error that names it, and nothing is changed.

**Getting a label ID from a label name**

Not sure what the `label_id` of a label is? The `label_id` field also takes templates, so you can use the label's name instead:

```yaml
label_id: "{{ label_id('Battery powered') }}"
```

That template finds the ID of the label with the name "Battery powered".

**Finding a device ID**

Not sure what the `device_id` of your device is? There are a few ways to find it.

Open this action in the Actions tool, pick the device under **Device ID**, and select **Go to YAML mode**. The YAML shows the device ID.

Or open the page of the device in the UI and look at the address bar. The device ID is the last part of the URL, and looks something like this: `dc23e666e6100f184e642a0ac345d3eb`.

**Example actions in YAML**

Take the battery powered label off a device:

```yaml
action: homeassistant.remove_label_from_device
data:
  label_id: "battery_powered"
  device_id: "dc23e666e6100f184e642a0ac345d3eb"
```

The same, using the label's name instead of its ID:

```yaml
action: homeassistant.remove_label_from_device
data:
  label_id: "{{ label_id('Battery powered') }}"
  device_id: "dc23e666e6100f184e642a0ac345d3eb"
```

Several labels and devices at once. Each label is removed from each device:

```yaml
action: homeassistant.remove_label_from_device
data:
  label_id:
    - "battery_powered"
    - "cr2023"
  device_id:
    - "dc23e666e6100f184e642a0ac345d3eb"
    - "df98a97c9341a0f184e642a0ac345d3b"
```

### Add a label to an entity

Puts one or more labels on one or more entities.

The same idea as for devices, one level down. Label the sensors that went unavailable, the lights that were left on overnight, or every entity a blueprint touches, and filter the entities table on it later.

**How to use it**

1. Open the automation or script that should do this, and select **Add action**.
2. Search for **add a label to an entity**, and select **Home Assistant Core Integration: Add a label to an entity 👻**.
3. Under **Label ID**, pick the labels to add.
4. Under **Entity ID**, pick the entities that should get them.
5. Select **Save**.

Every label you picked goes on every entity you picked. Labels an entity already has stay on it.

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

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

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

**Technical details**

| Action properties |
| --- |
| Action | Add a label to an entity 👻 |
| Action name | `homeassistant.add_label_to_entity` |
| 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=homeassistant.add_label_to_entity) [![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=homeassistant.add_label_to_entity) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `label_id` | string \| list of strings | Yes | `battery_powered` |
| `entity_id` | string \| list of strings | Yes | `sensor.outside_temperature` |

Every label and every entity is looked up before anything changes. If one of them does not exist, the action stops with an error that names it, and nothing is changed.

**Getting a label ID from a label name**

Not sure what the `label_id` of a label is? The `label_id` field also takes templates, so you can use the label's name instead:

```yaml
label_id: "{{ label_id('Battery powered') }}"
```

That template finds the ID of the label with the name "Battery powered".

**Example actions in YAML**

Label an entity as battery powered:

```yaml
action: homeassistant.add_label_to_entity
data:
  label_id: "battery_powered"
  entity_id: sensor.outside_temperature
```

The same, using the label's name instead of its ID:

```yaml
action: homeassistant.add_label_to_entity
data:
  label_id: "{{ label_id('Battery powered') }}"
  entity_id: sensor.outside_temperature
```

Several labels and entities at once. Each label is added to each entity:

```yaml
action: homeassistant.add_label_to_entity
data:
  label_id:
    - "battery_powered"
    - "cr2023"
  entity_id:
    - sensor.outside_temperature
    - sensor.inside_temperature
```

**Known limitations**

- Labels go on entities Home Assistant keeps in its entity registry, the ones with a unique ID. An entity without one cannot carry a label, here or in the UI, and the action stops with an error that names it.

### Remove a label from an entity

Takes one or more labels off one or more entities.

The other half of [Add a label to an entity](#add-a-label-to-an-entity). The sensor is back, the light is off, the label comes off.

**How to use it**

1. Open the automation or script that should do this, and select **Add action**.
2. Search for **remove a label from an entity**, and select **Home Assistant Core Integration: Remove a label from an entity 👻**.
3. Under **Label ID**, pick the labels to take off.
4. Under **Entity ID**, pick the entities to take them off.
5. Select **Save**.

Every label you picked comes off every entity you picked. An entity that did not have the label is left as it is, and other labels stay on.

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

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

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

**Technical details**

| Action properties |
| --- |
| Action | Remove a label from an entity 👻 |
| Action name | `homeassistant.remove_label_from_entity` |
| 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=homeassistant.remove_label_from_entity) [![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=homeassistant.remove_label_from_entity) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `label_id` | string \| list of strings | Yes | `battery_powered` |
| `entity_id` | string \| list of strings | Yes | `sensor.outside_temperature` |

Every label and every entity is looked up before anything changes. If one of them does not exist, the action stops with an error that names it, and nothing is changed.

**Getting a label ID from a label name**

Not sure what the `label_id` of a label is? The `label_id` field also takes templates, so you can use the label's name instead:

```yaml
label_id: "{{ label_id('Battery powered') }}"
```

That template finds the ID of the label with the name "Battery powered".

**Example actions in YAML**

Take the battery powered label off an entity:

```yaml
action: homeassistant.remove_label_from_entity
data:
  label_id: "battery_powered"
  entity_id: sensor.outside_temperature
```

The same, using the label's name instead of its ID:

```yaml
action: homeassistant.remove_label_from_entity
data:
  label_id: "{{ label_id('Battery powered') }}"
  entity_id: sensor.outside_temperature
```

Several labels and entities at once. Each label is removed from each entity:

```yaml
action: homeassistant.remove_label_from_entity
data:
  label_id:
    - "battery_powered"
    - "cr2023"
  entity_id:
    - sensor.outside_temperature
    - sensor.inside_temperature
```

## Blueprints & tutorials

There are no known blueprints or tutorials for these actions yet. Made one, or found one? [Let us know in our discussion forums](https://github.com/frenck/spook/discussions).

## Feature requests, ideas, and support

Got an idea to take this further, like a new action, entity or repair? [Let us know in our discussion forums](https://github.com/frenck/spook/discussions).

Stuck, or found a bug? The [Support](https://spook.boo/support) page tells you where to go for help.


## Sitemap

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