After searching the web up and down for a proper explanation of HA/Hörmann/Shelly how-to, your post finally seems to be the missing link.
Will give it a go and report back.
After searching the web up and down for a proper explanation of HA/Hörmann/Shelly how-to, your post finally seems to be the missing link.
Will give it a go and report back.
Any one knows how the schema would like for a promatic4 or is it similar?
First of all. Thanks for this missing gem. Was looking for exactly this.
Could anyone correct me if I’m wrong? This setup requires the additional reed sensor to monitor the 4 states. With the built-in you would only be able to detect if the gate is opened or closed right?
Also … wondering the use of the shelly 2.5 …. Or wouldn’t be the best place for the Shelly UNI? Could handle the two reed sensors, powered by 24v and couple of dry contacts to trigger the open/close actions?
I saw some people using shelly 1 plus, but I’m wondering about the UNI. If anyone can enlighten me … much appreciated.
Hello everyone, found this thread and it motivated me to finally resolve garage door closing remotely myself BUT!
ran into kind of an issue, maybe you could help me out?
Got Shelly 2pm, Promatic3 AND, and this is probably the issue JCM Stick30 connected to it for remote (guess so the same system is used everywhere in the house, even for opening entrance door…), guess as cheaper replacement for hormann bisecur. It should be this thingy, connected via board to promatic - JCM Technologies | Stick30
Its connected to pins 5, 21, 20
My issue is, setup everything and it’s working fine - Switch 1 works same as remote basically, Switch 2 shows if the gate is fully open.
But issue comes, when i switch the pin 2 to on position - after that, when I close the garage door by remote, it reopens it. When i put it to off, it works.
I’m now using only shelly app, will be integrating it to Homey later, guess only thing I’m missing is seeing if the garage door is fully locked?
Other than that, everything is connected exactly as in your pics - https://photos.app.goo.gl/nGMZr5PDvnUrV5Cx9
(excuse the wiring, it’s hell, had to move shelly more close to the door to get better signal, so now it’s completely rewired :))
Forget my last question (but might help someone else)… did not properly configure shelly, now it works as it should
Hi,
this is a really great solution. I just installed a shelly2pm and configured it as described in the first post.
Now I want to add the add the required code in HA and therefore I want to rename the sensors and switches I need at first.
In the descibtion it says we need the two input channels and the switch. In my entities I have two switches? Is that right or may I have some mistake in my shelly configuration? In case it’s right, which switch do I have to use?
Screens from HA:
Two input binary sensors
Entities for two switches:
I think I get it. As one of the swiches is not used I only have to care about the first one.
@fair_dinkum: I went trough your posts and checked my configuration for it. I think I have everthing implemented as describted but my Button card is not working as expected. The tap action is working to open/close the door but it’s not refreshing it’s state. It does not turn to red/green or orange.
Can you please check if you see something wrong? I used a Shelly2PM and the ABUS FU7350, so I didn’t inverted the output in shelly.
Entity states:
Configuration:
- binary_sensor:
- name: Garage open debounced
unique_id: garage_open_debounced
state: >
{% if (states('binary_sensor.garage_tr_left_open') == 'off') %}
off
{% elif (states('binary_sensor.garage_tr_left_open') == 'on') %}
on
{% else %}
unknown
{% endif %}
delay_off:
seconds: 1
delay_on:
seconds: 1
- trigger:
- platform: state
entity_id:
- binary_sensor.garage_tr_left_closed # closed
- binary_sensor.garage_open_debounced # open
- sensor:
- name: Garage status
unique_id: garage_status
icon: mdi:garage-variant
state: >
{% if (states('binary_sensor.garage_tr_left_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_tr_left_closed') %}
opening
{% elif (states('binary_sensor.garage_open_debounced') == 'on' and states('binary_sensor.garage_tr_left_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 %}
Button 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.shellyplus2pm_10061cc9f634_switch_0
entity: sensor.garage_status
lock:
enabled: true
duration: 2
name: Garage links
show_state: true
show_label: true
state:
- value: offen
label: DOOR OPEN
color: red
icon: mdi:garage-open-variant
styles:
card: null
- value: öffnet
label: DOOR IS OPENING
color: orange
icon: mdi:arrow-up-bold-box
styles:
card:
- animation: blink 2s ease infinite
- value: schließt
label: DOOR IS CLOSING
color: orange
icon: mdi:arrow-down-bold-box
styles:
card:
- animation: blink 2s ease infinite
- value: geschlossen
label: DOOR IS CLOSED
color: green
icon: mdi:garage-variant-lock
Would be very thankful for any help.
If the garage toggle itself works, its only a displaying issue. So, good onya!
I can see in your code, that you are using German strings for the value itself. These must be the English values, then you can give it a German Label.
Here is my code for the button card, feel free to adapt the labels
to your language and of course the entity
and the tap-action
to your environment.
(If used in an English environment, put show_state
to true
and remove show_label
and the labels
itself, it will directly show the correct state, no need for a label - thats only for other languages than English.)
type: custom:button-card
entity: sensor.garage_status
name: Garage
show_state: false
show_label: true
state:
- value: open
label: Open
icon: mdi:garage-open-variant
styles:
card:
- background-color: orange
- value: opening
label: Opening-tranlsation
icon: mdi:arrow-up-bold-box
styles:
card:
- background-color: orange
- animation: blink 2s ease infinite
- value: closing
label: Closing-tranlsation
icon: mdi:arrow-down-bold-box
styles:
card:
- background-color: orange
- animation: blink 2s ease infinite
- value: closed
label: Closed-tranlsation
icon: mdi:garage-variant-lock
- value: unknown
label: Error-tranlsation
icon: mdi:garage-alert-variant
styles:
icon:
- color: auto
card:
- font-size: 14px
- background-color: >-
[[[ if (states[entity.entity_id].state == "unavailable" ||
states[entity.entity_id].state == "unknown") return "red" ]]]
tap_action:
action: call-service
service: switch.turn_on
service_data:
entity_id: switch.garage_toggle
Thanks for the explanation but it’s not only with the value names. During my first tests I used your code with the english values.
I now changed my code to this but nothing changed. During closing the Icons stays gray with the icon for closed. Same during opening.
type: custom:button-card
entity: sensor.garage_status
name: Garage links
color_type: card
action_name: run
tap_action:
action: call-service
service: switch.turn_on
service_data:
entity_id: switch.shellyplus2pm_10061cc9f634_switch_0
lock:
enabled: true
duration: 2
show_state: false
show_label: true
state:
- value: open
label: offen
color: red
icon: mdi:garage-open-variant
styles:
card: null
- value: opening
label: öffnet
color: orange
icon: mdi:arrow-up-bold-box
styles:
card:
- animation: blink 2s ease infinite
- value: closing
label: schließt
color: orange
icon: mdi:arrow-down-bold-box
styles:
card:
- animation: blink 2s ease infinite
- value: closed
label: geschlossen
color: green
icon: mdi:garage-variant-lock
I think something is not working with my garage_status sensor as its unavailable
When I paste the code to the template editor in the dev tools it says “‘trigger’ is undefined”
@fair_dinkum
I’m a step further. Had an error in the definition of the garage status sensor (had to remove the - before the sensor in confiuration.yml).
Now the Status sensor has a value but it’s always unknown.
If I interpret the expression correctly the value should be currently set to closed, right?
{% if (states('binary_sensor.garage_tr_left_closed') == 'on' and states('binary_sensor.garage_tr_left_open_debounced') == 'off') %}
closed
Could it be a problem with the sensor names like @FutureProof has it somewhere above? Is it not allows to use friendly names of entities in the template section?
OK, fixed it. Renamed the two sensors as written above to the friendly names and it starts working. Didn’t know why friendly names do not work
A word of advice (from my experiences): add confirmation to tap action. Otherwise you’ll open gates by accident pretty quickly, not knowing you did it…
Hi everyone,
Hi @macguyver76 ,
Great post. I am trying to setup the entire thing using my Shelly 2PM and the Hörmann Promatic 4.
I have been experiencing several difficulties but at the moment seems like the Shelly 2PM is exposing only two switch entities (one for 01, the other one for 02 of course).
In your article you are mentioning to create the following instead:
Any idea on how I can get that working?
Thanks a lot
Hi,
I don’t know if I got it right. Did you configure the shelly as detached switch as written in the first post? This is important to use it in this way.
O1 is used to switch the garage (open/closed).
SW1 and SW1 are used as sensors for opening and closing.
Hi
Anyone try this config share to iOS home with homekit bridge ?
In case anyone is interested, I added a failure check as well, it will now report “unknown” if the garage fails to open or close in a certain amount of time (in my case ~21 seconds plus some margin = 30s). I updated the post above:
To whom it may concern (Shelly Wave users):
This means that with Shelly Wave 2PM you currently can’t get binary sensors for the inputs and this kind of application does not work.
Hi,
can you tell me how I can check if my sensors are bouncing?
I realized that I sometimes have the unknown state for my garage status entity.
Currently my trigger looks like this. I did not add the bouncing part because I didn’t know it the problem occurs on my sensors.
- trigger:
- platform: state
entity_id:
- binary_sensor.garage_tr_right_closed # Hörmann Kontakt für geschlossen
- binary_sensor.garage_tr_right_open # Magnetkontakt für offen
sensor:
- name: Garage TR Right Status
unique_id: garage_tr_right_status
icon: mdi:garage-variant
state: >
{% if (trigger.to_state.state == 'on' and trigger.entity_id == 'binary_sensor.garage_tr_right_closed') %}
geschlossen
{% elif (trigger.to_state.state == 'off' and trigger.from_state.state == 'on' and trigger.entity_id == 'binary_sensor.garage_tr_right_closed') %}
öffnet
{% elif (trigger.to_state.state == 'on' and trigger.entity_id == 'binary_sensor.garage_tr_right_open') %}
offen
{% elif (trigger.to_state.state == 'off' and trigger.from_state.state == 'on' and trigger.entity_id == 'binary_sensor.garage_tr_right_open') %}
schließt
{% else %}
unbekannt
{% endif %}
What is the status of the binary sensors in the same timeslots?
If bouncing, it would be the magnet sensor, which is the “open” sensor.
As experienced already by me (see my post way above this thread), you really should debounce the open-sensor and use that one for state change detection.
I added the debouncing sensor and now status is correct.
For what situations do you need the new “stuck states”, is this for example if you stop the door while closing or opening?