Integrations

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

Delete an input select

Deletes one or more input select helpers.

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

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 and 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 opens it in your Home Assistant, ready to run once. Mind you: running it changes the input select for real.

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 opens it in your Home Assistant, ready to run once. Mind you: running it changes the input select for real.

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 opens it in your Home Assistant, ready to run once. Mind you: running it changes the input select for real.

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

The Actions tool with Select random option 👻 picked and filled in with an example.
What Try this action opens, filled in with an example.

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

The Actions tool with Reverse options 👻 picked and filled in with an example.
What Try this action opens, filled in with an example.

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

The Actions tool with Shuffle options 👻 picked and filled in with an example.
What Try this action opens, filled in with an example.

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

The Actions tool with Sort options 👻 picked and filled in with an example.
What Try this action opens, filled in with an example.

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.

Missing something here?

An action, an entity or a repair this integration should have? Say so. Stuck, or found a bug? There is help.