So the ESP is going into deep sleep as expected and wakes up when i press the button - so far so good.
i did set up a Automation where i increment a Counter for every press of the button. Works fine when ESP is awake, but desn’t recognize the press that woke up the ESP.
If it’s an ESP32, you can use wakeup_cause to determine if the button push did the wake. You would then increment your counter. If it’s an ESP8266 then I don’t know of a way.
If the ESP is in deep sleep, it will not be connected to HA, and nothing you do in HA will wake it. You either have to wake it with a physical thing connected to the ESP (i.e. the thing you have on GPIO2) or via a schedule that is set on the ESP in the deep sleep config.