Rolling "difference" sensor or template

Hi all,

I have set up a counter which counts pulses from a watermeter.
To keep track whether the consumption stays below the capactity of my water descaler I need to track the consumption over a rolling 10 minutes.

I have tried the statistics and utility_meters but they don’t provide what I need (or I don’t know how).

I saw the Moving Average filter, but it only provides the average, not a rolling difference. I looked into the code, but I never caught on the OO programming train and it’s just beyond my capabilities to adapt it.

Can anyone help me to tackle this?

How does stats not work for you? Using the stats sensor subtract the min from the max. Unless I’m misunderstanding you.

Hi Petro,

first of all let me thank you for all the time and effort you put in being very helpful on this forum, there aren’t many topics where I haven’t seen your name!

Indeed, I missed the obvious, if I create a template sensor subtracting min from max I have what I need!

Maybe the reason I missed it is since my stat sensor is was not working as I expected it, due to the fact I set the precision wrong.
Also I misunderstood the min_ age and max_age; when seeing it in action it makes sense.

Thanks again!

1 Like