ESPHOME and a Hörmann Garage door

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 YAML file looks like this.

esphome:
  name: garage_hoermann
  platform: ESP8266
  board: d1_mini

wifi:
  ssid: 'secret'
  password: 'secret'
  manual_ip:
    static_ip: 192.168.178.250
    gateway: 192.168.178.1
    subnet: 255.255.255.0

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: 'secret'

ota:
  password: 'secret'


#http://heinz-otto.blogspot.com/2016/07/garagentor-mit-fhem-bedienen.html
#http://majorshark.de/index.php/13-hoermann-torantrieb-mit-espeasy-in-fhem-einbinden
#GPIO5 	D6 	Eingang 	O1 	Tor Endlage oben (Geöffnet)
#GPIO0 	D5 	Eingang 	O2 	Tor Endlager unten (Geschlossen)
#GPIO14 	D4 	Ausgang 	S4 	Tor schließen
#GPIO13 	D3 	Ausgang 	S2 	Tor öffnen

binary_sensor:
  - platform: gpio
    id: state_up
    pin: 
      number: D6
      mode: INPUT_PULLUP
    name: "Garage Endlage oben"
    internal: true
    #device_class: binary_sensor #garage_door
    filters:
    - invert:
  - platform: gpio
    id: state_down
    pin: 
      number: D5
      mode: INPUT_PULLUP
    internal: true
    filters:
    - invert:
    name: "Garage Endlage unten"
    #device_class: binary_sensor #garage_door

switch:
  - platform: gpio
    pin: D4
    id: close_switch
    name: "Garage Down"
    icon: "mdi:gate"
    interlock: [open_switch]
    internal: true
    restore_mode: ALWAYS_OFF
    on_turn_on:
    - delay: 500ms
    - switch.turn_off: close_switch
  - platform: gpio
    pin: D3
    id: open_switch
    internal: true
    restore_mode: ALWAYS_OFF
    interlock: [close_switch]
    name: "Garage Up"
    icon: "mdi:gate"
    on_turn_on:
    - delay: 500ms
    - switch.turn_off: open_switch

cover:
  - platform: template
    id: garage_door
    name: "Garagen Tor"
    lambda: |-
      if (id(state_down).state) {
        return cover::COVER_CLOSED;
      } else {
        return cover::COVER_OPEN;
      }
    open_action:
      - switch.turn_on: open_switch
    close_action:
      - switch.turn_on: close_switch
    stop_action:
      - switch.turn_off: close_switch
      - switch.turn_off: open_switch

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.

4 Likes

Hi lubeda,

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

THanks!

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!

I also only use ESPHome with the code you provided above (no special logleven - only difference is Nodemcu Board and not WEMOS) - no MQTT.

Strange… anybody an idea?

Thanks!

I am on an x64 hass.io, are you on another plattform like raspberry?
Perhaps other platforms compiles the source different.

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
1 Like

yes I’m on raspberry 3 but that should not affect the code :face_with_raised_eyebrow:

Hi!

Which particular type of Hörmann Garage door do you own? I am asking because I am planing to buy a new garage door in spring of 2020.

Thanks and kind regards!

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.

Greetings

1 Like

Hello lubeda,

I know. :slight_smile: I was asking because I am going to replace my current door with a new one and I was interested which particular model you own.

Nevermind, kind regards from Roman.

I dont know the exact model because our garage is a bit oversized 5x3m
But it is this technic:
https://www.hoermann.de/private-bauherren-und-modernisierer/garagentore/garagen-sektionaltore/
and “LPU 67 Thermo” as panel type.
the people who mount this door to your garage have to be very precise, misalignment of the rails can result in problems.

1 Like