---
title: "Input select"
description: "Spook adds actions to create, change and delete input select helpers, add and remove options that stay, pick a random option, and shuffle, sort or reverse the list of options."
canonical_url: "https://spook.boo/input-select"
---
# Input select

> Spook adds actions to create, change and delete input select helpers, add and remove options that stay, pick a random option, and shuffle, sort or reverse the list of options.

The input select helper in Home Assistant holds a list of options to choose from, shown as a dropdown or a row of buttons, and usable in the conditions and triggers of an automation.

Spook adds actions to the input select integration to create, change and delete these helpers, add and remove options that stay through a restart, pick a random option, and shuffle, sort or reverse the list of options.

![The Add action dialog, searched for options, with the actions Spook adds marked with a ghost.](https://spook.boo/images/screenshots/en/light/actions-search-input-select.webp)

Spook adds a bunch of new actions to the input select helper integration.

## Actions

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

### Create an input select

Creates a new input select (dropdown) helper, the same as adding one on the helpers page.

Some choices only matter for a while. Tonight's movie genre, who brings what to the barbecue, the playlist for a party. 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-select) when it is done.

Only administrators can run this action by hand or through a script they start themselves. Automations can run it directly or through a script.

**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 select**, and select **Input select: Create an input select 👻**.
3. Fill in **Name**, like `Movie night`, and the **Options** to choose from.
4. Optionally, set **Input select entity ID** to pick the entity ID yourself, **Initial option**, 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_select.create) opens it in your Home Assistant, ready to run once.

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

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

**Technical details**

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

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `name` | string | Yes | `Movie night` |
| `input_select_id` | string | No | `movie_night` |
| `options` | list of strings | Yes | `["Comedy", "Horror", "Drama"]` |
| `initial` | string | No | `Horror` |
| `icon` | string | No | `mdi:movie-open` |

The options need at least one entry, and each option can only be in it once. An initial option has to be one of the options. One that is not is refused.

Without an `input_select_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_select_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**

A movie night dropdown, starting on horror, and its entity ID kept for the steps after it:

```yaml
action: input_select.create
data:
  name: "Movie night"
  input_select_id: movie_night
  options:
    - Comedy
    - Horror
    - Drama
  initial: Horror
response_variable: created
```

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

### Delete an input select

Deletes one or more input select helpers.

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

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

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

**Technical details**

| Action properties |
| --- |
| Action | Input select: Delete an input select 👻 |
| Action name | `input_select.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_select.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_select.delete) |

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

**Example actions in YAML**

Remove the movie night dropdown again:

```yaml
action: input_select.delete
data:
  entity_id: input_select.movie_night
```

**Known limitations**

- Input selects 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.
- Only administrators can run this by hand or through a script they start themselves. Automations can run it directly or through a script.

### Update an input select

Changes the settings of input selects made in the UI, the same as editing them on the helpers page. The change stays, through a reload and a restart.

