Shelly2.5 Garagedoor opener with 4 states on a Hörmann ProMatic2

This is my Shelly2.5 garagedoor opener with four states in a custom button-card attached on a Hörmann Promatic2 sectional door. Single button open-stop-close and monitoring its state.

closed
opening
open
closing

Hardware needed
Shelly2.5 (prob the newer 2pm will work too)
Some Wiring
1x Reed contact* (in used the ABUS MK2000W - NC)
*the Hörmann has a build-in contact that is needed for the second ‘sensor’

Shelly2.5 setup:
setup is relay mode giving it two channels
timers: auto OFF with 1 second
power on default: OFF
appliance type: relay
button type: detached switch
*settings are for both channels

From the entities that are being created now in home-assistant you are going to need the ‘input’ channels and the ‘switch’ channel form the given Shelly2.5 wich in my case i named:
binary_sensor.garage1_1_input , binary_sensor.garage1_2_input , switch.garage1_1

Promatic2 setup
On the printboard of the promatic2 there is a dipswitch. [additional image1] for the internal contact to work you should set no 2 to ON (read manual if things differ for your print-board as you may have other settings)

Connecting the Shelly2.5 on the Promatic2
the shelly is powered from the onboard 24V DC of the promatic
The external sensor in attached to the door-rails and runner (close to the promatic) [additional image2]
the terminals are being attached as can be seen in the drawing below: [and additional images3+4]

The Home Assistant part

Button Card by @RomRider to be found here: https://github.com/custom-cards/button-card

After adding button-card in home assistant create a card:

type: custom:button-card
color_type: card
action_name: run
tap_action:
  action: call-service
  service: switch.turn_on
  service_data:
    entity_id: switch.garage1_1
entity: sensor.garage_status
lock:
  enabled: true
name: Garagedoor
show_state: false
show_label: true
state:
  - value: open
    label: DOOR OPEN
    color: red
    icon: mdi:garage-open-variant
    styles:
      card: null
  - value: opening
    label: DOOR IS OPENING
    color: orange
    icon: mdi:arrow-up-bold-box
    styles:
      card:
        - animation: blink 2s ease infinite
  - value: closing
    label: DOOR IS CLOSING
    color: orange
    icon: mdi:arrow-down-bold-box
    styles:
      card:
        - animation: blink 2s ease infinite
  - value: closed
    label: DOOR IS CLOSED
    color: green
    icon: mdi:garage-variant-lock

Next add script below to configuration.yaml:
*cleaned up the yaml code: Jan 19-2023

template:
  - trigger:
      - platform: state
        entity_id:
          - binary_sensor.garage1_1_input
          - binary_sensor.garage1_2_input
    sensor:
      - name: Garage_Status
        unique_id: Garage_status
        state: >
          {% if (trigger.to_state.state == 'on' and trigger.entity_id == 'binary_sensor.garage1_1_input') %}
            closed
          {% elif (trigger.to_state.state == 'off' and trigger.from_state.state == 'on' and trigger.entity_id == 'binary_sensor.garage1_1_input') %}
            opening  
          {% elif (trigger.to_state.state == 'off' and trigger.entity_id == 'binary_sensor.garage1_2_input') %}
            open         
          {% elif (trigger.to_state.state == 'on' and trigger.from_state.state == 'off' and trigger.entity_id == 'binary_sensor.garage1_2_input') %}
            closing            
          {% endif %}

Additional images and disclaimer

This is not the first script for automating and monitoring a garagedoor but on other posts and scripts i ran into the fact that for a noob as myself, things are not always explained in as we call it ‘Jip & Janneke’ language… i.e… in easy language,this goes there …
Anyhow I tried explaining things in a way i would understand it myself :slight_smile:

That said most of the scripting came from other posts and people who tried similar (and did not work for me) and then i crafted them together with help of a friend. I have no clue anymore where al the pieces came from so if you find some of your work here, thank you for it and lets hope we can help many others with this compiled version!

image1:

image2:

image3:

image4:

4 Likes

This is fantastic, champion :v:! I did recreate this and it works like a charm! :slight_smile:
I can confirm it works with a Shelly Plus 2PM, and FYI, I have Hörmann ProMatic3.
The only difference on ProMatic2 vs ProMatic3: in the ProMatic2 schematic, the integrated contact sensor naming is R-, whereas on the ProMatic3 schematic, its simply 0

