Custom Garage Door Cover Template won't trigger Close Cover

Hello Everyone,

I recently setup an Aqara T2 Relay to control my garage door locally in conjunction with an Ecolink Z-wave Tilt Sensor and in order to combine both of these devices. I created a Custom Garage Door Opener Template in my Configuration yaml. I have included the yaml below:

- platform: template
        device_class: garage
        friendly_name: "Garage Door"
        value_template: "{{ is_state('binary_sensor.garage_door_sensor_sensor_state_any','on') }}"
          - service: light.toggle
            entity_id: light.garage_door_controller
            service: light.toggle
            entity_id: binary_sensor.garage_door_sensor_sensor_state_any
          service: light.toggle
          entity_id: light.garage_door_controller
        icon_template: >-
          {% if states('binary_sensor.garage_door_sensor_sensor_state_any')=="on" %}
          {% else %}
          {% endif %}

Everything works great with this template, the status updates correctly, stop and open works with no issue. But for some strange reason the Close cover doesn’t work, if I call the light.toggle service from the developer options it closes my garage door but if I do it through the interface its doesn’t work. If I use the stop cover option which is the other option available through the UI it closes my garage door but this defeats the purpose since I want to use the Close Cover option through the UI. Not sure what else to try. Any assistance that can be provided would be greatly appreciated.

Thanks in advance

Have you light light.turn_off instead of toggle? The toggle might bite you at some point if the template ever gets out of sync with the actual state of the device.

Aside from that, you shouldn’t be able to toggle a sensor no matter what, shouldn’t that be a light you are controlling?

            service: light.toggle
            entity_id: binary_sensor.garage_door_sensor_sensor_state_any

Hi CO_4X4, It seems I just needed another set of eyes to take a look at it. Like you mentioned I was trying to control the Garage Tilt sensor instead of the Aqara relay to Close the garage door. No wonder it didn’t work. Thanks for your help and taking the time to look at my issue.

1 Like