Water Heater "mod"/relay suggestions

Hello to everyone both the helpful and the helpless,

I am in the process of having solar installed which has led me to start thinking about using my water heater(s) as a kind of battery (eg. overheat them when solar is available, set thermostat to minimum when little to no solar generation).

Now one possibility is to replace currently two water heaters with one bigger unit that has a decent API (if such a unit exists) although looking at Rheems documentation threw up more “missing resource” errors than actual information on what you could do with their “econet”.

This has made me think that a simpler solution will be to find a way to grab the water temperature and control the element (eg. take over what the thermostat is statically doing for me with a dynamic option).

Rather than reinventing the wheel I wanted to throw the question out to the masses for assistance:
“How are you currently controlling your Water Heater, and/or how do you think the best way to control it would be?”

Assume that I have the google skills… I mean electronics knowledge… to understand what “Part A” does, assume also though that I do not know if I have a “Part A” I will also need two "Part B"s (obviously not real examples).

It seems that I’ve seen good water heater with a decent API somewhere here https://cosyhousehold.com/best-gas-tankless-water-heater/. And prices there are quite acceptable.