Dumb garage doors are annoying. You cant query remotely if they are open or closed, you cant command it to open or close after you left the house, or setup alarms or automations.
This is my implementation of an smart garage door controller.
substitutions:devicename:garage_doorfriendly_name:Garage Doordeviceplatform:ESP8266deviceboard:d1_miniesphome:name:$devicenameplatform:ESP8266board:$deviceboardwifi:ssid:"YOURWIFISSID"password:"YOURWIFIPASSWORD"domain:".iot.local"fast_connect:truetime:-platform:homeassistantid:homeassistant_time# Enable logginglogger:web_server:port:80# Enable Home Assistant APIapi:password:"REPLACEME"ota:password:"REPLACEME"# show status using the built in LEDstatus_led:pin:number:D4inverted:Truesensor:-platform:wifi_signalname:"${friendly_name}WiFisignal"update_interval:60saccuracy_decimals:0-platform:uptimename:"${friendly_name}uptime"accuracy_decimals:0binary_sensor:-platform:gpioid:garage_doorinternal:truepin:number:D7mode:INPUT_PULLUPinverted:Falsename:"${friendly_name}Sensor"device_class:garage_doorfilters:-delayed_on:20msswitch:-platform:gpioid:relaypin:number:D1inverted:Falserestore_mode:ALWAYS_OFFcover:-platform:templatename:${friendly_name}device_class:garagelambda:|-if (id(garage_door).state) {return COVER_OPEN;} else {return COVER_CLOSED;}open_action:# Cancel any previous action-switch.turn_off:relay-delay:0.1s# Turn the OPEN switch on briefly-switch.turn_on:relay-delay:0.1s-switch.turn_off:relayclose_action:-switch.turn_off:relay-delay:0.1s-switch.turn_on:relay-delay:0.1s-switch.turn_off:relaystop_action:-switch.turn_off:relay-delay:0.1s-switch.turn_on:relay-delay:0.1s-switch.turn_off:relayoptimistic:falseassumed_state:false
2.2 - compile and download the binary
3 - Flash it
3.1 - Connect GPIO0 to ground and plug the usb adapter, after a couple seconds disconnect the GPIO0 from the ground. The esp8266 is now in flashing mode.
3.2 - Flash
3.3 - Restart the microcontroller and check that is connecting to the wifi.