A water level monitoring system for homeassistant using esphome and ultrasonic sensor.
Measure the following: MAX --> Distance from sensor to the max water level in CM. MIN --> Distance from sensor to min water level in CM.
Calculate M: M= 100/(MIN-MAX)
Expression: M(MIN - (X*100))
Example: Say MAX is 10cm and MIN is 120cm
M= 100/(120-10) = 0.9
So the expression will be: 0.9(120- (X*100))