IoT Hot Water Tank Level Problem


New Member

I'm new. COMPLETELY new. I've written this opener 100 times and I normally say "I've been a lurker for ages". Nope. Totally new. I understand some advanced maths. I have degree in computing. Now that I've bared all, here's the problem.

There's going to be a divorce. When my wife asks me "how much hot water is there?" I struggle. We have a central heating system which heats a storage tank. "Well, the thermostat is off at the moment and it's set to 60 degrees." is sometimes met with "you're just saying numbers at me to get me to shut up!" Which irks me because my wife is a qualitative researcher. Oh, wait a minute. I just "set the scene" again, didn't I?

I've put 6 temperature sensors on my hot water tank. They are equally spaced between (and including) the hot water outlet and the cold water inlet. Most of you will know that hot stuff rises in the same type of cold stuff. All of you will know that the water tank is 100% full of water all the time. Below is a graph of those sensors over a 24 hour period.


Temperature (degrees C) are on Y and time of day is on X. The shape of the graph can be explained as follows. The dips are caused by: 10:12, 10:42, and 11:27, showers were taken. A further shower was taken at 14:23. At 19:31 some dishes were washed. There was a final shower at 20:46. The rise is explained by the boiler coming on at 16:05 to heat the hot water tank. The general downward trend is due to heat being lost to the environment.

The most notable feature is that when hot water is drawn off, the whole tank doesn't get colder; rather the water is drawn from the top, filling at the bottom with cold. So, the spread of temperatures becomes high quite rapidly. notice how purple drops, then blue, then cyan, then green, etc.

So, I pose you the question: How much hot water is there? How do I put a human-graspable number around this. I think Dr. Mrs. kdmcm would settle for "the tank is x% full of water at y degrees".

In English, I think what I want is to find the first pair of sensors which display a large delta. Anything above that is the "hot temperature". Since the sensors are equally spaced, that also gives me the "hot water level".

Does that make sense? Am I off course? How would I find it, when "large delta" is unknown?

I hope you enjoy this as much as me!