I have an electric water heater with a manual thermostat dial that you turn to set the temperature of the water. I’m looking to turn it into a “smart” water heater so I could set the temperature from HA to save electricity when it’s a warmer day and I wouldn’t need as much hot water. That way, during cold days when I would need more hot water it wouldn’t run out so quickly when I shower, and during hot days it wouldn’t need to heat the water that much.
After very carefully opening up the water heater, I found the thermostat to be very rudimentary which means that turning it “smart” would be pretty easy to do safely. It’s an enclosed unit with a temperature sensor and a thermostat dial that just sticks to the tank to detect temperature and then switches on and off the 220V to the heating element according to temperature set by the dial.
The thermostat looks like this (I googled the photo):
I figured I would stick a Dallas DS18B20 to the tank for “Hot Water Temperature” and another Dallas DS18B20 to the input valve for “Cold Water Temperature”. I would then run the 220V going to the heating element through a relay. That way, I’m not bypassing the internal thermostat because the maximum temperature would still be regulated by the internal thermostat. So I’m not risking any damage from overheating the water beyond the designed specification.
During operation, I would set the thermostat dial to maximum and let ESPHome and/or Home Assistant switch on and off the heating element if the target temperature is below the maximum temperature possibly achieved by the water heater. So let’s say the water heater goes up to 60⁰C, and it’s a hot day so I set the target temperature to 45⁰C, then the relay would would turn on and off the heating element to maintain that 45⁰C. The internal thermostat would “think” that it’s heating to the maximum temperature because it supplies power to the heating element, but since power to the heating element is fed through a relay, in reality the heating element is maintaining the 45⁰C as regulated by ESPHome/HA. But let’s say it’s a cold day and the water heater could only go up to only 55⁰C, then the relay would stay closed all the time and the heating element would behave according to the internal thermostat.
The truly “smart” feature that I plan to build is the ability to automatically adjust the target temperature according to the temperature of the "Cold Water Temperature”. During cold days, the "Cold Water Temperature” would be lower so the target temperature would be set to a hotter temperature. But if it’s a hot day, the "Cold Water Temperature” would be higher so the target temperature would be set lower temperature.
I plan to use ESPHome on a Wemos D1 Mini. Now, I’m still not sure how I should proceed with programming the thermostat. I don’t know if it’s better to use ESPHome’s Bang Bang Controller or Home Assisant’s Water Heater Integration. I usually would prefer the thermostat to be programmed directly to ESPHome so it still works in case my HA goes offline, but I figured HA’s water heater integration would be more suited since it’s an actual water heater controller as opposed to a generic thermostat. Or is it just the same? I did try out HA’s Water Heater integration using the demo platform, but I found no difference compared to if I had used ESPHome’s Bang Bang Controller.
Sorry for the long post, I figured this is all necessary to properly give you all an idea of what I’m trying to accomplish. Thanks fellas!
ETA: Various minor wording corrections to make the explanation more coherent.