I’ve got a Wemos d1 Mini connected to my Hörmann Promatic 3 Garage door and am a bit stuck on implementing the cover within ESPHome…
The Garage Door has the typical “one-button-interface” for up-stop-down. I’m using 3 Relays as binory_sensor for detecting “Door fully closed”, “Door closing” and “Door opening”. I’d like to somehow chain some commands under open_action and close_action depending on the current state of the door (e.g.: door was closing, someone triggers open_action >>> button has to be pressed twice with a short delay inbetween)
This is the current code:
globals:
- id: last_direction
type: int
restore_value: false
initial_value: '2'
# 2= Neustart, 1=oeffnen, 0=schliessen
binary_sensor:
- platform: gpio
name: "garage_door_closed"
id: garage_door_closed
pin:
number: GPIO12
inverted: true
mode:
input: true
pullup: true
- platform: gpio
name: "garage_door_opening"
id: garage_door_opening
pin:
number: GPIO13
inverted: true
mode:
input: true
pullup: true
- platform: gpio
name: "garage_door_closing"
id: garage_door_closing
pin:
number: GPIO14
inverted: true
mode:
input: true
pullup: true
switch:
- platform: gpio
name: "Blue_LED_State"
pin:
number: GPIO2
inverted: true
mode:
output: true
pullup: false
- platform: gpio
name: "Relais_Pushbutton"
id: relais_pushbutton
pin:
number: GPIO5
inverted: true
mode:
output: True
open_drain: True
on_turn_on:
- delay: 300ms
- switch.turn_off: relais_pushbutton
restore_mode: ALWAYS_OFF
cover:
- platform: template
name: Garagentor
id: garatentor
lambda: >-
if ( id(garage_door_closed) ) {
return COVER_CLOSED;
} else if ( !id(garage_door_closed) && !id(garage_door_closing) && !id(garage_door_opening) ) {
return COVER_OPEN;
} else if ( id(garage_door_closing) ) {
return COVER_OPERATION_CLOSING;
} else if ( id(garage_door_opening) ) {
return COVER_OPERATION_OPENING;
} else {
return COVER_OPERATION_IDLE;
}
open_action:
- switch.turn_on: relais_pushbutton
close_action:
- switch.turn_on: relais_pushbutton
stop_action:
- switch.turn_on: relais_pushbutton
optimistic: true
