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

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

The input text helper in Home Assistant holds a piece of text that can be changed from a dashboard or from automations, optionally kept to a length or a pattern, or hidden like a password.

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

## Actions

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

### Create an input text

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

Some text only matters for a while. The last message a script sent, the name of the guest staying this weekend, a note for whoever comes home first. Made by hand, that helper stays on the helpers page long after. Made with this action, the script makes it when it needs it, and [deletes it](#delete-an-input-text) when it is done.

**How to use it**

1. Open the automation or script that should make the helper, and select **Add action**.
2. Search for **create an input text**, and select **Input text: Create an input text 👻**.
3. Fill in **Name**, like `Last message`.
4. Optionally, set **Input text entity ID** to pick the entity ID yourself, and any of **Initial value**, **Minimum length**, **Maximum length**, **Pattern**, **Mode**, **Icon** and **Unit of measurement**.
5. Select **Save**.

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

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

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

**Technical details**

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

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `name` | string | Yes | `Last message` |
| `input_text_id` | string | No | `last_message` |
| `initial` | string | No | `Hello` |
| `min` | integer | No | `0` |
| `max` | integer | No | `100` |
| `pattern` | string | No | `[a-z ]*` |
| `mode` | string | No | `text` |
| `icon` | string | No | `mdi:message-text` |
| `unit_of_measurement` | string | No | `words` |

The minimum length cannot be above the maximum, and an initial value has to fit between them. A call that does not is refused.

Without an `input_text_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_text_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 text helper for the last message, up to 255 characters, and keep its entity ID for the steps after it:

```yaml
action: input_text.create
data:
  name: "Last message"
  input_text_id: last_message
  max: 255
response_variable: created
```

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

### Delete an input text

Deletes one or more input text helpers.

The other half of [Create an input text](#create-an-input-text): the script that made a helper cleans it up again. It works on any input text 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 text**, and select **Input text: Delete an input text 👻**.
3. Under **Entity ID**, choose the input texts 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_text.delete) opens it in your Home Assistant, ready to run once. Mind that it really deletes.

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

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

**Technical details**

| Action properties |
| --- |
| Action | Input text: Delete an input text 👻 |
| Action name | `input_text.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_text.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_text.delete) |

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

**Example actions in YAML**

Remove the last message helper again:

```yaml
action: input_text.delete
data:
  entity_id: input_text.last_message
```

**Known limitations**

- Input texts 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 text helper it needs, and clean it up again afterwards, so the helpers page only has input texts you actually use.


## Sitemap

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