You need to be aware that if left on all the time, the ESP8266/Sonoff generates over 200mW of heat 70mA at 3v3) which means that the temperature sensor cannot be located close to or in the same small enclosure, otherwise you will get incorrect readings. If it’s a sensor only system then you might get away with using the sleep mode of the ESP8266 and wake it up every 10 minutes say, but that’s no good if you want to remotely activate the relay in the Sonoff.
This weekend, I installed a Sonoff to control my heating and wanted to keep the existing electronic thermostat as a backup and because it displays the temperature. This was initially in the lounge but was changed long ago to the hall by drilling a hole through the wall. The plastic cover over the old ‘hole’ is now convieniently covered by a picture.
The old hole now contains the Sonoff and a DHT22 sensor (connected to the spare pin on the 5 way connector) is inside the thermostat on the other side of the wall. The standard room thermostat cable in the UK is 4 wire (live, neutral, heating on and earth) so it was easy to power the Sonoff and connect the relay output in parallel with the existing thermostat.
Works well so far. The next job is to write a widget/rules to allow different temperatures for different times of the day.