Core extensions

Entity management

Spook adds actions to manage entities in Home Assistant from automations and scripts. Disable, hide, rename, expose, set icons and aliases, and clean up orphans.

Entities are the building blocks of Home Assistant: every light, sensor, switch and button you see is one. You change their settings in the UI, in the settings dialog of each entity.

Spook adds actions that change those same settings from an automation or script: disable or hide an entity, give it a new name, icon or aliases, decide which voice assistants may see it, and clean up the entities nothing claims anymore.

Actions

Spook adds fourteen actions for entities. You find them wherever you add an action, marked with a 👻. Most of them change your setup: calling one of those by hand takes an administrator, while automations and scripts run them as usual.

Disable an entity

Disables one or more entities, the same as turning off Enabled in the entity's settings.

A disabled entity is gone from Home Assistant until you enable it again: no state, no new history, nothing in your dashboards. Handy for the sensors of a device that is packed away for the season, or a noisy entity you only need once in a while. Enable an entity brings it back.

How to use it

  1. Open the automation or script that should disable the entity, and select Add action.
  2. Search for disable an entity, and select Home Assistant Core Integration: Disable an entity 👻.
  3. Pick one or more entities under Entity.
  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 Disable an entity 👻 picked and filled in with an example.
What Try this action opens, filled in with an example.

Enable an entity

Enables one or more disabled entities again.

The way back from Disable an entity. Also useful for the entities an integration ships disabled, like extra diagnostic sensors, when an automation should switch them on.

How to use it

  1. Open the automation or script that should enable the entity, and select Add action.
  2. Search for enable an entity, and select Home Assistant Core Integration: Enable an entity 👻.
  3. Pick one or more entities under Entity.
  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 Enable an entity 👻 picked and filled in with an example.
What Try this action opens, filled in with an example.

Hide an entity

Hides one or more entities, the same as turning off Visible in the entity's settings.

A hidden entity keeps working. It just stays out of sight. It does not show up on dashboards that Home Assistant builds for you, and voice assistants like Google Assistant or Alexa don't see it by default. You can still expose it to them on purpose, in the voice assistant settings. Useful for the helper entities and technical sensors you need, but never want to look at.

How to use it

  1. Open the automation or script that should hide the entity, and select Add action.
  2. Search for hide an entity, and select Home Assistant Core Integration: Hide an entity 👻.
  3. Pick one or more entities under Entity.
  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 Hide an entity 👻 picked and filled in with an example.
What Try this action opens, filled in with an example.

Unhide an entity

Makes one or more hidden entities visible again.

The way back from Hide an entity.

How to use it

  1. Open the automation or script that should unhide the entity, and select Add action.
  2. Search for unhide an entity, and select Home Assistant Core Integration: Unhide an entity 👻.
  3. Pick one or more entities under Entity.
  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 Unhide an entity 👻 picked and filled in with an example.
What Try this action opens, filled in with an example.

Expose an entity to assistants

Lets one or more voice assistants see and control one or more entities.

Home Assistant keeps a separate list per assistant of what it may see. This is the same setting you find under Settings > Voice assistants > Expose, applied to as many entities as you like at once. Expose the guest room lights to Assist when guests arrive, or a whole batch of new entities to Alexa without ticking them one by one.

How to use it

  1. Open the automation or script that should do this, and select Add action.
  2. Search for expose an entity, and select Home Assistant Core Integration: Expose an entity to assistants 👻.
  3. Pick one or more entities under Entity.
  4. Under Assistants, pick Alexa, Google Assistant, Assist, or any mix of them.
  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 Expose an entity to assistants 👻 picked and filled in with an example.
What Try this action opens, filled in with an example.

Stop exposing an entity to assistants

Takes one or more entities out of reach of one or more voice assistants.

The reverse of Expose an entity to assistants. The guests have left, so Assist no longer needs to control the guest room. Or the front door lock should never be something Alexa can open, whatever got exposed along the way.

How to use it

  1. Open the automation or script that should do this, and select Add action.
  2. Search for stop exposing, and select Home Assistant Core Integration: Stop exposing an entity to assistants 👻.
  3. Pick one or more entities under Entity.
  4. Under Assistants, pick Alexa, Google Assistant, Assist, or any mix of them.
  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 Stop exposing an entity to assistants 👻 picked and filled in with an example.
What Try this action opens, filled in with an example.

Update an entity's ID

Gives an entity a new entity ID.

The same as changing Entity ID in the entity's settings. Useful when a script sets up a fresh installation, or when you clean up a batch of IDs that came out of an integration in a way you don't like.

Your automations, scripts and dashboards are not changed along with it. Anything that uses the old ID stops finding the entity. Spook points those out as repairs, like Unknown referenced entities for automations.

How to use it

  1. Open the automation or script that should do this, and select Add action.
  2. Search for update an entity's ID, and select Home Assistant Core Integration: Update an entity's ID 👻.
  3. Pick the entity under Entity.
  4. Fill in New Entity ID, like light.dining_room.
  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 an entity's ID 👻 picked and filled in with an example.
