Water Level Tank monitor

Hi … Someone might be able to help… I have an M5 stack Atom light and a 5 psi pressure sensor… Seem am not getting the right results … Am thinking maybe the calculation is not correct … I have a small tank 350 L …Height 1143 mm and Diameter 589.28 mm which according to the video on YouTube this is very important… Not sure from the code provided where to input the Height and Diameter or how to get the math to work for me

sensor:

  • platform: template
    sensors:
    waterput_volume:
    value_template: >
    {% set radius = 0.5 %}
    {% set height = 2.5 %}
    {{ ((3.14159265359 * radius * radius * height) * 1000) | round 0) }}
    unit_of_measurement: l
    friendly_name: Syl WaterTank Volume
    Syl_Water_tank_liters:
    value_template: >
    {% set voltage = states(‘sensor.waterput_voltage’) | float %}
    {{ ((voltage - 0.41) * 1800) | round(0) }}

sensor:

  • platform: adc
    pin: 33
    name: ${friendly_name} Voltage
    update_interval: 30s
    icon: “mdi:water-percent”
    accuracy_decimals: 5
    attenuation: 11db
    filters:
    • median:
      window_size: 200
      send_every: 10
      send_first_at: 4
1 Like