South Africa’s biggest forum. Discuss, discover, and connect with thousands of members.
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;
Have a look at @Muttley 's project : https://powerforum.co.za/topic/28122-measuring-the-water-level-in-my-jojo-tanks-in-ha/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
Another plus one for this project. I have built and installed it in my one tank and have had no issues. The other tank still has the ultrasonic sensor and is just a frustration with readings all over the place.Have a look at @Muttley 's project : https://powerforum.co.za/topic/28122-measuring-the-water-level-in-my-jojo-tanks-in-ha/