Today, well discuss an automation project with ESP32 as a Web Server! Well use ESP32 to display a page with temperature, humidity, and buttons to change the state of relays. Well use the MCP23017 to increase the number of pins available in the ESP, which allows us to connect up to 128 relays.
I want to point out that in this video you will realize that it is not worth doing a project using the ESP-01 with Arduino Mega, as previously shown in the video, Arduino Mega + WiFi = Automation. I had done that specific video at the request of several followers. In my opinion, the ESP32 is much better, due to the total control that this microcontroller gives you.”

Link