Simple way to change the value of a number relatively rather than to an absolute

Hi
here is another beginner’s question and let me admit straight away: the simpleness and usefulness of what I am looking for makes me suspect I am just not looking in the right places. So this is probably just a question of pointing the newbie into the right direction.
Rather than setting the value of an entity to a specific number I want to change the value of an entity by an amount.
Here is the use case: whenever sensor.solax_grid_import approaches the contracted limit of say 4.2KW while the inverter charges the battery from the grid I want to decrease number.solax_battery_charge_max_current by 1A and repeat until I get back into a safe range before tripping the mains. And go back up when there is enough buffer. The number function accepts any absolute value from 0-30A but no relative ones.
I have found the template in the dev tools or thought about creating a helper, but it seems rather longwinded.
Thanks in advance for enlightening me.
Alex

Since that’s a number there’s only the number.set_value action: https://www.home-assistant.io/integrations/number#actions

That means that templates are the only way to do this.

actions:
  - action: number.set_value
    data:
      entity_id: number.whale_height
      value: >-
        {{ states('number.whale_height')|float(0) - 1 }}

That’s the way it will be then. Thanks a lot!