Template cover invert position

I created a template for my awnings.
The opening and closing position is managed by a door contact while the descent and ascent are managed by two scripts.
Is it possible to invert the arrows of the entity so that when it is closed as in the picture, the downward one is active to let the awnings come down?
Senza titolo

cover:
  - platform: template
    covers:
      tenda_sole_cucina:
        friendly_name: "Tenda Sole Cucina"
        position_template: "{{ 0 - is_state('binary_sensor.tenda_sole_cucina_contact', 'on') }}"
        open_cover:
          service: script.tenda_sole_cucina_giu
        close_cover:
          service: script.tenda_sole_cucina_su

What exactly are you trying to do here:

position_template: "{{ 0 - is_state('binary_sensor.tenda_sole_cucina_contact', 'on') }}"

Zero minus true or false?

This will give -1 or 0 as the result. The position template expects a value between 0 and 100.

If you dont have a position, delete that template and replace it with this value template:

value_template: "{{ is_state('binary_sensor.tenda_sole_cucina_contact', 'on') }}"

If it shows the wrong position (open when actually closed) change on to off.

I want that when binary_sensor.tenda_sole_cucina_contact is off the cover is close, ad when in is close position is active the down arrow to bring it down.

Well a good start on the way towards that would be to configure the integration correctly.

I don’t have any integration.
I just need to figure out how to reverse the arrows.

This is the template cover integration configuration you have:

cover:
  - platform: template
    covers:
      tenda_sole_cucina:
        friendly_name: "Tenda Sole Cucina"
        position_template: "{{ 0 - is_state('binary_sensor.tenda_sole_cucina_contact', 'on') }}"
        open_cover:
          service: script.tenda_sole_cucina_giu
        close_cover:
          service: script.tenda_sole_cucina_su

And As I explained above it is not configured correctly. Your position template is invalid. If you are unwilling to fix it then I can’t help you.

I have set value_template: “{{ is_state(‘binary_sensor.tenda_sole_cucina_contact’, ‘on’) }}” and i have this:
Senza titolo
The cover is correctly closed when the contact is off but I want the down arrow to be active in this position to open the curtains and not the up arrow.

Maybe, instead of changing the arrow symbols, you could reverse the name of the awning?
Instead of
“awning closed” = fully rolled up, not blocking the sun,
you could call it
“sunlight blocked” = fully rolled down, sun shaded

What i mean is, find a concept that describes the icons better. The text label which people see does not have to directly represent what the automation is doing …

Great, now change the device class to “awning”.

https://www.home-assistant.io/integrations/cover/#device-class

ok, thank you very much