Shameless plug for Home Assistant, here. Everything is controlled locally (unless you pay for their internet pass through service which is basically just a relay), most brands of smart devices are supported, you have extreme customization capabilities, and it's all open source.
Plus, it can run on pretty much anything.