Water tank level addon - which one

getafix33

Expert Member
Joined
Nov 16, 2006
Messages
1,808
Reaction score
90
Hi

I have just completed my 2 x 5000l tanks and am looking to integrate into HA a way to monitor the water level. One caveat, is that it needs to be WiFi.

What is the most reliable option?

Kind regards
 
ESP32 and either a pressure sensor or ultrasonic sensor.

Pressure Sensor: Pressure Sensor

Ultrasonic Sensor: Ultrasonic Sensor

With the ultrasonic sensor, it isn't stated but I have experienced possible limitations to the max distance it can read but it is much cheaper and farely accurate.

If going this route, here's a workable code for the device but is specifically for that Ultrasonic sensor so if using any other you may need to change it.

Code:
esphome:
  name: CHANGE_ME
  friendly_name: CHANGE_ME
esp32:
  board: esp32dev
  framework:
    type: esp-idf

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "INSERT KEY"

ota:
  - platform: esphome
    password: "INSERT PASSWORD"

wifi:
  ssid: INSERT SSID
  password: "INSERT PASSWORD"

external_components:
  - source:
      type: git
      url: https://github.com/toadee/esphome-a02yyuw-uart
      ref: main
    components: [a02yyuw_uart]

time:
  - platform: sntp
    id: sntp_time
    timezone: "Africa/Johannesburg"

# -------- UART wiring (recommended pins) --------
# Sensor GREEN (TX) -> ESP32 GPIO16 (RX)
# Sensor BLUE  (RX) -> ESP32 GPIO17 (TX)
uart:
  id: uart_a02
  tx_pin: GPIO17
  rx_pin: GPIO16
  baud_rate: 9600

sensor:
  - platform: a02yyuw_uart
    uart_id: uart_a02
    name: "Water Distance"
    id: water_distance
    unit_of_measurement: "m"
    accuracy_decimals: 3
  - platform: template
    name: "Water Level"
    id: water_level_percent
    unit_of_measurement: "%"
    accuracy_decimals: 1
    update_interval: 1s
    lambda: |-
      const float full_distance_m  = 0.1;  // set the value to your specific need which is distance from sensor
      const float empty_distance_m = 1.64;  // set the value to your specific need which is distance from sensor
      float d = id(water_distance).state;
      if (isnan(d)) return NAN;
      if (d < full_distance_m) d = full_distance_m;
      if (d > empty_distance_m) d = empty_distance_m;
      float pct = (empty_distance_m - d) * 100.0f / (empty_distance_m - full_distance_m);
      if (pct < 0) pct = 0;
      if (pct > 100) pct = 100;
      return pct;
 
Being Tuya it will definitely “phone home” - you might be able to use Local Tuya / TuyaLocal on it in HA if it’s supported

I’m also looking for a solution so keen to hear your experiences.
 
I want to measure the water level of my tank and also switch my borehole pump.

So far the plan is to use a Shelly plus Uni with a pressure sensor and two float switches.
Is everyone still happy with that throw in sensor from DF Robot or is something else recommended?

From what I read, it will be best to use a pressure sensor with a 0 to 10v range with the Shelly Uni, so I will have to get a converter as well.

I'll be installing two float switches, one at the bottom of the tank to start the pump and then another at the top to stop the pump, they will be connected to the 2 digital inputs on the Uni.
 
Top
Sign up to the MyBroadband newsletter
X