I have a select template where the options (One, Two, Three) and state (Two) are set by a trigger (a button press).
The first time I press the button the select’s state is updated, but the select UI doesn’t show the current state.
Notice that the button was pressed and the current state is ‘Two’, but the select doesn’t show that state.
Now, once a selection is made in the drop-down, say ‘Three’, then pressing the button will update the UI to show ‘Two’.
Is there a trick to get that select UI to update when first triggered?
Here are the entities:
template:
- button:
- name: Trigger Select
press:
- event: update_my_select
event_data:
options: "{{ ['One', 'Two','Three'] }}"
state: "{{ 'Two' }}"
- triggers:
- trigger: event
event_type: update_my_select
select:
- name: My Select
options: "{{ trigger.event.data.options }}"
state: "{{ trigger.event.data.state }}"
optimistic: true
select_option:
- action: system_log.write
data:
message: Select option '{{ option }}'
actions:
- action: system_log.write
data:
message: Triggered
- sensor:
- name: Current Select State
state: "{{ states('select.my_select') }}"
