If you are sure about the custom ESP side, the simplest is MQTT.
Otherwise, Tasmota, which benefits from a dedicated integration in Gladys.
When there will be a management of authentication tokens, you will be able to do Wi-Fi directly.
You can vote for the feature