Garage Door Opener With Sensor

Hi!

I am able to open and close my garage door with the shelly device and I would like to couple it with a Z-wave door sensor to detect the state of the garage door.

I’ve comb through the forums and it has been suggested I look into cover templates. I however cannot get it to toggle the garage with the cover template. Any suggestions?

Here is the code in my configuration.yaml:

cover:
  - platform: template
    covers:
      garage_door:
        friendly_name: "Garage Door"
        value_template: "{{ is_states('binary_sensor.garage_door_sensor', 'on') }}"
        open_cover:
          service: switch.toggle
          data:
            entity_id: switch.shelly1_e8db84d72d28
        close_cover:
          service: switch.toggle
          data:
            entity_id: switch.shelly1_e8db84d72d28
        icon_template: >-
          {% if is_states('binary_sensor.garage_door_sensor', 'on') %}
            mdi:garage-open
          {% else %}
            mdi:garage
          {% endif %}

Thanks!

Side note to this but have you seen that you can use the Shelly to report the state of the door as well? Using a reed sensor into the switch input you can detect a single state of the door, either open or closed depending on sensor placement.

If that is of interest let me know and I’ll try and find the write up about it.

@Kranzy. Unfortunately my garage door is pretty tight. I spent some time wiring it up but the cleanest solution was to use an external Z-wave tilt sensor mounted on the door itself.