Show HN: The home automation system with an API 14 years ago
For some advanced use take a look at http://www.ip-symcon.de/
It uses KNX / EIB Bus industrial standards for Home automation, as well as enocean and other 3rd party automation tools.
And it's fully customizable / programmable with php.