The Sonoff S22 is a good candidate for reprogramming, with the bonus option that it supports external temperature+humidity sensors.
You can definitely achieve the same functionality cheaper with a ESP8266 breakout + shield, but this way you get a nice case that can just sit on a socket.