pboschi / HCPBridgeMqtt

emulates Hoermann HAP 1 HCP (HCP2) on ESP8622, ESP32 and Arduino.
18 stars 3 forks source link

NOTE: this is a fork of the work of various people who did 99% of the work. I just did some cleanups, translated to english and fixed various bugs.

HCPBridge with MQTT + HomeAssistant Support

image

Emulates Hörmann UAP1-HCP board using an ESP32 and a RS485 converter, and exposes garage door controls over web page and MQTT.

Compatible with the following motors (UAP1-HCP / HCP2-Bus / Modbus):

It is not compatible with E3 series motors. Previous generations have different protocol, different pin layout, and already have another supporting project.

Functions

Known Bugs

Notes by original author

Eigentlich war das Ziel, die Steuerung komplett nur mit einem ESP8266 zu realisieren, allerdings gibt es durch die WLAN und TCP/IP-Stackumsetzung Timeoutprobleme, die zum Verbindungsabbruch zwischen dem Antrieb und der Steuerung führen können. Durch die ISR-Version konnte das Problem zwar reduziert aber nicht komplett ausgeschlossen werden. Daher gibt es zwei weitere Versionen, die bisher stabil laufen. Eine Variante nutzt den ESP32 statt ESP8266, welcher über 2 Kerne verfügt und so scheinbar besser mit WLAN-Verbindungsproblemen zurecht kommt. Die andere Option ist ein zweiter MCU, der die MODBUS Simulation übernimmt, sodass sich der ESP8266 nur noch um die Netzwerkkommunikation und das WebInterface kümmern muss.

Web Interface

http://[deviceip]

alt text

Web Service

Commands

http://[deviceip]/command?action=[id]

id Function Other Parameters
0 Close
1 Open
2 Stop
3 Ventilation
4 Half Open
5 Light toggle
6 Restart
7 Set Position position=[0-100]

Status report

http://[deviceip]/status

Response (JSON)

{
 "valid" : true,
 "doorstate" : 1,
 "doorposition" : 0,
 "doortarget" : 0,
 "lamp" : true,
 "debug" : 0,
 "lastresponse" : 0
}

Wifi Status

http://[deviceip]/sysinfo

OTA Firmware update (AsyncElegantOTA)

http://[deviceip]/update

image

Pinout RS485 (Plug)

alt text

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

RS485 Adapter

alt text
Pins A+ (Red) and B- (Green) need a 120 Ohm resistor for BUS termination. Some RS485 adapters provide termination pad to be soldered.

DS18X20 Temperature Sensor

DS18X20
DS18X20 connected to GPIO4.

Circuit

alt text

ESP32 powering requires a Step Down Module such as LM2596S DC-DC, but any 24VDC ==> 5VDC will do, even the tiny ones with 3 pin. Please note that the suggested serial pins for serial interfacing, on ESP32, are 16 RXD and 17 TXD.

It is possible to implement it with protoboard and underside soldering:

alt text

alt text

3D Case

Body Body with optional BME280 Sensor

Lid Lid

Installation

alt text

HCPBridge MQTT (HomeAssistant topics)

This is just a quick and dirty implementation and needs refactoring, but it is working. Using the Shutter Custom Card (from HACS) it is also possible to get a representation of the current position of the door, and slide it to custom position (through set_position MQTT command).

image alt text