esp8266 as countdown timer to control relay

did you see the BlinkWithoutDelay example?