Or use this http://sonoff.itead.cc/en/products/sonoff/sonoff-4ch
(Buy for example from banggood)
Din Rail Mount with Tasmota firmware (mqtt controlled)
https://github.com/arendst/Sonoff-Tasmota/wiki
and here
ITEAD Sonoff switches and sockets - cheap ESP8266 Wifi+MQTT hardware