diff --git a/source/_components/input_select.markdown b/source/_components/input_select.markdown index 0f3aeec7ca5..e8cf94f94d1 100644 --- a/source/_components/input_select.markdown +++ b/source/_components/input_select.markdown @@ -37,7 +37,7 @@ Configuration variables: - **[alias]** array (*Required*): Alias for the input. Multiple entries are allowed.. - **name** (*Optional*): Friendly name of the input. - - **options** array (*Required*): List of options to choose from. + - **options** array (*Required*): List of options to choose from. - **initial** (*Optional*): Initial value when Home Assistant starts. - **icon** (*Optional*): Icon for entry. @@ -71,6 +71,22 @@ automation: option: Paulus ``` +To dynamically set the `input_select` options you can call `input_select.set_options`. The following example can be used in an automation rule: + +```yaml +# Example configuration.yaml entry +automation: + - alias: example automation + trigger: + platform: event + event_type: MY_CUSTOM_EVENT + action: + - service: input_select.set_options + data: + entity_id: input_select.who_cooks + options: ["Item A", "Item B", "Item C"] +``` + ### {% linkable_title Scenes %} To specify a target option in a [Scene](/components/scene/) you have to specify the target as `option` attribute: