Use input_select to call service / set vacuum fan speed

Hej everyone.
I am already googling some time, going through different threads & how-tos, but maybe I am lacking some knowledge or I am simply not finding the correct help.

Roborock S8 with custom integration

Bubble Card template - Selector

I am trying to create a simple drop down list for my vacuum fan speed - similar to what I already have for the mop intensity. For that it was easy since it has a select entity by default.

Now I found the function to create an input_select entity, but I do not know how to map the selections to a service call like “vacuum.set_fan_speed” = “max”.

Furthermore I do not even know if that is the best or easiest way to achieve that.

Therefore I would appreciate any help, like exisiting forum topics/post or direct help on my example.

Action is defined here: https://www.home-assistant.io/integrations/vacuum/#action-vacuumset_fan_speed

Assuming your input select options are the values the action takes then this automation will set the speed when the input_select changes:

triggers:
  - trigger:
      - platform: state
        entity_id: input_select.vacuum_fan_speed
        not_to:
          - unknown
          - unavailable
actions:
  - action: vacuum.set_fan_speed 
    target:
      entity_id: vacuum.your_vacuum
    data:  
      fan_speed: "{{ states('input_select.vacuum_fan_speed') }}"

Thanks @tom_l .
According to your answer I need to create an automation for that which is checking in the background if the input_select changes and depending on the value it will trigger the change of the fan_speed?!
So I need to create a input_select entity + automation, right?!

Yes and the input select options must match the available fan speeds exactly.

thanks for your support. I slightly adapted it while using Node Red