In South Africa, our electricity supply is somewhat erratic, due to around 2 decades of under-investment, and incredible levels of corruption. As a result, many residents have resorted to installing solar power, with battery backup to ride out the 2-4 hour "load shedding" periods experienced on a daily basis. As an initial grudge purchase, I was looking for ways to save as much money as possible to shorten the payback period. An obvious candidate would be to reduce the amount of energy imported from the grid to power my resistive element water heater (aka geyser). While there are similar products available locally (search for Geyserwise), they were both expensive, and cloud-based. I wanted a solution that addressed both of those issues.

Geysers in South Africa typically have a 3-4kW spiral element, with a bimetallic thermostat inserted into a dry tube that runs down the middle of the element. This can be set to various target temperatures, by turning the screw on the thermostat. This would be considered a dumb thermostat, because it's not possible to read back the current temperature, nor change the target temperature remotely. The plan was to replace the dumb thermostat with a smart one, and an adjacent relay that would turn the power on and off to maintain the target temperature.

There was one initial change that I got a plumber to do for me, which was to change the existing 3kW element to a 2kW one. This conveniently coincided with a geyser replacement due to a leak, so the plumber was on site already, and the entire geyser was outside of the roof (as a new/replacement unit). This was done because the amount of energy drawn instantaneously by a resistive element cannot be varied externally, except perhaps using a varistor. I was a bit nervous about trying that, especially after seeing comments that it would not be a nice load to drive from an inverter. Swapping the element was simpler in the end, and meant that the load of the geyser and other houshold consumption was usually within the excess solar power generated, and didn't end up drawing from the battery (too much).

Second step was then to find or make a smart thermostat. This wasn't something that I wanted to experiment too much with, as my geyser is in the ceiling, and is either dark, or REALLY HOT to get in there and mess around. I therefore purchased a Geyserwise thermostat, which incorporates a thermistor, and a failsafe bimetallic cutout at 90C. I also looked around to find a suitable smart relay that could interface with the thermistor directly, as I didn't want the relay to be left on, because Home Assistant had crashed, or my wifi was flaky.

One important consideration to be aware of when planning to connect an external sensor to a smart relay is isolation. Many high power smart relays available locally include power measurement, which could be nice to have, but at the same time, are not designed to connect external sensors, and use a non-isolated power supply to the microcontroller. What this basically means is that the ground level of the microcontroller is referenced to the AC supply, and any external sensor connected to that microcontroller is essentially at 220V AC! As a result, devices such as the CBI Astute Smart Isolator and similar devices were excluded from the list.

One device I did find that ticked the boxes was the Sonoff THR320. This has a relay rated at 20A, which is adequate for a 2kW element. It is also designed to talk to 1Wire sensors, to gather temperature and humidity data. Opening it up, I saw a transformer being used to provide an isolated supply to the microcontroller. Perfect!

The THR320 also makes use of an ESP32, which makes it programmable using ESPHome firmware. The only problem was that the pin chosen by Sonoff to interface with the 1Wire sensors sits in the ADC2 peripheral. This is fine for a digital sensor, but the thermistor is analog, and the ADC2 peripheral cannot be used...

Read more »