I pretty much based my home automation on Sonoff devices. I use Espurna and it's fantastic, and I wrote a small server for updates. I compile my custom firmware (so I don't have to set up new devices all the time, I just flash and they're ready), drop it on a directory on my NAS and all the devices in the house automatically update themselves.