Cover template: trying to start a script for "position" that sets a brightness level on a light

Hey,
I am trying to build a simulated cover to play with cover automations. This is what I have got so far, which is working:

cover:
  - platform: template
    covers:
      HAL9000_cover_sim:
        device_class: blind
        friendly_name: "HAL9000_cover_sim"
        open_cover:
          service: script.open_cover
          data:
            modus: 'open'
        close_cover:
          service: script.close_cover
          data:
            modus: 'close'
        stop_cover:
          service: script.stop_cover
          data:
            modus: 'stop'

Pretty much the example from the docs, but the underlying scripts are turning lights on and off, so the simulation works.

Now I try to also simulate the position. The docs tell me to call the script like this:

        set_cover_position:
          service: script.position_cover
          data:
            position: "{{position}}"    

But I am struggeling to get the script to take “position” and translate it to a RGB value. This
grafik
does not work.
Level two would be to multiply the level by 2.55 to use themax brightness range of the lights.

well, I figured it out:
in the cover template:

       set_cover_position:
          service: script.position_cover
          data:
            variables:
              position: "{{position}}"           

in the script:

  - service: light.turn_on
    data:
      brightness: "{{(float(position)*2.55)|int}}"
      rgb_color:
      - 0
      - 255
      - 255
    entity_id: light.mobil_hal9000_ring_seg2,light.mobil_hal9000_ring_seg3