Core extensions

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.
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 opens it in your Home Assistant, ready to run once.

The Actions tool with Create a label 👻 picked and filled in with an example.
What Try this action opens, filled in with an example.

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 opens it in your Home Assistant, ready to run once.

The Actions tool with Update a label 👻 picked and filled in with an example.
What Try this action opens, filled in with an example.

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 opens it in your Home Assistant, ready to run once.

The Actions tool with Delete a label 👻 picked and filled in with an example.
What Try this action opens, filled in with an example.

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 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.
What Try this action opens, filled in with an example.

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

  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 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.
What Try this action opens, filled in with an example.

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 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.
What Try this action opens, filled in with an example.

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

  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 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.
What Try this action opens, filled in with an example.

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 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.
What Try this action opens, filled in with an example.

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

  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 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.
What Try this action opens, filled in with an example.

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.