Input select
The Input select integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] allows the user to define a list of values that can be selected via the frontend and can be used within conditions of an automation. When a user selects a new item, a state transition event is generated. This state event can be used in an automation
trigger.
The preferred way to configure an input select is via the user interface at Settings > Devices & services > Helpers. Click the add button and then choose the Dropdown option.
To be able to add Helpers via the user interface you should have default_config:
in your configuration.yaml
The configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more], it should already be there by default unless you removed it.
If you removed default_config:
from you configuration, you must add input_select:
to your configuration.yaml
first, then you can use the UI.
Input selects can also be configured via configuration.yaml
The configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more]:
Configuration Variables
Alias for the input. Multiple entries are allowed.
Icon to display in front of the input element in the frontend.
Because YAML defines booleans
Restore state
If you set a valid value for initial
this integration will start with the state set to that value. Otherwise, it will restore the state it had prior to Home Assistant stopping.
Actions
This integration provides three actions to modify the state of the input_select
.
Action | Data | Description |
---|---|---|
select_option |
option |
This can be used to select a specific option. |
set_options |
options entity_id(s)
|
Set the options for specific input_select entities. |
select_first |
Select the first option. | |
select_last |
Select the last option. | |
reload |
Reload input_select configuration |
Action input_select.select_next
Select the next option.
Data attribute | Optional | Description |
---|---|---|
cycle |
yes | Whether to cycle to the first value after the last. Default: true
|
Action input_select.select_previous
Select the previous option.
Data attribute | Optional | Description |
---|---|---|
cycle |
yes | Whether to cycle to the last value before the first. Default: true
|
Scenes
Specifying a target option in a Scene is simple:
The list of options can also be set in a Scene. In that case, you also need to specify what the new state will be.
Automation examples
The following example shows the usage of the input_select.select_option
action in an automation:
To dynamically set the input_select
options you can call input_select.set_options
in an automation:
Example of input_select
being used in a bidirectional manner, both being set by and controlled by an MQTT action in an automation.