Input select

The Input select integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] lets you create a dropdown helperA helper is a virtual entity you create inside Home Assistant. It is not backed by a physical device. Helpers store values, track state, or do calculations that your automations and dashboards need. [Learn more]: an entity that stores one value chosen from a list of options you define. Because the value is not tied to a physical device, you can use it as a selectable setting for your automations, scripts, and dashboards. For example, you can create a dropdown helper to pick who cooks today, choose a thermostat mode, or select a house scene.

On a dashboard, a dropdown helper appears as a dropdown menu you can select from. Each time you select a new option, Home Assistant records a new stateThe state holds the information of interest of an entity, for example, if a light is on or off. Each entity has exactly one state and the state only holds one value at a time. However, entities can store attributes related to that state such as brightness, color, or a unit of measurement. [Learn more], which you can use as a trigger or a condition in your automations. Your automations and scripts can also change the selected option, which makes a dropdown helper a convenient way to share a setting between the UI and your automations.

Creating a dropdown helper

  1. Go to Settings > Devices & services > Helpers, and select Create helper.
  2. Select Dropdown.

Input selects can also be configured via configuration.yamlThe 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]:

# Example configuration.yaml entry
input_select:
  who_cooks:
    name: Who cooks today
    options:
      - Paulus
      - Anne Therese
    initial: Anne Therese
    icon: mdi:panda
  living_room_preset:
    options:
      - Visitors
      - Visitors with kids
      - Home Alone

Configuration Variables

input_select map Required

Alias for the input. Multiple entries are allowed.

options list Required

List of options to choose from.

name string (Optional)

Friendly name of the input.

initial map (Optional)

Initial value when Home Assistant starts.

Default:

First element of options

icon icon (Optional)

Icon to display in front of the input element in the frontend.

Note

Because YAML defines booleans as equivalent, any variations of ‘On’, ‘Yes’, ‘Y’, ‘Off’, ‘No’, or ‘N’ (regardless of case) used as option names will be replaced by True and False unless they are defined in quotation marks.

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 before Home Assistant stopping.

Scenes

Specifying a target option in a Scene is simple:

# Example configuration.yaml entry
scene:
  - name: Example1
    entities:
      input_select.who_cooks: Paulus

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.

# Example configuration.yaml entry
scene:
  - name: Example2
    entities:
      input_select.who_cooks:
        options:
          - Alice
          - Bob
          - Paulus
        state: Bob

List of triggers

The Input select integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] provides the following triggers. Each link below opens a dedicated page with examples, fields, and a step-by-step UI walkthrough.

For an overview of every trigger across all integrations, see the triggers reference.

List of conditions

The Input select integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] provides the following conditions. Each link below opens a dedicated page with examples, fields, and a step-by-step UI walkthrough.

For an overview of every condition across all integrations, see the conditions reference.

List of actions

The Input select integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] provides the following actions. Each link below opens a dedicated page with examples, parameters, and a step-by-step UI walkthrough.

For an overview of every action across all integrations, see the actions reference.

Automation examples

The following example shows the usage of the input_select.select_option action in an automation:

# Example configuration.yaml entry
automation:
  - alias: "example automation"
    triggers:
      - trigger: event
        event_type: MY_CUSTOM_EVENT
    actions:
      - action: input_select.select_option
        target:
          entity_id: input_select.who_cooks
        data:
          option: "Paulus"

To dynamically set the input_select options you can call input_select.set_options in an automation:

# Example configuration.yaml entry
automation:
  - alias: "example automation"
    triggers:
      - trigger: event
        event_type: MY_CUSTOM_EVENT
    actions:
      - action: input_select.set_options
        target:
          entity_id: input_select.who_cooks
        data:
          options: ["Item A", "Item B", "Item C"]

Example of input_select being used in a bidirectional manner, both being set by and controlled by an MQTT action in an automation.

# Example configuration.yaml entry using 'input_select' in an action in an automation
   
# Define input_select
input_select:
  thermostat_mode:
    name: Thermostat Mode
    options:
      - "auto"
      - "off"
      - "cool"
      - "heat"
    icon: mdi:target

# Automation.     
 # This automation script runs when a value is received via MQTT on retained topic: thermostatMode
 # It sets the value selector on the GUI. This selector also had its own automation when the value is changed.
- alias: "Set Thermostat Mode Selector"
  triggers:
    - trigger: mqtt
      topic: "thermostatMode"
   # entity_id: input_select.thermostat_mode
  actions:
    - action: input_select.select_option
      target:
        entity_id: input_select.thermostat_mode
      data:
        option: "{{ trigger.payload }}"

 # This automation script runs when the thermostat mode selector is changed.
 # It publishes its value to the same MQTT topic it is also subscribed to.
- alias: "Set Thermostat Mode"
  triggers:
    - trigger: state
      entity_id: input_select.thermostat_mode
  actions:
    - action: mqtt.publish
      data:
        topic: "thermostatMode"
        retain: true
        payload: "{{ states('input_select.thermostat_mode') }}"

Troubleshooting

The Dropdown helper option is missing from the user interface

Symptom

When you go to Settings > Devices & services > Helpers to add a helper, the Dropdown option is not listed.

Description

Dropdown helpers are provided through default_config:, which is part of your configuration.yamlThe 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] by default. If you removed default_config:, the option is no longer available.

Resolution

  1. Add input_select: to your configuration.yamlThe 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].
  2. Restart Home Assistant.
  3. After the restart, create your dropdown helpers from the user interface.