Cover OPENING and CLOSING states based on binary sensors

I cannot figure out how to do the below, some help would. be appreciated! :slightly_smiling_face:

I have some garage doors and the have physical sensors in both ends, one when they are fully open and one when they are fully closed.
I have created template switches based on these sensors to show the state of the garage doors (open or closed).
I’ve also created custom cover entities in order to pass the garage doors to homekit as covers. Everything works fine but what I am actually missing is the OPENING and CLOSING states. I want to create a cover state when the door starts opening (binary sensor from off to on) and the opposite.

This is what I currently have:

  - platform: template
        device_class: garage
        friendly_name: "Garage Door 1"
        value_template: "{%- if is_state('binary_sensor.garage_1_open', 'off') -%}open {%- elif is_state('binary_sensor.garage_1_closed', 'off') -%} closed {%- else -%}opening{%- endif -%}"
          service: switch.turn_on
          entity_id: switch.garage1
          service: switch.turn_on
          entity_id: switch.garage1
          service: switch.turn_on
          entity_id: switch.garage1
        icon_template: "{% if not is_state('binary_sensor.garage_1_closed', 'on') %}mdi:garage-open{% else %}mdi:garage{% endif %}"

Lol a bit late here… did you figure something out?