I’ve seen folks make sensors that could tell water level using a conductivity sensor, but I wanted one that was independent of the bowl, couldn’t be inadvertently knocked out of the bowl by excited dogs, and allowed the bowl to be cleaned easily. I figured since water is 1kg per Liter, it should be easily monitored with a load sensor.
So, I grabbed some load sensors, HX711, and an esp32 and viola! a dog bowl sensor that will not only let me monitor things on the dashboard, but I have an automation that will push a critical alert to me and flash an indicator light if the water gets below 10% level.
I started with two platforms made of bamboo cutting boards because the water bowl is on an uneven waterproof mat on my floor. Sandwiching the load sensors between the rigid boards would give me an even weight distribution.
I wired up four sensors, one in each corner of the platform, following the wiring diagram from circuitjournal. Hot glue kept everything in place
Then I wired it to the HX711 and wired them to my esp32, putting them in a small project box for neatness.
To keep the two platforms aligned, I used three pass-through pins so the dogs wouldn’t knock the sandwich apart.
esp32 code was super basic, here is the important part. I calibrated the sensor to read an empty bowl as 0 and a full bowl as 100 using calibrate_linear.
# Dog Dish configuration entry
sensor:
- platform: hx711
name: "dogBowl Weight"
dout_pin: 25
clk_pin: 26
gain: 128
update_interval: 60s
filters:
- calibrate_linear:
- -83000 -> 0
- -163800 -> 100
unit_of_measurement: percent
accuracy_decimals: 0
# Uptime sensor.
- platform: uptime
name: dogBowl Uptime
update_interval: 600s
# WiFi Signal sensor.
- platform: wifi_signal
name: dogBowl WiFi Signal
update_interval: 600s
My automation is super basic: if the bowl is below 10% for 10 minutes, it sends me a critical alert and starts blinking the alert light incessantly. I put in the 10 minute delay to allow for pulling the bowl from the sensor for refilling it.
alias: dog water critically low
description: ""
trigger:
- platform: numeric_state
entity_id:
- sensor.esphome_web_8888d0_dogbowl_weight
for:
hours: 0
minutes: 10
seconds: 0
below: 10
condition: []
action:
- service: notify.mobile_app_phonename
data:
message: Hey, the dog water is critically low
title: Dog Water Low!
data:
push:
interruption-level: critical
- repeat:
sequence:
- service: light.turn_on
metadata: {}
data:
flash: long
target:
entity_id: light.alert_light
- delay:
hours: 0
minutes: 0
seconds: 20
milliseconds: 0
until:
- type: is_value
condition: device
device_id: device
entity_id: dogbowl_entity
domain: sensor
above: 30
mode: single
Then a basic gauge on the dashboard:
type: gauge
entity: sensor.esphome_web_8888d0_dogbowl_weight
name: Water Dish
min: 0.4
max: 100
needle: true
segments:
- from: 0
color: red
- from: 10
color: '#edde5e'
- from: 30
color: '#32d0fa'
unit: '%'