Hörmann garage door via MQTT

The whole thing wasn’t designed to work that way.

  1. Make the necessary changes to the code (you can leave the //WIFI segment as it is)
  2. Flash the ESP32 with the @Dr.Pat code
  3. Restart ESP32
  4. Connect your phone to AP with SSID “HCPBRIDGE” using password “password”
  5. Use the console to connect to your WiFi network

Let me know whether it works.

I actually used the same ESP32 that I was testing that with before, using other projects from Github. So what I did here was I changed the password for wifi and flashed ESP32. Seems like it had stored SSID somewhere, as it connected to my wifi without any further interaction.
I ran the BusScan and was able to find the accessories and can control the gate now (initially I had pins 16 and 17 reversed).
I am noticing though - when I look at device in HA (MQTT), resport is correct whether it is opened/closed. But whenever the door is closing or opening and I stop it in the middle for instance, the status shows UNKNOWN. As soon as I close/open it, it reports closing/opening–>closed/opened

Please have a look at the code below

    case DOOR_OPEN_POSITION:
      doc["doorstate"] = HA_OPENED;
      break;
    case DOOR_CLOSE_POSITION:
      doc["doorstate"] = HA_CLOSED;
      break;
    case DOOR_HALF_POSITION:
      doc["doorstate"] = HA_HALF;
      break;
    case DOOR_MOVE_CLOSEPOSITION:
      doc["doorstate"] = HA_CLOSING;
      break;
    case DOOR_MOVE_OPENPOSITION:
      doc["doorstate"] = HA_OPENING;
      break;
    default:
      doc["doorstate"] = "UNKNOWN";
    }

The state.doorstate returns only the statuses above while the default status is “UNKNOWN”.

I saw that. While it reports some values in HTTP (such as target and current position, based off which I could template it somehow), those are not published to MQTT.
Therefore I am trying to find a way now how to make controls better. If you use device that is auto-created in MQTT, it does not reflect proper state if door is half/opened. Therefore, if you open door, and stop it, you can’t open it fully since that “open” button is greyed out.
I created mqtt cover template, but so far I struggle with state reflection based on the door posisiton value.

edit:
So far, I managed to at least create MQTT cover. Slider is not working since set_position_cover publishes numeric value instead of payload. Despite being able to see state (numberic value), not sure it supports setting state to “50”

  cover:
    - name: "Hormann Garage Gate"
      device_class: garage
      command_topic: "hormann/garage_door/command/door"
      #state_topic: "hormann/garage_door/state"
      position_topic:  "hormann/garage_door/position"
      set_position_topic: "hormann/garage_door/command/set_position"
      availability:
        - topic: "hormann/garage_door/availability"
      qos: 0
      retain: true
      payload_open: "open"
      payload_close: "close"
      payload_stop: "stop"
      #state_opening: "opening"
      #state_closing: "closing"
      #state_open: "open"
      #state_closed: "closed"
      payload_available: "online"
      payload_not_available: "offline"
      optimistic: false
      position_open: 100
      position_closed: 0
      position_template: "{{ value }}"

Edit: had wrong set_position_topic defined.
So now, even if it is half opened, I can fully open it.

I would love to receive the file as well…

For all interested:

PCB:

Cable
image

RJ12 cable pinout:

  1. 24VDC (White)
  2. 24VDC (Black)
  3. A+ (Red)
  4. B- (Green)
  5. GND (Yellow)
  6. GND (Blue)

Notes

  • The pinout on the board is different from the one found in most repositories related to this topic.
  • The Temperature Sensor is not part of the setup because I didn’t need it - I have several temperature sensors in the garage and measuring the temperature inside the Supramatic 4 case was meaningless to me.
3 Likes

@ vladimirzrnic Thanks for your efforts but the file seems to be deleted. I have send you a private message in hope to receive it via email. :slight_smile:

1 Like

try again now, I managed to download. (via google drive)

I have the ESP32 and LM2596S already here so thats no problems.

But what is the “TTL to RS485”? I cannot see where it is on the board.
Also what is the 6 pin socket on the board?

I sent off my order for the PCB today :slight_smile:

This is a module that allows the TTL interface of the microcontroller to be transferred to the RS485 module.

TTL-RS485 should be installed under ESP32.

image

Regarding the pinout, see my previous post.:arrow_up_small::arrow_up_small::arrow_up_small:

1 Like

Can this be used with the Supramatic E3, is it just a matter of requiring the connector? Its much simpler than the other solution!

Perfect thanks so much, I thought something was hiding :stuck_out_tongue_winking_eye:

Great project. It would be great if there was a thread that gave some kind of step by step instructions.

I would also like to do this, but somehow I do not quite understand where to start , and what I actually need everything.

Maybe there is a way to do that?

I would definitely be very grateful

@fisch55 you need Hormann Supramatic 4 or Promatic 4 (4 series is needed). I mean - @Dr.Pat 's code is for that. I onlt have experience with this model. Do you have any of that?

Currently running this via raspberrymatic Ip .but would love to switch to the mqtt story. Got the Supramatic4 !

@fisch55 you need 3 HW pieces. This is what I used:
ESP32:
https://www.aliexpress.com/item/1005004407778904.html?spm=a2g0o.order_list.order_list_main.158.65f81802UqQtvd

Stepdown module for converting 25V (from hormann) to 5V (for ESP)
https://www.aliexpress.com/item/1005001580213946.html?spm=a2g0o.order_detail.order_detail_item.13.5aeaf19csgJTHA

And I used this RS485 module as it has built in 120Ohm resistor (you need to solder 2 pins together to use it)
https://www.aliexpress.com/item/1005001580305871.html?spm=a2g0o.order_detail.order_detail_item.3.5dc8f19cApsIph

Rest is just soldering those pieces together according to schematics and upload Dr.Pat’s code with adjusted MQTT details.
I am using for some statuses also device that gets autodiscovered, but due to (I believe) limitation about state/position reporting, when I open gate, and stop it before it opens fully, then this device does not let me close it, arrow down is greyed out. So I templated MQTT cover that does not have this “limitation” as it works based on position value (0-100), but this does not have state (opening, closing, unknown) and I can’t template it as target position is not being published in MQTT (only on web, for which you would need to poll regularly).
So for opening/closing status, I use autodiscovered device. But for operating the gate, I use templated MQTT cover (see above posts).
I am using device that

1 Like

Cool , THX a lot for these informations!!!

And this….right?! The only part I can’t find ist the socket !

image

Actually I Got this

which rj12 socket should I use?

So - you already have HAP 1 module. This project here emulates it without need to actually have it.
Regarding the soldering and socket - it is really up to you how you put it together. I don’t have the board for instance, I directly lead those 6 wires from RJ12 to where it needs to go.

1 Like

ok thx!

What is the difference between Dr.Pats code and @tsaG1337 esphome variant?
@tsaG1337 do not use the mqtt , right?