Home Assistant has `input_select.set_options`, but what it sets is gone after a reload or a restart. This changes the input select as it is stored: a new name, a new icon, or a whole new list of options that stays. To add or remove a few options and keep the rest, [Add options](#add-options) and [Remove options](#remove-options) are made for that.

**How to use it**

1. Open the automation or script that should change the input select, and select **Add action**.
2. Search for **update an input select**, and select **Input select: Update an input select 👻**.
3. Under **Targets**, choose the input select.
4. Fill in what should change: **Name**, **Options**, **Initial option** or **Icon**. What you leave out stays as it is.
5. Select **Save**.

Just want to see it work? [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=input_select.update) opens it in your Home Assistant, ready to run once. Mind you: running it changes the input select for real.

**Technical details**

| Action properties |
| --- |
| Action | Input select: Update an input select 👻 |
| Action name | `input_select.update` |
| Action targets | Yes, `input_select` entities |
| 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_select.update) [![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_select.update) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `name` | string | No | `Room` |
| `options` | list of strings | No | `["Living room", "Kitchen"]` |
| `initial` | string | No | `Kitchen` |
| `icon` | string | No | `mdi:sofa` |

Give at least one field. What is given goes on top of what the input select has, and what is left out keeps what it has. The change is stored, the same as editing the input select on the helpers page, so it survives a reload and a restart. A new name changes the name, never the entity ID.

Home Assistant checks the input select as a whole, the way it does in the settings dialog. Each option can be in it once, and the initial option has to be one of the options. A change it refuses is refused with an error, and nothing changes. With more than one input select, each gets the change on top of its own settings, and all of them are checked before the first one changes: one that is refused stops the others too. An input select that already has these settings is left alone.

`options` replaces every option, in the order given. When the option the input select is at is not among them, it moves to the first of the new options right away, the same as `input_select.set_options` does.

**Example actions in YAML**

A new name and icon for the room picker:

```yaml
action: input_select.update
target:
  entity_id: input_select.room
data:
  name: "Where am I"
  icon: mdi:map-marker
```

**Known limitations**

- Only input selects made in the UI or with [Create an input select](#create-an-input-select) can be changed. One set up in YAML is refused: only the YAML can change it.
- `null` takes the icon or the initial option away. New options without the initial option take it away too, unless the same call sets a new one. The name and the options cannot be emptied: an input select always has them.
- The entity ID stays what it is. To change it too, use [Entity: Update ID](https://spook.boo/actions#entity-update-id).
- Only administrators can run this by hand or through a script they start themselves. Automations can run it directly or through a script.

### Add options

Adds options to input selects made in the UI, at the end, and they stay.

A guest arrives, and the room picker needs a guest room. `input_select.set_options` can do that, but only until the next reload or restart, and it needs every option, not only the new one. This adds the new one, and the input select keeps it. An option it has already stays where it is, so running it twice is harmless.

**How to use it**

1. Open the automation or script that should add the options, and select **Add action**.
2. Search for **add options**, and select **Input select: Add options 👻**.
3. Under **Targets**, choose the input select.
4. Fill in the **Options** to add, in the order they should come.
5. Select **Save**.

Just want to see it work? [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=input_select.add_options) opens it in your Home Assistant, ready to run once. Mind you: running it changes the input select for real.

**Technical details**

| Action properties |
| --- |
| Action | Input select: Add options 👻 |
| Action name | `input_select.add_options` |
| Action targets | Yes, `input_select` entities |
| 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_select.add_options) [![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_select.add_options) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `options` | string \| list of strings | Yes | `Guest room` |

The new options go at the end, in the order given. An option the input select has already is left where it is, and is not added twice. Options are compared exactly, the way Home Assistant compares the option you select: `guest room` is not `Guest room`. The change is stored, the same as editing the input select on the helpers page, so it survives a reload and a restart.

With more than one input select, each gets the options it does not have yet. All of them are checked before the first one changes: one that is refused stops the others too. An input select that has every option already is left alone.

**Example actions in YAML**

A guest arrives, so the room picker gets a guest room:

```yaml
action: input_select.add_options
target:
  entity_id: input_select.room
data:
  options:
    - Guest room
```

**Known limitations**

- Only input selects made in the UI or with [Create an input select](#create-an-input-select) can be changed. One set up in YAML is refused: only the YAML can change it.
- New options always go at the end. [Sort options](#sort-options) sorts them, until the next reload or restart.
- Only administrators can run this by hand or through a script they start themselves. Automations can run it directly or through a script.

### Remove options

Removes options from input selects made in the UI, and they stay removed.

The guest has left, and the guest room can go from the room picker again. This removes it, and the input select keeps it that way. An option that is not there is skipped, so running it twice is harmless.

**How to use it**

1. Open the automation or script that should remove the options, and select **Add action**.
2. Search for **remove options**, and select **Input select: Remove options 👻**.
3. Under **Targets**, choose the input select.
4. Fill in the **Options** to remove.
5. Select **Save**.

Just want to see it work? [Try this action](https://my.home-assistant.io/redirect/developer_call_service/?service=input_select.remove_options) opens it in your Home Assistant, ready to run once. Mind you: running it changes the input select for real.

**Technical details**

| Action properties |
| --- |
| Action | Input select: Remove options 👻 |
| Action name | `input_select.remove_options` |
| Action targets | Yes, `input_select` entities |
| 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_select.remove_options) [![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_select.remove_options) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `options` | string \| list of strings | Yes | `Guest room` |

The other options stay, in their order. An option the input select does not have is skipped. Options are compared exactly, the way Home Assistant compares the option you select: `guest room` is not `Guest room`. The change is stored, the same as editing the input select on the helpers page, so it survives a reload and a restart.

An input select needs one option at least: removing every option it has is refused, and nothing changes. When the option it starts at after a restart is removed, it no longer starts at a set option: it picks up where it was, or at the first option.

When the option the input select is at is removed, it moves to the first option that remains right away, the same as `input_select.set_options` does.

With more than one input select, all of them are checked before the first one changes: one that would be left without options stops the others too.

**Example actions in YAML**

The guest has left, so the guest room goes. A room picker that was at the guest room moves to the first room:

```yaml
action: input_select.remove_options
target:
  entity_id: input_select.room
data:
  options:
    - Guest room
```

**Known limitations**

- Only input selects made in the UI or with [Create an input select](#create-an-input-select) can be changed. One set up in YAML is refused: only the YAML can change it.
- An input select keeps one option at least.
- Only administrators can run this by hand or through a script they start themselves. Automations can run it directly or through a script.

### Select random option

Selects a random option of an input select.

Who cooks tonight, who takes out the bins, which scene the living room gets. Leave it to chance, and nobody can complain about the automation playing favorites. You can also limit the draw to a few of the options.

**How to use it**

1. Open the automation or script that should pick, and select **Add action**.
2. Search for **select random option**, and select **Input select: Select random option 👻**.
3. Under **Targets**, choose the input select.
4. Optionally, fill in **Options** to pick from only those. Leave it empty to pick from all of them.
5. Select **Save**.

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

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

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

**Technical details**

| Action properties |
| --- |
| Action | Input select: Select random option 👻 |
| Action name | `input_select.random` |
| Action targets | Yes, `input_select` entities |
| 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_select.random) [![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_select.random) |

| Action data parameters |
| --- |
| Attribute | Type | Required | Default / Example |
| `options` | list of strings | No | Defaults to all available options |

The `options` attribute is a list of strings: the options to pick a random one from. Leave it out, and all options of the input select are used.

**Example actions in YAML**

Pick who cooks tonight, from everyone in the list:

```yaml
action: input_select.random
target:
  entity_id: input_select.who_is_cooking_tonight
```

Pick a color, but only one of these three:

```yaml
action: input_select.random
target:
  entity_id: input_select.color
data:
  options:
    - red
    - green
    - blue
```

**Known limitations**

- The options you give have to be options of the input select. When the one picked is not, the action fails with an error.

### Reverse options

Reverses the order of the options of an input select, back to front, and keeps the current option selected.

This is not a sort: the options keep the order they were in, turned around. A list that grows at the end, like a play history, then has its newest entry at the top. It does not last: a reload of input selects, or a restart of Home Assistant, puts the order back.

**How to use it**

1. Open the automation or script that should do this, and select **Add action**.
2. Search for **reverse options**, and select **Input select: Reverse options 👻**.
3. Under **Targets**, choose the input select.
4. Select **Save**.

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

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

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

**Technical details**

| Action properties |
| --- |
| Action | Input select: Reverse options 👻 |
| Action name | `input_select.reverse` |
| Action targets | Yes, `input_select` entities |
| 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_select.reverse) [![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_select.reverse) |

**Example actions in YAML**

Newest at the top:

```yaml
action: input_select.reverse
target:
  entity_id: input_select.play_history
```

**Known limitations**

- Reversing does not last. A reload or a restart of Home Assistant undoes it.

### Shuffle options

Shuffles the options of an input select into a random order, and keeps the current option selected.

Handy for a rota that should not always start with the same person, or a sequence of scenes that should play in a different order every night. It does not last: a reload of input selects, or a restart of Home Assistant, puts the order back.

**How to use it**

1. Open the automation or script that should do this, and select **Add action**.
2. Search for **shuffle options**, and select **Input select: Shuffle options 👻**.
3. Under **Targets**, choose the input select.
4. Select **Save**.

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

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

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

**Technical details**

| Action properties |
| --- |
| Action | Input select: Shuffle options 👻 |
| Action name | `input_select.shuffle` |
| Action targets | Yes, `input_select` entities |
| 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_select.shuffle) [![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_select.shuffle) |

**Example actions in YAML**

Mix up the cooking rota:

```yaml
action: input_select.shuffle
target:
  entity_id: input_select.who_is_cooking_tonight
```

**Known limitations**

- Shuffling does not last. A reload or a restart of Home Assistant undoes it.

### Sort options

Sorts the options of an input select, and keeps the current option selected.

Home Assistant has no way to reorder the options of an input select once it is made. This at least puts them in alphabetical order. It does not last: a reload of input selects, or a restart of Home Assistant, puts the order back.

**How to use it**

1. Open the automation or script that should do this, and select **Add action**.
2. Search for **sort options**, and select **Input select: Sort options 👻**.
3. Under **Targets**, choose the input select.
4. Select **Save**.

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

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

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

**Technical details**

| Action properties |
| --- |
| Action | Input select: Sort options 👻 |
| Action name | `input_select.sort` |
| Action targets | Yes, `input_select` entities |
| 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_select.sort) [![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_select.sort) |

**Example actions in YAML**

Put the cooking rota in alphabetical order:

```yaml
action: input_select.sort
target:
  entity_id: input_select.who_is_cooking_tonight
```

**Known limitations**

- Sorting does not last. A reload or a restart of Home Assistant undoes it.
- Upper case sorts before lower case, so `Zebra` comes before `apple`.

## Use cases

What people use this for:

- Shuffle and random are fun in automations. For example, pick a random person to cook dinner or do chores, or shuffle a sequence of scenes to play.
- An input select does not let you reorder its options. Sorting at least puts them in alphabetical order.
- Let a script make the choice it needs, and clean it up again afterwards, so the helpers page only has input selects you actually use.
- Add a guest room to the room picker when a guest arrives, and remove it again when they leave. Unlike `input_select.set_options`, it stays through a restart.


## Sitemap

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