How to create a binary sensor from a Garage Cover sensor

Hi guys,
I have a Ratgo garage door opener sensor (Cover Sensor) that I want to clone/duplicate as a binary sensor so that I can perform a custom automation.

What this automation does is that it checks for 3 doors, if they are opened then it alerts me via alexas and mobile apps that all the doors are opened. When I say 3 doors, it includes a laundry room door, laundry room to garage and garage door opener.

I am using Aqara door sensors for both the doors but for the garage door it doesn’t have a binary sensor. Instead there is only a cover sensor available and that can’t be included as a binary sensor in the automation.

So, can you guys, please help me in converting or duplicating my Garage Door Opener (Cover sensor) into a binary sensor so that I can include it in my automation and make the automation work.

To get started, I tried the following (placed in the configuration.yaml file) but it shows a configuration error:

  • binary_sensor:
    • name: “Garage Door Status”
      state: >-
      {%- if states(“cover.ratgdov25i_db38dc_door”) == “closed” -%}
      false
      {%- else -%}
      true
      {%- endif -%}

Please let me know if you want me to include any configuration etc.

Thanks in advance!

In configuration.yaml

template:
  - binary_sensor:
      - name: Garage Door Status
        state: "{{ is_state('cover.ratgdov25i_db38dc_door','open') }}"
        device_class: garage_door
1 Like