hi, this is the one that is working for me:
Hey! Thanks for the code. I will try and see what I can do. I also think a cover would be a great way tom implement it. Ill use your code as base.
The Issue I had with the implementation in MQTT is, that it did not react after a few days. I got the Status just fine (open/close, Pressure, Temperature) but I could not open the Garage. I hope its not an issue with the PIC…
EDIT:
I uploaded it and it works! I try to add the “endstop cover” and change the toggle function of the Light. Otherwise I am quite happy. Lets see how long it works or it stops after a few days as well.
I already added the BME Sensor and attached my log where I opened, stopped, closed, fully opened, fully closed, vented, toggled the light…
INFO Reading configuration /config/esphome/garage-door.yaml...
INFO Starting log output from garage-door.local using esphome API
INFO Successfully connected to garage-door.local
[23:19:57][I][app:102]: ESPHome version 2022.12.8 compiled on Feb 2 2023, 23:16:34
[23:19:57][C][wifi:504]: WiFi:
[23:19:57][C][wifi:362]: Local MAC: EC:FA:BC:76:E3:6B
[23:19:57][C][wifi:363]: SSID: 'Internetz'[redacted]
[23:19:57][C][wifi:364]: IP Address: 192.168.1.35
[23:19:57][C][wifi:365]: BSSID: 28:87:BA:14:0D:A2[redacted]
[23:19:57][C][wifi:367]: Hostname: 'garage-door'
[23:19:57][C][wifi:369]: Signal strength: -82 dB ▂▄▆█
[23:19:57][C][wifi:373]: Channel: 11
[23:19:57][C][wifi:374]: Subnet: 255.255.255.0
[23:19:57][C][wifi:375]: Gateway: 192.168.1.1
[23:19:57][C][wifi:376]: DNS1: 192.168.1.1
[23:19:57][C][wifi:377]: DNS2: 0.0.0.0
[23:19:57][C][logger:293]: Logger:
[23:19:57][C][logger:294]: Level: DEBUG
[23:19:57][C][logger:295]: Log Baud Rate: 0
[23:19:57][C][logger:296]: Hardware UART: UART0
[23:19:57][C][i2c.arduino:052]: I2C Bus:
[23:19:57][C][i2c.arduino:053]: SDA Pin: GPIO4
[23:19:57][C][i2c.arduino:054]: SCL Pin: GPIO5
[23:19:57][C][i2c.arduino:055]: Frequency: 50000 Hz
[23:19:57][C][i2c.arduino:058]: Recovery: bus successfully recovered
[23:19:57][I][i2c.arduino:068]: Results from i2c bus scan:
[23:19:57][I][i2c.arduino:074]: Found i2c device at address 0x76
[23:19:57][C][uart.arduino_esp8266:102]: UART Bus:
[23:19:57][C][uart.arduino_esp8266:103]: TX Pin: GPIO15
[23:19:57][C][uart.arduino_esp8266:104]: RX Pin: GPIO13
[23:19:57][C][uart.arduino_esp8266:106]: RX Buffer Size: 256
[23:19:57][C][uart.arduino_esp8266:108]: Baud Rate: 19200 baud
[23:19:57][C][uart.arduino_esp8266:109]: Data Bits: 8
[23:19:57][C][uart.arduino_esp8266:110]: Parity: NONE
[23:19:57][C][uart.arduino_esp8266:111]: Stop bits: 1
[23:19:57][C][uart.arduino_esp8266:113]: Using hardware serial interface.
[23:19:57][C][template.cover:071]: Template Cover 'esp_garage_door'
[23:19:57][C][template.cover:071]: Assumed State: YES
[23:19:57][C][template.cover:071]: Device Class: 'garage'
[23:19:57][C][bme280.sensor:177]: BME280:
[23:19:57][C][bme280.sensor:178]: Address: 0x76
[23:19:57][C][bme280.sensor:190]: IIR Filter: OFF
[23:19:57][C][bme280.sensor:191]: Update Interval: 60.0s
[23:19:57][C][bme280.sensor:193]: Temperature 'Temperature'
[23:19:57][C][bme280.sensor:193]: Device Class: 'temperature'
[23:19:57][C][bme280.sensor:193]: State Class: 'measurement'
[23:19:57][C][bme280.sensor:193]: Unit of Measurement: '°C'
[23:19:57][C][bme280.sensor:193]: Accuracy Decimals: 1
[23:19:57][C][bme280.sensor:194]: Oversampling: 16x
[23:19:57][C][bme280.sensor:195]: Pressure 'Pressure'
[23:19:57][C][bme280.sensor:195]: Device Class: 'pressure'
[23:19:57][C][bme280.sensor:195]: State Class: 'measurement'
[23:19:57][C][bme280.sensor:195]: Unit of Measurement: 'hPa'
[23:19:57][C][bme280.sensor:195]: Accuracy Decimals: 1
[23:19:57][C][bme280.sensor:196]: Oversampling: 16x
[23:19:57][C][bme280.sensor:197]: Humidity 'Humidity'
[23:19:57][C][bme280.sensor:197]: Device Class: 'humidity'
[23:19:57][C][bme280.sensor:197]: State Class: 'measurement'
[23:19:57][C][bme280.sensor:197]: Unit of Measurement: '%'
[23:19:57][C][bme280.sensor:197]: Accuracy Decimals: 1
[23:19:57][C][bme280.sensor:198]: Oversampling: 16x
[23:19:57][C][mdns:103]: mDNS:
[23:19:57][C][mdns:104]: Hostname: garage-door
[23:19:57][C][ota:093]: Over-The-Air Updates:
[23:19:57][C][ota:094]: Address: garage-door.local:8266
[23:19:57][C][ota:097]: Using Password.
[23:19:57][C][api:138]: API Server:
[23:19:57][C][api:139]: Address: garage-door.local:6053
[23:19:57][C][api:141]: Using noise encryption: YES
[23:20:11][D][sensor:126]: 'Temperature': Sending state 18.06000 °C with 1 decimals of accuracy
[23:20:11][D][sensor:126]: 'Pressure': Sending state 1019.49670 hPa with 1 decimals of accuracy
[23:20:11][D][sensor:126]: 'Humidity': Sending state 37.35449 % with 1 decimals of accuracy
[23:20:21][D][cover:076]: 'esp_garage_door' - Setting
[23:20:21][D][cover:086]: Command: OPEN
[23:20:21][D][garage:126]: action_open called
[23:20:21][D][main:070]: Template Garage open
[23:20:21][D][cover:170]: 'esp_garage_door' - Publishing:
[23:20:21][D][cover:176]: State: OPEN
[23:20:21][D][cover:186]: Current Operation: IDLE
[23:20:25][D][cover:076]: 'esp_garage_door' - Setting
[23:20:25][D][cover:080]: Command: STOP
[23:20:25][D][garage:138]: action_stop called
[23:20:25][D][main:078]: Template Garage stop
[23:20:25][D][cover:170]: 'esp_garage_door' - Publishing:
[23:20:25][D][cover:176]: State: OPEN
[23:20:25][D][cover:186]: Current Operation: IDLE
[23:20:25][D][cover:170]: 'esp_garage_door' - Publishing:
[23:20:25][D][cover:176]: State: OPEN
[23:20:25][D][cover:186]: Current Operation: IDLE
[23:20:26][W][garage:106]: garage State changed!
[23:20:26][D][text_sensor:067]: 'esp_garage_door_state': Sending state 'error'
[23:20:40][D][cover:076]: 'esp_garage_door' - Setting
[23:20:40][D][cover:086]: Command: CLOSE
[23:20:40][D][garage:132]: action_close called
[23:20:40][D][main:074]: Template Garage close
[23:20:40][D][cover:170]: 'esp_garage_door' - Publishing:
[23:20:40][D][cover:178]: State: CLOSED
[23:20:40][D][cover:186]: Current Operation: IDLE
[23:20:41][W][garage:106]: garage State changed!
[23:20:41][D][text_sensor:067]: 'esp_garage_door_state': Sending state 'closing'
[23:20:46][W][garage:106]: garage State changed!
[23:20:46][D][text_sensor:067]: 'esp_garage_door_state': Sending state 'closed'
[23:21:01][D][cover:076]: 'esp_garage_door' - Setting
[23:21:01][D][cover:086]: Command: OPEN
[23:21:01][D][garage:126]: action_open called
[23:21:01][D][main:070]: Template Garage open
[23:21:01][D][cover:170]: 'esp_garage_door' - Publishing:
[23:21:01][D][cover:176]: State: OPEN
[23:21:01][D][cover:186]: Current Operation: IDLE
[23:21:06][W][garage:106]: garage State changed!
[23:21:06][D][text_sensor:067]: 'esp_garage_door_state': Sending state 'opening'
[23:21:11][D][sensor:126]: 'Temperature': Sending state 15.95000 °C with 1 decimals of accuracy
[23:21:11][D][sensor:126]: 'Pressure': Sending state 1019.51776 hPa with 1 decimals of accuracy
[23:21:11][D][sensor:126]: 'Humidity': Sending state 43.19824 % with 1 decimals of accuracy
[23:21:16][W][garage:106]: garage State changed!
[23:21:16][D][text_sensor:067]: 'esp_garage_door_state': Sending state 'open'
[23:21:18][D][cover:076]: 'esp_garage_door' - Setting
[23:21:18][D][cover:086]: Command: CLOSE
[23:21:18][D][garage:132]: action_close called
[23:21:18][D][main:074]: Template Garage close
[23:21:18][D][cover:170]: 'esp_garage_door' - Publishing:
[23:21:18][D][cover:178]: State: CLOSED
[23:21:18][D][cover:186]: Current Operation: IDLE
[23:21:21][W][garage:106]: garage State changed!
[23:21:21][D][text_sensor:067]: 'esp_garage_door_state': Sending state 'closing'
[23:21:41][W][garage:106]: garage State changed!
[23:21:41][D][text_sensor:067]: 'esp_garage_door_state': Sending state 'closed'
[23:21:45][D][switch:013]: 'esp_garage_door_venting_position' Turning ON.
[23:21:45][D][garage:144]: action_venting called
[23:21:45][D][switch:056]: 'esp_garage_door_venting_position': Sending state ON
[23:21:46][W][garage:106]: garage State changed!
[23:21:46][D][text_sensor:067]: 'esp_garage_door_state': Sending state 'opening'
[23:21:51][W][garage:106]: garage State changed!
[23:21:51][D][text_sensor:067]: 'esp_garage_door_state': Sending state 'venting'
[23:22:06][D][switch:017]: 'esp_garage_door_venting_position' Turning OFF.
[23:22:06][D][garage:132]: action_close called
[23:22:06][D][switch:056]: 'esp_garage_door_venting_position': Sending state OFF
[23:22:10][W][garage:106]: garage State changed!
[23:22:10][D][text_sensor:067]: 'esp_garage_door_state': Sending state 'closed'
[23:22:11][D][sensor:126]: 'Temperature': Sending state 14.64000 °C with 1 decimals of accuracy
[23:22:11][D][sensor:126]: 'Pressure': Sending state 1019.54077 hPa with 1 decimals of accuracy
[23:22:11][D][sensor:126]: 'Humidity': Sending state 48.10449 % with 1 decimals of accuracy
[23:22:15][D][switch:013]: 'esp_garage_door_light_toggle' Turning ON.
[23:22:15][D][garage:150]: action_toggle_light called
[23:22:15][D][switch:056]: 'esp_garage_door_light_toggle': Sending state ON
[23:22:17][D][switch:017]: 'esp_garage_door_light_toggle' Turning OFF.
[23:22:18][D][switch:056]: 'esp_garage_door_light_toggle': Sending state OFF
[23:22:19][D][switch:013]: 'esp_garage_door_light_toggle' Turning ON.
[23:22:19][D][garage:150]: action_toggle_light called
[23:22:19][D][switch:056]: 'esp_garage_door_light_toggle': Sending state ON
[23:22:21][D][switch:017]: 'esp_garage_door_light_toggle' Turning OFF.
[23:22:21][D][switch:056]: 'esp_garage_door_light_toggle': Sending state OFF
[23:22:23][D][switch:013]: 'esp_garage_door_light_toggle' Turning ON.
[23:22:24][D][garage:150]: action_toggle_light called
[23:22:24][D][switch:056]: 'esp_garage_door_light_toggle': Sending state ON
[23:22:24][D][switch:017]: 'esp_garage_door_light_toggle' Turning OFF.
[23:22:24][D][switch:056]: 'esp_garage_door_light_toggle': Sending state OFF
[23:22:26][D][switch:013]: 'esp_garage_door_light_toggle' Turning ON.
[23:22:26][D][garage:150]: action_toggle_light called
[23:22:26][D][switch:056]: 'esp_garage_door_light_toggle': Sending state ON
[23:22:27][D][switch:017]: 'esp_garage_door_light_toggle' Turning OFF.
[23:22:27][D][switch:056]: 'esp_garage_door_light_toggle': Sending state OFF
[23:22:28][D][switch:013]: 'esp_garage_door_light_toggle' Turning ON.
[23:22:28][D][garage:150]: action_toggle_light called
[23:22:28][D][switch:056]: 'esp_garage_door_light_toggle': Sending state ON
[23:22:29][D][switch:017]: 'esp_garage_door_light_toggle' Turning OFF.
[23:22:29][D][switch:056]: 'esp_garage_door_light_toggle': Sending state OFF
[23:22:31][W][api.connection:083]: ESPHome Logs 2022.12.8 (192.168.1.3): Connection closed
[23:22:38][D][switch:013]: 'esp_garage_door_light_toggle' Turning ON.
[23:22:38][D][garage:150]: action_toggle_light called
[23:22:38][D][switch:056]: 'esp_garage_door_light_toggle': Sending state ON
[23:22:39][D][switch:017]: 'esp_garage_door_light_toggle' Turning OFF.
[23:22:39][D][switch:056]: 'esp_garage_door_light_toggle': Sending state OFF
[23:22:43][D][switch:013]: 'esp_garage_door_light_toggle' Turning ON.
[23:22:43][D][garage:150]: action_toggle_light called
[23:22:43][D][switch:056]: 'esp_garage_door_light_toggle': Sending state ON
[23:22:44][D][switch:017]: 'esp_garage_door_light_toggle' Turning OFF.
[23:22:44][D][switch:056]: 'esp_garage_door_light_toggle': Sending state OFF
I’ve just been reading this thread with interest as I’m due to be getting 3 Hormann garage doors - and it’s great to see where we’ve got to. My first thought when I started reading this was that surely a ESP32 would make a better job and avoid the PIC so it’s amazing to see the evolution of this.
I’m not in a position to move forward yet (it’ll be months before my doors are installed) but I just wanted to thank you all in advance for the great work here!
When the time comes, I hope to take this forward a little more and add support for wired ethernet which will hopefully improve reliability (especially the MQTT side). It’s also just occurred to me that I’ll have 3 door motors and that that the ESP32 has 3 hardware UART controllers - you know what I’m thinking, though the cost of this hardware is now so low it’s probably just easier to build 3 (and benefit from some redundancy).
Thanks again for all your work, and I look forward to checking in down the line!
Hey!
An Update from my side. I now have the board integegrated for about two months now and it works great!
I used the MQTT implementation first, however after a week or two it stopped working. I could see the the status updating just fine (if manipulated by my manual open/close switch in the garage) but could not command anything. I feared it would be the weak wifi reception in my garage (I have to install another AP here). However, after I migrated to ESPHome everything works flawless! I even now have the confidence to leave my keys at home when leaving (okay, I have a spare set at the friends house).
I will upload the ESPhome Code to my github. It is modified from @lg2dc and now gives Feedback about the actual state, so you can confirm its closed/open via HA.
I still have some tidying up to do (for example to change the behavior of the light from toggle to ON/OFF), so let me know if anyone wants to have it beforehand.
Hi, I am looking for solution on my supramatic HT motor… which one will work (which protokol to use)?
Hi there (tsaG1337),
I would love to see your modified code. I am rebuilding a board for myself and would love to use the latest working version holding all information.
Thanks in advance.
Best regards,
Chris
I built Stephan’s PCB before i realized that it doesn’t work with my series 4 door. Does anyone have Thomas Dupas’s code for these boards or have i missed someone else making an image for it? Thanks!
@vladimirzrnic did you manage to get @Dr.Pat 's code to work?
I downloaded the code from repository but I am unable to build it using VSCode (and platformio env). I get following errors:
Processing esp32 (platform: espressif32; board: nodemcu-32s; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/nodemcu-32s.html
PLATFORM: Espressif 32 (3.4.0) > NodeMCU-32S
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 @ 3.10006.210326 (1.0.6)
- tool-esptoolpy @ 1.30100.210531 (3.1.0)
- toolchain-xtensa32 @ 2.50200.97 (5.2.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ deep+, Compatibility ~ soft
Found 41 compatible libraries
Scanning dependencies...
Dependency Graph
|-- ESPAsyncWiFiManager @ 0.31.0+sha.3b9a58a
| |-- WiFi @ 1.0
| |-- ESPAsyncWebServer-esphome @ 3.0.0
| | |-- AsyncTCP-esphome @ 2.0.0
| | |-- FS @ 1.0
| | |-- WiFi @ 1.0
| |-- FS @ 1.0
| |-- AsyncTCP @ 1.1.1
| |-- DNSServer @ 1.1.0
| | |-- WiFi @ 1.0
|-- ESPAsyncWebServer-esphome @ 3.0.0
| |-- AsyncTCP-esphome @ 2.0.0
| |-- FS @ 1.0
| |-- WiFi @ 1.0
|-- DallasTemperature @ 3.11.0
| |-- OneWire @ 2.3.7
|-- Adafruit BME280 Library @ 2.2.2
| |-- Adafruit BusIO @ 1.14.1
| | |-- Wire @ 1.0.1
| | |-- SPI @ 1.0
| |-- Wire @ 1.0.1
| |-- SPI @ 1.0
| |-- Adafruit Unified Sensor @ 1.1.8
|-- ArduinoJson @ 6.20.1
|-- EspSoftwareSerial @ 8.0.0
|-- AsyncElegantOTA @ 2.2.7
|-- AsyncMqttClient @ 0.9.0
| |-- AsyncTCP @ 1.1.1
|-- OneWire @ 2.3.7
|-- WiFi @ 1.0
|-- AsyncTCP @ 1.1.1
|-- Update @ 1.0
|-- FS @ 1.0
|-- Ticker @ 1.1
|-- DNSServer @ 1.1.0
| |-- WiFi @ 1.0
Building in release mode
Compiling .pio\build\esp32\src\hciemulator.cpp.o
In file included from C:/Users/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal.h:52:0,
from C:/Users/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:35,
from src/hciemulator.h:4,
from src/hciemulator.cpp:1:
C:/Users/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-uart.h:26:20: error: expected identifier before numeric constant
#define SERIAL_5N1 0x8000010
^
.pio/libdeps/esp32/EspSoftwareSerial/src/SoftwareSerial.h:48:5: note: in expansion of macro 'SERIAL_5N1'
SERIAL_5N1 = PARITY_NONE,
^
C:/Users/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-uart.h:26:20: error: expected '}' before numeric constant
#define SERIAL_5N1 0x8000010
^
.pio/libdeps/esp32/EspSoftwareSerial/src/SoftwareSerial.h:48:5: note: in expansion of macro 'SERIAL_5N1'
SERIAL_5N1 = PARITY_NONE,
^
C:/Users/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-uart.h:26:20: error: expected unqualified-id before numeric constant
#define SERIAL_5N1 0x8000010
^
.pio/libdeps/esp32/EspSoftwareSerial/src/SoftwareSerial.h:48:5: note: in expansion of macro 'SERIAL_5N1'
SERIAL_5N1 = PARITY_NONE,
^
In file included from src/hciemulator.h:6:0,
from src/hciemulator.cpp:1:
.pio/libdeps/esp32/EspSoftwareSerial/src/SoftwareSerial.h:96:38: error: expected class-name before ',' token
class UART : private GpioCapabilities, public Stream {
^
.pio/libdeps/esp32/EspSoftwareSerial/src/SoftwareSerial.h:116:31: error: 'Config' has not been declared
void begin(uint32_t baud, Config config,
^
.pio/libdeps/esp32/EspSoftwareSerial/src/SoftwareSerial.h:119:31: error: 'Config' has not been declared
void begin(uint32_t baud, Config config,
^
.pio/libdeps/esp32/EspSoftwareSerial/src/SoftwareSerial.h:123:31: error: 'Config' has not been declared
void begin(uint32_t baud, Config config,
^
.pio/libdeps/esp32/EspSoftwareSerial/src/SoftwareSerial.h:127:31: error: 'Config' has not been declared
void begin(uint32_t baud, Config config = SERIAL_8N1) {
^
.pio/libdeps/esp32/EspSoftwareSerial/src/SoftwareSerial.h:191:32: error: 'Parity' has not been declared
size_t write(uint8_t byte, Parity parity);
^
.pio/libdeps/esp32/EspSoftwareSerial/src/SoftwareSerial.h:196:54: error: 'Parity' has not been declared
size_t write(const uint8_t* buffer, size_t size, Parity parity);
^
.pio/libdeps/esp32/EspSoftwareSerial/src/SoftwareSerial.h:197:51: error: 'Parity' has not been declared
size_t write(const char* buffer, size_t size, Parity parity) {
^
.pio/libdeps/esp32/EspSoftwareSerial/src/SoftwareSerial.h:288:5: error: 'Parity' does not name a type
Parity m_parityMode;
^
In file included from src/hciemulator.h:6:0,
from src/hciemulator.cpp:1:
.pio/libdeps/esp32/EspSoftwareSerial/src/SoftwareSerial.h:316:1: error: expected declaration before '}' token
}; // namespace EspSoftwareSerial
^
Compiling .pio\build\esp32\src\main.cpp.o
Archiving .pio\build\esp32\lib4a5\libWiFi.a
In file included from src/main.cpp:3:0:
.pio/libdeps/esp32/AsyncElegantOTA/src/AsyncElegantOTA.h:4:2: warning: #warning AsyncElegantOTA.loop(); is deprecated, please remove it from loop() if defined. This function will be removed in a future release. [-Wcpp]
#warning AsyncElegantOTA.loop(); is deprecated, please remove it from loop() if defined. This function will be removed in a future release.
^
Compiling .pio\build\esp32\lib63e\AsyncTCP-esphome\AsyncTCP.cpp.o
*** [.pio\build\esp32\src\hciemulator.cpp.o] Error 1
In file included from C:/Users/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal.h:52:0,
from C:/Users/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:35,
from src/main.cpp:1:
C:/Users/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-uart.h:26:20: error: expected identifier before numeric constant
#define SERIAL_5N1 0x8000010
^
.pio/libdeps/esp32/EspSoftwareSerial/src/SoftwareSerial.h:48:5: note: in expansion of macro 'SERIAL_5N1'
SERIAL_5N1 = PARITY_NONE,
^
C:/Users/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-uart.h:26:20: error: expected '}' before numeric constant
#define SERIAL_5N1 0x8000010
^
.pio/libdeps/esp32/EspSoftwareSerial/src/SoftwareSerial.h:48:5: note: in expansion of macro 'SERIAL_5N1'
SERIAL_5N1 = PARITY_NONE,
^
C:/Users/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-uart.h:26:20: error: expected unqualified-id before numeric constant
#define SERIAL_5N1 0x8000010
^
.pio/libdeps/esp32/EspSoftwareSerial/src/SoftwareSerial.h:48:5: note: in expansion of macro 'SERIAL_5N1'
SERIAL_5N1 = PARITY_NONE,
^
In file included from src/hciemulator.h:6:0,
from src/main.cpp:13:
.pio/libdeps/esp32/EspSoftwareSerial/src/SoftwareSerial.h:96:38: error: expected class-name before ',' token
class UART : private GpioCapabilities, public Stream {
^
.pio/libdeps/esp32/EspSoftwareSerial/src/SoftwareSerial.h:116:31: error: 'Config' has not been declared
void begin(uint32_t baud, Config config,
^
.pio/libdeps/esp32/EspSoftwareSerial/src/SoftwareSerial.h:119:31: error: 'Config' has not been declared
void begin(uint32_t baud, Config config,
^
.pio/libdeps/esp32/EspSoftwareSerial/src/SoftwareSerial.h:123:31: error: 'Config' has not been declared
void begin(uint32_t baud, Config config,
^
.pio/libdeps/esp32/EspSoftwareSerial/src/SoftwareSerial.h:127:31: error: 'Config' has not been declared
void begin(uint32_t baud, Config config = SERIAL_8N1) {
^
.pio/libdeps/esp32/EspSoftwareSerial/src/SoftwareSerial.h:191:32: error: 'Parity' has not been declared
size_t write(uint8_t byte, Parity parity);
^
.pio/libdeps/esp32/EspSoftwareSerial/src/SoftwareSerial.h:196:54: error: 'Parity' has not been declared
size_t write(const uint8_t* buffer, size_t size, Parity parity);
^
.pio/libdeps/esp32/EspSoftwareSerial/src/SoftwareSerial.h:197:51: error: 'Parity' has not been declared
size_t write(const char* buffer, size_t size, Parity parity) {
^
.pio/libdeps/esp32/EspSoftwareSerial/src/SoftwareSerial.h:288:5: error: 'Parity' does not name a type
Parity m_parityMode;
^
In file included from src/hciemulator.h:6:0,
from src/main.cpp:13:
.pio/libdeps/esp32/EspSoftwareSerial/src/SoftwareSerial.h:316:1: error: expected declaration before '}' token
}; // namespace EspSoftwareSerial
^
*** [.pio\build\esp32\src\main.cpp.o] Error 1
========================================================================================= [FAILED] Took 11.03 seconds =========================================================================================
* The terminal process "C:\Users\user\.platformio\penv\Scripts\platformio.exe 'run'" terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.
I don’t know how to move this forward.
Hi @stomko
@Dr.Pat code is working- I have been using it for a few weeks with my Hormann Supramatic 4 and everything works as expected. I use it in the Home Assistant ecosystem and so far there have been no problems. I made the initial hardware setup with a protoboard, but I wouldn’t say I liked it because it looked messy, so I made a PCB.
Initial hardware setup (protoboard):
New PCB:
Home Assistant Dashboard:
The PCBA is not as neat as the @stephan19 because I aimed to use the parts I have on the workbench and avoid making a batch of 5 pieces that would cost me 50$ each.
Thank you @vladimirzrnic . What did you use to compile and upload code to esp? I struggle with this part
I would love to buy one of those board off you!!! Any chance?
I use Microsoft Visual Studio Code with PlatformIO addon. It’s a rather standard installation, and you will not need to manage libraries.
I am happy to share the Gerber file so that you can get it directly from JLCPCB or PCBWay for a few $. I’m sure you already have a NodeMCU with ESP32, TTL to RS485 and LM2596S laying around somewhere. If not, it will cost you an additional $10-$20.
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.
thank you @vladimirzrnic , seems like I could not build it using latest version of EspSoftwareSerial (v.8). I used 6.17.1 and it compiled fine.
The whole thing wasn’t designed to work that way.
- Make the necessary changes to the code (you can leave the //WIFI segment as it is)
- Flash the ESP32 with the @Dr.Pat code
- Restart ESP32
- Connect your phone to AP with SSID “HCPBRIDGE” using password “password”
- 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
RJ12 cable pinout:
- 24VDC (White)
- 24VDC (Black)
- A+ (Red)
- B- (Green)
- GND (Yellow)
- 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.