FYI, I noticed, that in your template sensor, you have off for the ABUS magnet sensor (binary_sensor.garage1_2_input) if the garage door is open. You can set the output to invert in the Shelly configuration, then the ABUS will be on if the garage is open.

I did that and also added an else statement, in case something goes wrong.
Notice the changes in my open and closing elifs below

# Sensor garage
- trigger:
    - platform: state
      entity_id:
        - binary_sensor.garage_closed
        - binary_sensor.garage_open
  sensor:  
    - name: Garage status
      unique_id: Garage_status
      state: >
        {% if (trigger.to_state.state == 'on' and trigger.entity_id == 'binary_sensor.garage_closed') %}
          closed
        {% elif (trigger.to_state.state == 'off' and trigger.from_state.state == 'on' and trigger.entity_id == 'binary_sensor.garage_closed') %}
          opening
        {% elif (trigger.to_state.state == 'on' and trigger.entity_id == 'binary_sensor.garage_open') %}
          open
        {% elif (trigger.to_state.state == 'off' and trigger.from_state.state == 'on' and trigger.entity_id == 'binary_sensor.garage_open') %}
          closing
        {% else %}
          unknown
        {% endif %}

Instead of inverting the output in shelly, the correct sensor to buy would be ABUS FU7350W.

Your work is really amazing. No more “have I closed the garage?” thinking for me (my garage is about 30m away). Thank you!! :star_struck:

1 Like

I noticed, that the ABUS sensor bounces (instead of on to off it goes on-off-on-off and the same vice-versa). Hence, I debounced the ABUS sensor in HA (unfortunately, there is no setting for this in Shelly) with an additional binary_sensor. There might be a more elegant way to do this directly in the garage_status sensor, however the below works for me.
Also, I did reconfigure the closed and open state, it polls the state of the open&closed sensors instead to rely on the trigger-to-state feature. I think the latter would break the garage-status if you restart HA.

Here is my optimised sensor including debouncing:

# Sensors garage
- binary_sensor:
    - name: Garage open debounced
      unique_id: Garage_open_debounced
      state: >
        {% if (states('binary_sensor.garage_open') == 'off') %}
          off
        {% elif (states('binary_sensor.garage_open') == 'on') %}
          on
        {% else %}
          unknown
        {% endif %}
      delay_off:
        seconds: 1
      delay_on:
        seconds: 1    

- trigger:
    - platform: state
      entity_id:
        - binary_sensor.garage_closed
        - binary_sensor.garage_open_debounced
  sensor:  
    - name: Garage status
      unique_id: Garage_status
      icon: mdi:garage-variant
      state: >
        {% if (states('binary_sensor.garage_closed') == 'on' and states('binary_sensor.garage_open_debounced') == 'off') %}
          closed
        {% elif (trigger.to_state.state == 'off' and trigger.from_state.state == 'on' and trigger.entity_id == 'binary_sensor.garage_closed') %}
          opening
        {% elif (states('binary_sensor.garage_open_debounced') == 'on' and states('binary_sensor.garage_closed') == 'off') %}
          open
        {% elif (trigger.to_state.state == 'off' and trigger.from_state.state == 'on' and trigger.entity_id == 'binary_sensor.garage_open_debounced') %}
          closing
        {% else %}
          unknown
        {% endif %}
1 Like

Hi, looks like the perfect solution for me too, perfect project. Only problem: I have a Hormann A445 control. I currently have a Fibaro z-wave puls relais attached as ‘puls button’ on the X2 connection of the A445. I think a Shelly should be a solution for me too if connected to X3 connection of my A445. Do you know hor to wire the Shelly for a Hormann A445 ?

Hi Michel,

The wiring would stay the same i guess as you want a puls to be send and monitor its state.
Trail and error (pref. with a multimeter :slight_smile: ) and the schematics for your door-opener is the way to go!

Hi! Awesome documentation,.exactly what I needed. Seems to be my next autumn errand :wink:

May I ask you what wires you used? Looking at the clamp colors it would be 0.75 (grey) and 1.0 mm2 (red)?

I used 1.5mm2 but this is all 24V so dont you worry :grin: