Right now there aren't any systems that do it all well, so you want to just pick the best tools for each job, then glue it together with a hub.
A surprising number of things have relatively IP interfaces, so in my house I scripted it all together by writing http://route.io/ - this lets me do things like control Sonos from my lightswitches, unlock my house when I walk up to it, or turn off everything with a single command.