Help with templating switch to cover

Hi, I am trying to change my switch to a cover but state reports open, when the switch is indeed off (so, the garage door should report as closed), what am I doing wrong? Thanks.

  - platform: template
    covers:
      garage_door:
        friendly_name: "Garage Door"
        open_cover:
          service: switch.turn_on
          data:
            entity_id: switch.garagem_27
        close_cover:
          service: switch.turn_off
          data:
            entity_id: switch.garagem_27
        stop_cover:
          service: switch.turn_on
          data:
            entity_id: switch.garagem_27
        icon_template: >-
          {% if is_state('switch.garagem_27', 'on') %}
            mdi:garage-open
          {% else %}
            mdi:garage
          {% endif %} 

Screenshot 2020-05-19 at 16.54.42

you dont have a state template. the cover needs feedback to know whether it’s open or closed.
in the garage examples i’ve seen there’s a sensor
if you’re confident that just knowing the state of the switch suffices, then you add something like this:

  covers:
    garage_door:
      friendly_name: "Garage Door"
      value_template: "{{ is_state('switch.garagem_27', 'on') }}"
      open_cover:

Will try tonight. Thanks a lot for your help.