The hardware
The sonoff can be bought on ebay for between 4 and 5 euro. The only thing that needs to be done is to solder a 5 pins header on the board. This allows it to be connected to a computer via usb to serial converter. This connection is needed to flash new software on the Sonoff.
In case you would like to make use of a sensor you shoud buy this too. The software provides compatibility with the most popular sensors for arduino.
hardware
The software:
The software for this Sonoff is developped with the arduino SDK. The latest Sonoff model has a new flash memory chip that is only flashable in de DOUT modus. Took me hours to find this out.
It took me a lot of time to find a save method for the ota software update function. It has to be impossible to install malicious software by unauthorized people. The current situation is that the update function is only available when the switch is secured with a password. This means that only when we have the password or there is fysical access to the switch, software updates are possible. Furthermore, only links to hansiart.mooo.com are accepted.
Also there is a possibility to choose no sensor, a DHT22 a DS18B20 or a BME28. If you are only interested in the temperature, a DS18B20 would be good. This makes thew total costs lower.