Garage Door Automation with Shelly 1 and binary sensor

Hi All,

I’m trying to automate my garage door using Shelly 1 and binary sensor. The sensor is off (closed) when the gate is open and on (open) when the gate is closed.
The cover entity is created but is unavailable. Please let me know what am I missing out.

cover:
  - platform: template
    covers:
      garage_door:
        device_class: garage
        friendly_name: "Garage Door"
        value_template: "{{ states('binary_sensor.sensorgarage_contact')|float > 0 }}"
        open_cover:
          - condition: state
            entity_id: binary_sensor.sensorgarage_contact
            state: "on"
          - service: switch.turn_on
            target:
              entity_id: switch.shelly1_485519e306a0
        close_cover:
          - condition: state
            entity_id: binary_sensor.sensorgarage_contact
            state: "off"
          - service: switch.turn_off
            target:
              entity_id: switch.shelly1_485519e306a0
        stop_cover:
          service: switch.turn_on
          target:
            entity_id: switch.shelly1_485519e306a0
        icon_template: >-
          {% if states('binary_sensor.sensorgarage_contact')|float > 0 %}
            mdi:garage-open
          {% else %}
            mdi:garage
          {% endif %}