I installed Loxone[1] when we built a house and can recommend it. Works right out of the box with web and mobile apps and has multiple APIs to hack with. Only (minor) downside is that you need a VirtualBox for the (otherwise good) configuration software if you're not on Windows.