In my search for Sonoff alternatives I have found the following:
https://shelly.cloud/shelly1-open-source/
The Shelly 1 looks very interesting as it may fit in existing sockets. It has MQTT support and a well documented rest API. It is also supported by Tasmota firmware. The only problem I see is that they are relatively expensive but that may change with increasing shipping volumes.