I've been working on my own controller for the last several months as a side project (https://github.com/dretay/seneschal) and @daulagari is right... trying to build something end-to-end can be a huge undertaking. I ended up building my own controller mostly because i couldn't find one that integrated all the different IOT devices I'd bought for my house and I didn't want to host my data on another company's computers.
One thing that may not be immediately obvious is how much compute power you will need for your controller. For example i have 8 temperature / humidity sensors and they currently generate about 40,000 readings a month. I ended up having to move my database server off a raspberry pi and onto a desktop because it requires significantly more resources to be able to query / aggregate 10's of thousands of data points than it does to simply store the readings .
Since i just went through this if you do end up building your own controller I'd be happy to answer any questions you may have.