My thermostat died (this is becoming a running joke, but it's true) so I replaced it with about $20 in parts and the result is infinitely better than the original.
There aren't a lot of specifics there. The hardware is basically the same as my dishwasher controller, so see that for most of the specs. I used a different power supply here (24VAC input instead of 120) and an I2C temperature sensor.
The software I made for it is fairly specific to my personal home automation environment (I use python and trio) so not likely too useful to others, but that part didn't take long and I'm sure one could write an mqtt based controller fairly easily.
The main reason I'm posting this at all is just to demonstrate that all you need to make a perfectly functional thermostat is a bunch of relays, which these days can be set up for a few bucks and very little work.