I attached my new Hörmann Garage door to HA via @ESPHOME.
From the Door side i needed an UAP1 which is a connector box, it is plugged to the motor. The UAP1 has all needed in- and outputs i need.
There is a 24V powersupply integrated which i use to power the D1 Mini via a voltage regulator.
I connected the relays to inputs to get the states door close / door fully open and two outputs via MOSFET (e.g. IRF530) to set the direction of the door.
The state of the light wasn’t relevant to me so i skiped it. Perhaps i will extend the board whit a DHT12 to get the clima from inside the garage. It works fine for me but use at your own risk.
grat job i also have a UAP1 and implemented your code with an ESP8266.
I can suscessfully open and close the garage door but the code does not change the entity state to “closed” or “opend”.
It is always “opening” or “closing”.
Can anybody support?
The Logfile from ESP is as follows.
[13:35:30][D][cover:072]: 'Garagen Tor' - Setting
[13:35:30][D][cover:082]: Command: OPEN
[13:35:31][D][switch:021]: 'Garage Up' Turning ON.
[13:35:31][D][switch:045]: 'Garage Up': Sending state ON
[13:35:31][D][cover:152]: 'Garagen Tor' - Publishing:
[13:35:31][D][cover:160]: State: CLOSED
[13:35:31][D][cover:168]: Current Operation: OPENING
[13:35:31][D][binary_sensor:033]: 'Garage Endlage unten': Sending state OFF
[13:35:31][D][cover:152]: 'Garagen Tor' - Publishing:
[13:35:31][D][cover:158]: State: OPEN
[13:35:31][D][cover:168]: Current Operation: OPENING
[13:35:31][D][switch:025]: 'Garage Up' Turning OFF.
[13:35:31][D][switch:045]: 'Garage Up': Sending state OFF
[13:35:43][D][binary_sensor:033]: 'Garage Endlage oben': Sending state ON
[13:37:26][D][cover:072]: 'Garagen Tor' - Setting
[13:37:26][D][cover:082]: Command: CLOSE
[13:37:26][D][switch:021]: 'Garage Down' Turning ON.
[13:37:26][D][switch:045]: 'Garage Down': Sending state ON
[13:37:26][D][cover:152]: 'Garagen Tor' - Publishing:
[13:37:26][D][cover:158]: State: OPEN
[13:37:26][D][cover:168]: Current Operation: CLOSING
[13:37:27][D][switch:025]: 'Garage Down' Turning OFF.
[13:37:27][D][switch:045]: 'Garage Down': Sending state OFF
[13:37:27][D][binary_sensor:033]: 'Garage Endlage oben': Sending state OFF
[13:37:47][D][binary_sensor:033]: 'Garage Endlage unten': Sending state ON
[13:37:47][D][cover:152]: 'Garagen Tor' - Publishing:
[13:37:47][D][cover:160]: State: CLOSED
[13:37:47][D][cover:168]: Current Operation: CLOSING
[13:39:15][D][cover:072]: 'Garagen Tor' - Setting
[13:39:15][D][cover:082]: Command: OPEN
[13:39:15][D][switch:021]: 'Garage Up' Turning ON.
[13:39:15][D][switch:045]: 'Garage Up': Sending state ON
[13:39:15][D][cover:152]: 'Garagen Tor' - Publishing:
[13:39:15][D][cover:160]: State: CLOSED
[13:39:15][D][cover:168]: Current Operation: OPENING
[13:39:15][D][switch:025]: 'Garage Up' Turning OFF.
[13:39:15][D][switch:045]: 'Garage Up': Sending state OFF
[13:39:15][D][binary_sensor:033]: 'Garage Endlage unten': Sending state OFF
[13:39:15][D][cover:152]: 'Garagen Tor' - Publishing:
[13:39:15][D][cover:158]: State: OPEN
[13:39:15][D][cover:168]: Current Operation: OPENING
[13:39:28][D][binary_sensor:033]: 'Garage Endlage oben': Sending state ON
Crazy,
do you have a special loglevel? I can’t see anything like “OPENING” od “CLOSING” with my current configuration.
One up and down round looks like this with my config:
[17:06:47][D][switch:027]: 'Garage Up' Turning ON.
[17:06:47][D][switch:051]: 'Garage Up': Sending state ON
[17:06:47][D][switch:031]: 'Garage Up' Turning OFF.
[17:06:47][D][switch:051]: 'Garage Up': Sending state OFF
[17:06:47][D][binary_sensor:037]: 'Garage Endlage unten': Sending state OFF
[17:07:01][D][switch:031]: 'Garage Down' Turning OFF.
[17:07:01][D][switch:031]: 'Garage Up' Turning OFF.
[17:07:04][D][binary_sensor:037]: 'Garage Endlage oben': Sending state ON
[17:07:15][D][switch:027]: 'Garage Down' Turning ON.
[17:07:15][D][switch:051]: 'Garage Down': Sending state ON
[17:07:15][D][switch:031]: 'Garage Down' Turning OFF.
[17:07:15][D][switch:051]: 'Garage Down': Sending state OFF
[17:07:16][D][binary_sensor:037]: 'Garage Endlage oben': Sending state OFF
[17:07:39][D][binary_sensor:037]: 'Garage Endlage unten': Sending state ON
I am currently checking out an ESP32-CAM to do this up down thing an also monitor the garage with a cam.
I dont use mqtt i am on the latest hass.io and ESPHOME!
Think it has something to do with “Current Operation: CLOSING” or “Current Operation: OPENING”, this somehow needs to go to “Current Operation: IDLE” before the state will update based on the sensor.
After triggering an Open or Close, wait till the door is finished its operation. Disconnect your relay wires and hit the stop button, you should see the state go from (Opening/Closing) to (Open/Closed).
Not sure how to get “Current Operation: IDLE” to occur without hitting the stop button.
So I think I got it working, at work and its not connected to my garage at the moment; so I cant really validate it operates as intended.
I’m sure there is a better way of doing this but I just added “- cover.stop: car_door” to the open and close action, and set the stop_action to not really do anything. Down side is the stop button only tells the relay to turn off, which does not have any effect on my garage opener.
My garage opener only has 1 input for open/close actions, So i’m using a single relay. I also only have 1 sensor to identify the state which is configured for closed.
esphome:
name: esp_cardoor
platform: ESP8266
board: d1_mini
wifi:
ssid: "ssidhere"
password: "passwordhere"
# fast_connect: True for hidden ssids
fast_connect: True
# Enable logging
logger:
# Enable Home Assistant API
api:
password: "passwordhere"
ota:
password: "passwordhere"
binary_sensor:
- platform: gpio
id: car_door_sensor
pin:
number: GPIO15
mode: INPUT_PULLUP
# Inverted since the sensor is positioned for the garage being closed.
inverted: True
name: "Car Door Sensor"
device_class: garage_door
filters:
- delayed_on: 20ms
switch:
- platform: gpio
id: relay
pin:
number: GPIO5
inverted: False
restore_mode: ALWAYS_OFF
- platform: restart
name: 'Car Door Reboot'
cover:
- platform: template
id: car_door
name: "Car Door"
lambda: !lambda |-
if (id(car_door_sensor).state) {
return COVER_OPEN;
} else {
return COVER_CLOSED;
}
optimistic: false
assumed_state: true
open_action:
- switch.turn_off: relay
- switch.turn_on: relay
- delay: 0.1s
- switch.turn_off: relay
# cover.stop to set "Current Operation" to IDLE
- cover.stop: car_door
close_action:
- switch.turn_off: relay
- switch.turn_on: relay
- delay: 0.1s
- switch.turn_off: relay
# cover.stop to set "Current Operation" to IDLE
- cover.stop: car_door
stop_action:
- switch.turn_off: relay
Hello, it does not depend on the door it depends on the motor. You need a motor wich is able to connect to the UAP from Hörmann. The UAP is an interfacebox with contacts and relays. My ESP interfaces only with them regardles of the door itself. Perhaps you should take an intense look in the documentation of the UAP.
Just wanted to give my take on the automation (which I wouldn’t have been able to create without your prototyping board and heinz otto’s blog.
I had a couple of “issues” or annoyances. I wanted to be able to stop the garage from opening and closing. But also to be able to reverse the direction of the current running action.
I’m also using an UAP01, so I guess this should work for you also.
A couple of notes on default UAP behavior (for me)
Running the close action while opening → garage stops
Running te open action while closing → garage opens
Pressing the partial open “button” while opening or closing → garage stops
After first adding the “stop” action by using the partial opening button, I couldn’t choose to then open or close the garage. It assumed a full closed or opened state after stopping, which meant I head to let the garage open completely before being able to close it again.
By using a “virtual” position of 0.5 while moving, both up and down actions are available.
With an extra check in the on_close action, I run the close command twice so the garage is really closing after pressing the close button while it was previously opening.
Deutsch:
Hi, die Grundlage zur Hardware habe ich irgendwo in einem FHEM-Forum gefunden. Ich denke es geht um das was man schaltet, du kannst kein Relay direkt mit dem ESP ansteuern (zuviel Strom). Aber das ding läuft bei mir schon eine weile, Details habe ich verdrängt.
English:
Hi, I found the basis for the hardware somewhere in an FHEM forum. I think it’s about what you switch, you can’t control a relay directly with the ESP (too much current). But this thing has been going on for me for a while, I’ve suppressed details.
I have a Hörmann garage door with an SupraMatic P3. This I also want to integrate in HA like you did. In the opening post only up and down is set as a switch, but I also want to have the ventilation position. Is this the 1/2 position which is also available on the UAP1? And how can I connect it to the ESP (sorry, I’m no electronics technician)? I think I have to add one more resistance and one more MOSFET (NPN in the scheme) and connect them to D2 for example?
@lubeda Have you added a DHT12 to the board like you have mentioned?
@XiteHosting you have added the partial open button I want to have. Can you eventually tell me how you built up the board and show me some pictures of it? I really want to build one.
Hi,
no, but you can use the examples from the esphome documentation, for the i2c bus you need specials ports. For the rest you are free which ports to use for the Hörmann connection.
The partial opening should also be possible by a template. You have to measure the timing to the desired opening from the open and close positions and put some logic to the lambdas. I don’t have hardware-buttons directly connected to the ESP.
Thank you very much for that information. Can you eventually give me some more details about the parts I need? This topic is completely new for me but I want to try to build on board with your scheme in the initial post.
I see that I need a D1 Mini (which one?), a voltage regulator (which one?), 2x IRF530, 2x resistance, 1 condensator?! and some PCB terminal? Is that right?
the topic has been resolved. I ordered a ready-made additional board for the Hörmann universal adapter board UAP1, which can be integrated using ESP via MQTT.