Cover template for inverting the behavior of a existing cover

I am trying to invert a cover named “cover.markise” with this template cover:

- platform: template
  covers:
    markise_invertiert:
      friendly_name: Markise
      position_template: "{{ 100 - (state_attr('cover.markise', 'current_position') | int) }}"
      open_cover:
        service: cover.close_cover
        data:
          entity_id: cover.markise
      close_cover:
        service: cover.open_cover
        data:
          entity_id: cover.markise
      stop_cover:
        service: cover.stop_cover
        data:
          entity_id: cover.markise

opening and closing is working as expected, but I cannot set directly a position of the inverted cover, its just not possible to click on the position slider in the ui. any hints how to solve this?

Hello @nicx do you have solved the problem ? :slight_smile:
Thanks, Simon

hi @xefil , I ended up in flipping the wires to the physical button, so I do not need the template anymore.

Thanks @nicx for sharing your solution. I was able to resolve it via cover.
Cheers, Simon

Hello team, in 2025 template posted here need some changes, i stay my template here, maybe it will helpful for anybody who has the same problem:

cover:
  - platform: template
    covers:
      cover_reversed:
        friendly_name: "Cover Reversed"
        position_template: "{{ 100 - state_attr('cover.detskaia_shtora_pravaia_curtain', 'current_position') | int(100) }}"
        open_cover:
          action: cover.close_cover
          data: {}
          target: 
            entity_id: cover.detskaia_shtora_pravaia_curtain
        close_cover:
          action: cover.open_cover
          data: {}
          target: 
            entity_id: cover.detskaia_shtora_pravaia_curtain
        stop_cover:
          action: cover.stop_cover
          data: {} 
          target:  
            entity_id: cover.detskaia_shtora_pravaia_curtain
        set_cover_position:
          action: cover.set_cover_position
          data:
            position: "{{100-position}}"
            entity_id: cover.detskaia_shtora_pravaia_curtain
        icon_template: >-
          {% if is_state('cover.detskaia_shtora_pravaia_curtain', 'closed') %}
            mdi:blinds-open
          {% else %}
            mdi:blinds
          {% endif %}