I can't say about using proprietary, premade devices like Nest, but if you're willing to use Arduinos/ESP8266/whatnot and do a bit of programming you can use an OpenWRT-based router to run an MQTT-broker, or you can use a separate device like e.g. a Raspberry Pi for that and then Arduino/ESP8266/whatever for toggling of relays or logging power-consumption or temperatures or whatever you want automated. You don't actually have to connect any of the stuff to the Internet at all, or you can use an MQTT-client over an SSH-tunnel, or write your own front-end using Apache2 and PHP or a billion different other ways if you want it reachable from the Internet, too -- you have full control over what can and what can't be done over the Internet or if any of it can be accessed from the Internet at all.
This is, however, obviously the hard, DIY way of doing it. If you want an easy plug-and-pray system I have no idea if there even exists anything that doesn't share your stuff with 3rd parties. I, not-so-surprisingly, am in favour of the hard way that doesn't share everything with random, greedy 3rd-parties.