While a Raspberry Pi thermostat isn't exactly novel, this particular project was designed with extensibility in mind, so you can easily build any service to communicate with your heating thermostat. The API is exceedingly simple and easy to use. Two relays superficially control an older thermostat by simulating button presses.
So for this project you do probably need a remote thermostat control that has buttons on it. I'm thinking the same could be applied for hot water heaters too. In my own case our house did not have one of these for the hot water heaters, so I had fitted a Geyserwise device that essentially does what the button thermostat does (with timers). This project could smart-enable that device of mine to be controlled from my smartphone. One advantage would be being able to determine remotely when the water has reached my desired temperature (although walking back and forward to check is probably healthier).
This is a spring boot and react software designed to run on a raspberry pi and retrofit to any thermostat. - geektechniquestudios/RPI-Retrofit-Smart-Thermostat