Hello,
i´m quite new to HA migrating from openHab so please bear with me.
I have a cistern with uneven walls. In the cistern there is a KNX sensor where i get readings of the pressure in mA. I already calculate the height of the water level with this template
{% set max_height_waterlevel = 1200 %}
{% set mA_at_min_waterlevel = 4 %}
{% set mA_at_max_waterlevel = 11.90 %}
{% set measured_mA = states('sensor.fullstand_zisterne') | float %}
{% set height= (max_height_waterlevel / (mA_at_max_waterlevel - mA_at_min_waterlevel) * (measured_mA - mA_at_min_waterlevel))%}
{{ height | round(0, default = 0)}}
Now my next step would be the volume in liter. For that i have a literingtable of the cistern from the manufacturer
Now im missing the step how to calculate the volume. I found a lot of examples with ESPHome where i can define datapoints etc. but now im stuck, maybe you can give me a hint how i can solve this issue.
Thanks for the idea, but especially at lower heights the steps in volume are pretty big which is not accurate enough. i know the calculation is not that easy.
But then again when the tank is more than half full then I guess the accuracy isn’t that important.
It’s odd that it worked with the extra comma there. But it also seems it didn’t make any difference.
I guess that’s the only place in yaml where it doesn’t matter if you make an error
Yeah it would show up as a list of 3 elements with the third element being null. petro’s code would only need to look at the first two elements, so any further elements in the list would be ignored.