I’m trying to understand how much water enters my rain water tanks, ie it’s rained and they are filling, to understand that it’s actually rained (so not to water the plants etc) and also to see how much water I’m using rather than just net loss/gain.
For example, if I have 1000 litres of water in the tank, it rains and it fills to 2000 L and then I use 900 litres, I want to know it filled by 1000 L and not by 100 L. Or to put it another way, the increase/+ve only amount.
I’ve seen a few threads on this but still unsure if there is a straight forward way of showing the increase only.
I have a sensor that measures the water volume; sensor.water_volume
So, it seems you can use; (trigger.to_state.state | float - trigger.from_state.state | float) }}
OR
{% set current_value = states(‘sensor.water_volume’) | float(0) %}
{% set previous_value = states(‘sensor.previous_water_volume’) | float(0) %}
{% set increase = current_value - previous_value %}
And others, but all seem quite laborious, setting input number sensors, and I feel I’m missing an obvious trick here.
e.g. you could be using 100L at the same time it fills 100L, net change = 0 and you have no way of detecting this.
That is a contrived worst case example but it applies for different fill and use rates at the same time. This will introduce enough error to make your sensor useless.
Yes I understand that. However, flow out is generally a consistent fall over the day & flow in is during a storm etc which for for that duration, would give a significant volume increase. So the question is what is the best way to record Only an increase of a sensor rather than net gain.
But you’re right, maybe a flow rate valve on the exit pipe might be the best and most accurate way to determine flow in and flow out by comparing to the volume change.
The sensor measures volume of water in the tank, it’s a pressure gauge not a flow gauge. It goes up when it rains and down when I use it. I just want to show how much volume has gone in. If it goes up by 1000 litres in an hour and I use 1000 litres in the next 23 hours, I want to show 1000 litres and not a net result of nil.
Its a standard residential water tank (15,000L) with leaf guard etc with multiple water inlets.
Measuring that is problematic. However, if you know the volume and flow out (which is a standard 50mm-ish pipe which you could fit a flow gauge to) you can easily workout the flow in.
However, for now I just have the volume of water volume.