Use a service template. Scripts are services.
action:
- service_template:
{% if is_state('input_select.vacuum_room', 'Wohnzimmer') %}
script.vacuum_wohnzimmer
{% elif is_state('input_select.vacuum_room', 'Schlafzimmer') %}
script.vacuum_schlafzimmer
{% elif is_state('input_select.vacuum_room', 'Küche') %}
script.vacuum_kueche
{% elif is_state('input_select.vacuum_room', 'Badezimmer') %}
script.vacuum_badezimmer
{% elif is_state('input_select.vacuum_room', 'Büro') %}
script.vacuum_office
{% elif is_state('input_select.vacuum_room', 'Eingangsbereich') %}
script.vacuum_eingangsbereich
{% elif is_state('input_select.vacuum_room', 'Flur') %}
script.vacuum_flur
{% endif %}
You don’t need an else case if you have all the options of your input select covered by the if/elif statements.
You will have to fix the indentation, there is something wrong with editing it on this iPad.
Also there is no ‘state’ for the input select set option service. It is ‘option’:
- service: input_select.select_option
data:
option: Raum wählen
entity_id: input_select.cleaning_room