Label management
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.

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
- Open the automation or script that should do this, and select Add action.
- Search for create a label, and select Home Assistant Core Integration: Create a label 👻.
- Give it a Name and a Description, like
Battery poweredandEverything that runs on batteries. - If you like, pick an Icon and a Color.
- Select Save.
Just want to see it work? Try this action opens it in your Home Assistant, ready to run once.

| 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 |
| 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.
A label for everything that runs on batteries:
action: homeassistant.create_label
data:
name: "Battery powered"
description: "Label to tag all battery powered devices"
icon: "mdi:battery"
color: "indigo"
- 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_idtemplate, 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
- Open the automation or script that should do this, and select Add action.
- Search for update a label, and select Home Assistant Core Integration: Update a label 👻.
- Under Label ID, pick the label to change.
- Fill in only what should change: Name, Description, Icon or Color.
- Select Save.
Just want to see it work? Try this action opens it in your Home Assistant, ready to run once.

| 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 |
| 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.
Give a label a better description:
action: homeassistant.update_label
data:
label_id: "battery_powered"
description: "Label to tag all battery powered devices"
- You need to give at least one thing to change. A call with only a
label_idis 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
- Open the automation or script that should do this, and select Add action.
- Search for delete a label, and select Home Assistant Core Integration: Delete a label 👻.
- Under Label ID, pick the label to delete.
- Select Save.
Just want to see it work? Try this action opens it in your Home Assistant, ready to run once.

| 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 |
| Action data parameters | |||
|---|---|---|---|
| Attribute | Type | Required | Default / Example |
label_id | string | Yes | battery_powered |
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:
label_id: "{{ label_id('Battery powered') }}"
That template finds the ID of the label with the name "Battery powered".
Delete a label by its ID:
action: homeassistant.delete_label
data:
label_id: "battery_powered"
The same, using the label's name instead of its ID:
action: homeassistant.delete_label
data:
label_id: "{{ label_id('Battery powered') }}"
- 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
- Open the automation or script that should do this, and select Add action.
- Search for add a label to an area, and select Home Assistant Core Integration: Add a label to an area 👻.
- Under Label ID, pick the labels to add.
- Under Area ID, pick the areas that should get them.
- 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 opens it in your Home Assistant, ready to run once.

| 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 |
| 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.
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:
label_id: "{{ label_id('Living space') }}"
That template finds the ID of the label with the name "Living space".
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:
area_id: "{{ area_id('Living room') }}"
That template finds the ID of the area with the name "Living room".
Label the living room as living space:
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:
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:
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. Winter is over, the "Heated" label comes off. The guest went home, the guest room is no longer "Occupied".
How to use it
- Open the automation or script that should do this, and select Add action.
- Search for remove a label from an area, and select Home Assistant Core Integration: Remove a label from an area 👻.
- Under Label ID, pick the labels to take off.
- Under Area ID, pick the areas to take them off.
- 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 opens it in your Home Assistant, ready to run once.

| 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 |
| 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.
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:
label_id: "{{ label_id('Living space') }}"
That template finds the ID of the label with the name "Living space".
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:
area_id: "{{ area_id('Living room') }}"
That template finds the ID of the area with the name "Living room".
Take the living space label off the living room:
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:
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:
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
- Open the automation or script that should do this, and select Add action.
- Search for add a label to a device, and select Home Assistant Core Integration: Add a label to a device 👻.
- Under Label ID, pick the labels to add.
- Under Device ID, pick the devices that should get them.
- 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 opens it in your Home Assistant, ready to run once.

| 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 |
| 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.
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:
label_id: "{{ label_id('Battery powered') }}"
That template finds the ID of the label with the name "Battery powered".
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.
Label a device as battery powered:
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:
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:
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. The battery is swapped, "Replace battery" comes off. The device is back online, "Needs attention" goes.
How to use it
- Open the automation or script that should do this, and select Add action.
- Search for remove a label from a device, and select Home Assistant Core Integration: Remove a label from a device 👻.
- Under Label ID, pick the labels to take off.
- Under Device ID, pick the devices to take them off.
- 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 opens it in your Home Assistant, ready to run once.

| 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 |
| 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.
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:
label_id: "{{ label_id('Battery powered') }}"
That template finds the ID of the label with the name "Battery powered".
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.
Take the battery powered label off a device:
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:
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:
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
- Open the automation or script that should do this, and select Add action.
- Search for add a label to an entity, and select Home Assistant Core Integration: Add a label to an entity 👻.
- Under Label ID, pick the labels to add.
- Under Entity ID, pick the entities that should get them.
- 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 opens it in your Home Assistant, ready to run once.

| 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 |
| 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.
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:
label_id: "{{ label_id('Battery powered') }}"
That template finds the ID of the label with the name "Battery powered".
Label an entity as battery powered:
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:
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:
action: homeassistant.add_label_to_entity
data:
label_id:
- "battery_powered"
- "cr2023"
entity_id:
- sensor.outside_temperature
- sensor.inside_temperature
- 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. The sensor is back, the light is off, the label comes off.
How to use it
- Open the automation or script that should do this, and select Add action.
- Search for remove a label from an entity, and select Home Assistant Core Integration: Remove a label from an entity 👻.
- Under Label ID, pick the labels to take off.
- Under Entity ID, pick the entities to take them off.
- 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 opens it in your Home Assistant, ready to run once.

| 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 |
| 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.
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:
label_id: "{{ label_id('Battery powered') }}"
That template finds the ID of the label with the name "Battery powered".
Take the battery powered label off an entity:
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:
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:
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.
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.
Stuck, or found a bug? The Support page tells you where to go for help.
Integration management
Spook adds actions to Home Assistant to turn integrations on and off, stop and start polling for updates, and ignore everything Home Assistant discovered.
Category management
Spook adds actions to Home Assistant to create, update and delete categories, and to file automations, scripts, scenes and helpers into them, all from your own automations and scripts.










