Update: See this post below for a simpler example.
The problem is I’m updating an input_select and it does’t always update in the UI. Sorry, this is a bit obscure, but maybe someone has seen this.
Summary
I have cascading input_selects. That is, when you make a selection on the first, or primary, input_select that triggers an automation to populate the secondary input_select’s options. e.g. Select a country and then the next select populates cities in that country.
That works fine. The problem is when Home Assistant restarts it doesn’t restore the input_select state1. So, I have to find a work-around.
So, what I do is save the current input_selects’ states into two input_text entities for restoring later.
Then I can save the current selects:
When I press that bottom button it calls input_select.reload to emulate a HA restart, and then I populate the options and finally update the input_selects’ state from the saved input_text entities.
The UI issue
But often what happens is the UI will then show this where one (or the other) doesn’t show the actual current state – but I know the state is set.
It varies which select doesn’t update in the UI.
The input_selects do get their state updated, though. Refreshing or changing tabs will update the UI. Same behavior in Chrome and Safari.
I also log to confirm the input_selects are the expected value.
2025-11-05 15:35:16.114 ERROR (MainThread) [homeassistant.components.system_log.external] Emulating a restart by reloading input_selects. (4s delay)
2025-11-05 15:35:20.774 ERROR (MainThread) [homeassistant.components.system_log.external] >>> Secondary options set to: Nothing
2025-11-05 15:35:22.024 ERROR (MainThread) [homeassistant.components.system_log.external] >>> Primary Options set to: Nothing, Metals, Weather, Food
2025-11-05 15:35:22.050 ERROR (MainThread) [homeassistant.components.system_log.external] >>> Secondary options set to: Nothing, Sunny, Rain, Fog, Clouds
2025-11-05 15:35:22.081 ERROR (MainThread) [homeassistant.components.system_log.external] Set primary: saved='Weather', select='Weather'.
2025-11-05 15:35:22.083 ERROR (MainThread) [homeassistant.components.system_log.external] Set secondary: saved='Rain', select=='Rain'
Any idea why it fails to render – or if there’s a trick I could use to get it to update?
If really curious, here’s the package I’m using to run all of this:
input_select.yaml
input_select:
# Define the two caascaded selects
example_select_primary:
options:
- Nothing
example_select_secondary:
options:
- Nothing
input_text:
# To save the current state of the selects
# to restore after a HA restart
example_select_last_primary_value:
example_select_last_secondary_value:
input_button:
# Button to initaily load the priamry selects
example_select_load_primary_selects:
# Button to store the current input_select values
example_select_remember_values:
# Button to reload input_select
example_select_reload_all:
timer:
example_select_ha_restarted:
duration: 2
script:
example_select_script:
mode: queued
fields:
action:
selector:
text: null
name: action
required: true
sequence:
- variables:
default_option: Nothing
option_lookup:
Metals:
- Gold
- Silver
- Tin
Weather:
- Sunny
- Rain
- Fog
- Clouds
Food:
- Pasta
- Tacos
- Stir Fry
- choose:
- alias: "*** Set the primary select options (at startup) ***"
conditions:
- condition: template
value_template: "{{ action == 'set_primary_options' }}"
sequence:
- action: input_select.set_options
target:
entity_id: input_select.example_select_primary
data:
options: "{{ [default_option] + option_lookup.keys()|list }}"
- action: system_log.write
data:
message: >-
>>> Primary Options set to: {{
state_attr('input_select.example_select_primary', 'options'
)|join(', ') }}
- alias: "*** Set the secondary options whenever the primary changes. ***"
conditions:
- condition: template
value_template: "{{ action == 'set_secondary_options' }}"
sequence:
- alias: To avoid HA WARNING about selecting an invalid option
action: input_select.select_option
target:
entity_id: input_select.example_select_secondary
data:
option: "{{ default_option }}"
- action: input_select.set_options
target:
entity_id: input_select.example_select_secondary
data:
options: >-
{% set primary_select =
states('input_select.example_select_primary') %} {{
[default_option] +
(option_lookup[primary_select] if primary_select in option_lookup else [])
}}
- action: system_log.write
data:
message: >-
>>> Secondary options set to: {{
state_attr('input_select.example_select_secondary', 'options'
)|join(', ') }}
default:
- action: system_log.write
data:
message: "{{ this.entity_id }} called with invalid 'action' = '{{ action }}'"
automation:
- id: example_select_updates_id
alias: Example Select Updates
mode: queued
triggers:
- id: set_primary_options
trigger: state
entity_id: input_button.example_select_load_primary_selects
- id: set_secondary_options
trigger: state
entity_id: input_select.example_select_primary
actions:
- action: script.example_select_script
data:
action: "{{ trigger.id }}"
description: |-
# Here's two cards to use
- type: sections
max_columns: 4
title: Test Selects
path: test-selects
sections:
- type: grid
cards:
- type: entities
entities:
- entity: input_button.example_select_load_primary_selects
name: Load Primary Selects
- entity: input_select.example_select_primary
- entity: input_select.example_select_secondary
- type: grid
cards:
- type: entities
entities:
- entity: input_button.example_select_remember_values
- entity: input_text.example_select_last_primary_value
- entity: input_text.example_select_last_secondary_value
- entity: input_button.example_select_reload_all
name: input_select.reload (all)
- id: example_select_reloading_id
alias: Example Select Reloading
mode: queued
triggers:
- id: remember_selects
trigger: state
entity_id: input_button.example_select_remember_values
- id: ha_restarted
trigger: homeassistant
event: start
- id: emulate_ha_restarted
trigger: state
entity_id: input_button.example_select_reload_all
- id: reload_all_selects
trigger: event
event_type: timer.finished
event_data:
entity_id: timer.example_select_ha_restarted
actions:
- choose:
## Save the current select states to input_text to survice a HA restart ##
- conditions:
- condition: trigger
id: remember_selects
sequence:
- action: input_text.set_value
target:
entity_id: input_text.example_select_last_primary_value
data:
value: "{{ states('input_select.example_select_primary') }}"
- action: input_text.set_value
target:
entity_id: input_text.example_select_last_secondary_value
data:
value: "{{ states('input_select.example_select_secondary') }}"
## When HA restart set a short timer to fire script again ##
- conditions:
- condition: trigger
id: ha_restarted
sequence:
- action: timer.start
target:
entity_id: timer.example_select_ha_restarted
data:
duration: 2
## Same as above but loadings all the input_selects ##
- conditions:
- condition: trigger
id: emulate_ha_restarted
sequence:
- action: system_log.write
data:
message: Emulating a restart by reloading input_selects. (4s delay)
- delay: 4
- action: input_select.reload
- action: timer.start
target:
entity_id: timer.example_select_ha_restarted
data:
duration: 2
## This disables the above automation and manually restores the selects ##
- conditions:
- condition: trigger
id: reload_all_selects
sequence:
# First, disable the automation so updating the selects do not trigger the automation #
- action: automation.turn_off
target:
entity_id: automation.example_select_updates
# Then we call the script to populate the primary select's options
- action: script.example_select_script
data:
action: set_primary_options
# Once the primary options have been set, now select the saved option
- action: input_select.select_option
target:
entity_id: input_select.example_select_primary
data:
option: "{{ states('input_text.example_select_last_primary_value') }}"
# Do the same for the secondary input_select #
- action: script.example_select_script
data:
action: set_secondary_options
- action: input_select.select_option
target:
entity_id: input_select.example_select_secondary
data:
option: "{{ states('input_text.example_select_last_secondary_value') }}"
# Finally, re-enable the automation #
- action: automation.turn_on
target:
entity_id: automation.example_select_updates
# LAST, let's show whhat we did:
- action: system_log.write
data:
message: >-
Set primary:
saved='{{ states('input_text.example_select_last_primary_value') }}',
select='{{ states('input_select.example_select_primary') }}'.
- action: system_log.write
data:
message: >-
Set secondary:
saved='{{ states('input_text.example_select_last_secondary_value') }}',
select=='{{ states('input_select.example_select_secondary') }}'
default:
- action: system_log.write
data:
message: >-
{{ this.entity_id }} called with invalid trigger = '{{ trigger.id
}}'
Input Select Trouble
1 Note that the docs do say that the input_select is restored on restart, which is not quit true. HA will first restore the default options, and if the current state isn’t one of those default options it will then pick the first option.
There’s no warning in the logs about the (now) invalid option, or that it was changed. And there’s no state change event, either.
There’s the input_select.set_options action, so maybe there needs to be a restore_options flag (similar to the restore flag on timers) to load the options from `.storage/core.entity_registry’.
My versions.
- Installation methodHome Assistant OS
- Core 2025.10.3
- Supervisor 2025.11.1
- Operating System 16.2
- Frontend 20251001.4