What Try this action opens, filled in with an example.

Delete all orphaned entities

Deletes every orphaned entity in one go.

An orphaned entity is one no integration claims anymore. Remove an integration, or replace a device, and its entities can stay behind in the entity list, marked as no longer provided. Deleting them one by one gets old fast. This deletes all of them at once.

Home Assistant marks an entity orphaned when its integration has not set it up since the last start. An integration that is offline, or failed to start, leaves its entities looking orphaned too. Running this action deletes those entities as well.

How to use it

  1. Make sure every integration you care about is up and running. Check Settings > Devices & services for any that failed to load.
  2. Open the script that should do the cleanup, and select Add action.
  3. Search for orphaned entities, and select Home Assistant Core Integration: Delete all orphaned entities 👻.
  4. There is nothing to fill in. Select Save.

Just want to see it work? Try this action opens it in your Home Assistant, ready to run once. Careful: that run deletes them for real.

The Actions tool with Delete all orphaned entities 👻 picked and filled in with an example.
What Try this action opens, filled in with an example.

List all orphaned database entities

Lists the entities your database still holds history for, but that no longer exist in Home Assistant.

Remove an integration, or disable an entity, and its history stays in the database. That history takes up space and does nothing for you. This finds those entities, so you can decide what to purge. It only lists, it deletes nothing.

How to use it

  1. Open the script that should use the list, and select Add action.
  2. Search for orphaned database entities, and select Home Assistant Core Integration: List all orphaned database entities 👻.
  3. Under Response variable, give the list a name, like orphaned. The steps after this one can use it.
  4. Select Save.

Just want to see it work? Try this action opens it in your Home Assistant. Run it, and the response shows the list.

The Actions tool with List all orphaned database entities 👻 picked and filled in with an example.
What Try this action opens, filled in with an example.

Rename an entity

Gives one or more entities a new name, the one you see in the UI.

The same as changing Name in the entity's settings. Its entity ID stays as it is, so nothing that uses the entity breaks.

How to use it

  1. Open the automation or script that should rename the entity, and select Add action.
  2. Search for rename an entity, and select Home Assistant Core Integration: Rename an entity 👻.
  3. Pick the entity under Entity.
  4. Fill in Name, like Living room light.
  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 Rename an entity 👻 picked and filled in with an example.
What Try this action opens, filled in with an example.

Set the icon of an entity

Sets the icon of one or more entities.

The same setting as Icon in the entity's settings. An icon that shows what is going on reads faster than text: a garbage can that changes for the week it goes out, or a fan icon for the plug that powers the fan.

How to use it

  1. Open the automation or script that should set the icon, and select Add action.
  2. Search for set the icon, and select Home Assistant Core Integration: Set the icon of an entity 👻.
  3. Pick one or more entities under Entity.
  4. Pick the icon under Icon, like mdi:lamp.
  5. Select Save.

To go back to the icon the integration gives the entity, set the icon to null in YAML mode.

Just want to see it work? Try this action opens it in your Home Assistant, ready to run once.

The Actions tool with Set the icon of an entity 👻 picked and filled in with an example.
What Try this action opens, filled in with an example.

Add an alias to an entity

Adds one or more aliases to one or more entities, and keeps the ones they already have.

Aliases are the other names a voice assistant knows an entity by. Your partner calls it "the big light", the kids call it "the ceiling": add both, and Assist understands everyone.

How to use it

  1. Open the automation or script that should add the alias, and select Add action.
  2. Search for add an alias to an entity, and select Home Assistant Core Integration: Add an alias to an entity 👻.
  3. Pick one or more entities under Entity.
  4. Under Alias, type the name to add. Add another field for each extra name.
  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 Add an alias to an entity 👻 picked and filled in with an example.
What Try this action opens, filled in with an example.

Remove an alias from an entity

Removes one or more aliases from one or more entities, and keeps the others.

The way back from Add an alias to an entity. A name that keeps triggering the wrong device goes, and the rest stay.

How to use it

  1. Open the automation or script that should remove the alias, and select Add action.
  2. Search for remove an alias from an entity, and select Home Assistant Core Integration: Remove an alias from an entity 👻.
  3. Pick one or more entities under Entity.
  4. Under Alias, type the name to remove. Add another field for each extra name.
  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 Remove an alias from an entity 👻 picked and filled in with an example.
What Try this action opens, filled in with an example.

Set aliases for an entity

Replaces the aliases of one or more entities with the ones you give.

Adding and removing one at a time works until you lose track of what is there. This sets the entity to exactly these names.

How to use it

  1. Open the automation or script that should set the aliases, and select Add action.
  2. Search for aliases for an entity, and select Home Assistant Core Integration: Set aliases for an entity 👻.
  3. Pick one or more entities under Entity.
  4. Under Aliases, type every name the entity should have, one per field. Anything not in the list is removed.
  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 Set aliases for 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.