Utility meter for increasing/decreasing deltas only

I have sensor which reports tank volume (so the value can increase or decrease). I would like to create consumption sensor for it. That means I would like utility meter to add only deltas which are negative. For example if I have readings: 100l, 70l, 120l, 110l - consumption should be 30l + 10l = 40l
How can I achieve this?

Or with other words is there any way to achieve this directly with utility meter or I need to have additional sensor for negative delta?

For my tank I use statistics for delta

And then if you only want only negative numbers perhaps a template on the statistics entity.

I have a flow gauge display on the delta (instant flow l/min). Also you can run automations on delta if a leak is detected (my pipes are permanently pressurised).

And then for your question, a utility meter on the final template entity (so only outflows).

1 Like