Fan, restore state in script. temp boost ventilation

Hi all,

I have a new shelly (0-10v) so I can program my ventilation. I have some presets in a ventilation. low, mid, high, but you can also set it to a certain percentage.
For now I can use this script to boost temporary from something to high, but I would like the script to restore it to the previous setting.

script:
  plus_0_10v_fan_boost_5min:
    alias: Turn the switch on then off
    sequence:
      - service: fan.set_preset_mode
        target:
          entity_id: fan.plus_0_10v_fan
        data:
          preset_mode: mid
      - delay: "00:05:00"
      - service: fan.set_preset_mode
        target:
          entity_id: fan.plus_0_10v_fan
        data:
          preset_mode: high
    mode: single 

So my usecase steps would be:

  1. is running at 33%, lets call it X
  2. run script, fan goes up by 20% (X+20%)
  3. wait 5 min
  4. the script knows its previous state and restores back to X

Is there any way to (re)store a value of a fan? I am not really eager to save it in an extra entity

Nobody? Sound like a not so advanced feature