So today I spent some time getting an ESP32 interfacing with a relay board. I worked through a few frustrating hours of trying to determine why the ESP32 would work fine when plugged up to my MacBook Pro via USB, but when I used a power supply or stand-alone USB power brick, the thing wouldn't boot.
After searching for an answer, I ran across
this post which worked for me.
Using
HomeSpan and the
MQTTPubSubClient libraries, I now have a garage door controller that can open and close the door, as well as sense whether it's opened or closed. This works just like the Insteon I/O Linc controllers I was using, except I have 4 relays on on board, and am currently using two for two garage doors.
The HomeSpan library gives me a built-in HomeKit bridge, so I don't need to use an Indigo-based plugin like HomeKitLink. With FlyingDiver's MQTT Shim and related plugins, I have an Indigo device that tracks the state of the door, and an action that publishes an MQTT message to toggle the door so it will close when open, or open when closed.
Here's a photo of my home-brew: