Water Tank Level Indicator with Low Level Warning Notifications

Hi,
I trying multiple code, your code seems impressive . My Tank is rectangle how do i calculate the volume. I tried diff formula not sure its occurate. Can you help me with it.