Interesting. I was going to just put a pause on the accumulator at that point. I’ll ponder the consequences.
I’m getting a “catch up” at the end of my hot water run because I take the really hot water in the pipes and pump it round the radiators. It’s only a couple of minutes, but it seems to be working (well, so far in the Winter anyway!)
With your algorithm it gives you a good behaviour even if the hot water runs for a longer time for some reason then the accumulator will keep driving down and trigger the space heating soon after. By using the “difference” from before the hot water came on they are essentially extrapolating the behaviour over the time of the hot water production so it doesn’t get confused by the exciting flow temp. It’s a good strategy which is working nicely because the changes that would disrupt the extrapolation, such as outdoor temp changes, won’t be very large over a 10 or even 30 minute period.