---
title: "Input button"
description: "Spook adds actions to create and delete input button helpers in Home Assistant from your automations and scripts, without a trip to the helper settings."
canonical_url: "https://spook.boo/input-button"
---
# Input button

> Spook adds actions to create and delete input button helpers in Home Assistant from your automations and scripts, without a trip to the helper settings.

The input button helper in Home Assistant is a button to press, from a dashboard or from automations. It has no on or off, only the moment it was last pressed, which makes it a trigger you can put on a dashboard.

Spook adds actions to the input button integration to create and delete these helpers from automations and scripts.

## Actions

Spook adds two actions for input buttons. You find them wherever you add an action, marked with a 👻.

### Create an input button

Creates a new input button helper, the same as adding one on the helpers page.

Some buttons are only needed for a while. A "the guests have left" button during a party, a "done" button for a chore that only exists this week. Made by hand, it stays on the helpers page forever. Made with this action, the script makes it when it is needed, and [deletes it](#delete-an-input-button) when it is done.

**How to use it**

1. Open the automation or script that should make the button, and select **Add action**.
2. Search for **create an input button**, and select **Input button: Create an input button 👻**.
3. Fill in **Name**, like `Doorbell`.
4. Optionally, set **Input button entity ID** to pick the entity ID yourself, and **Icon**.
5. Select **Save**.

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

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

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

**Technical details**

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

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `name` | string | Yes | `Doorbell` |
| `input_button_id` | string | No | `doorbell` |
| `icon` | string | No | `mdi:doorbell` |

Without an `input_button_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 an `input_button_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.

**Example actions in YAML**

Make a doorbell button, and keep its entity ID for the steps after it:

```yaml
action: input_button.create
data:
  name: "Doorbell"
  input_button_id: doorbell
response_variable: created
```

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

### Delete an input button

Deletes one or more input button helpers.

The other half of [Create an input button](#create-an-input-button): the script that made a button cleans it up again. It works on any input button made in the UI as well, disabled ones included.

**How to use it**

1. Open the automation or script that should do the cleaning up, and select **Add action**.
2. Search for **delete an input button**, and select **Input button: Delete an input button 👻**.
3. Under **Entity ID**, choose the input buttons to delete.
4. Select **Save**.

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

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

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

**Technical details**

| Action properties |
| --- |
| Action | Input button: Delete an input button 👻 |
| Action name | `input_button.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=input_button.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=input_button.delete) |

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

**Example actions in YAML**

Remove the doorbell button again:

```yaml
action: input_button.delete
data:
  entity_id: input_button.doorbell
```

**Known limitations**

- Input buttons set up in YAML can only be removed from the YAML. Asking for one is an error.
- Everything in the list is checked first: if one of them cannot be deleted, none of them are.

## Use cases

What people use this for:

- Let a script make the button it needs, and clean it up again afterwards, so the helpers page only has buttons you actually use.


## Sitemap

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