Monitoring your sump pump level with Home Assistant
You can easily monitor your sump pump to determine:
- What's the current water level?
- How often is the pump going on?
- Is the pump working?
To accomplish this task we use an ultrasonic range finder sensor. We can then measure the distance from the sensor to the top of the water level:
By examining the history of the level we can determine how often the pump runs (or if it is running at all). This data can then be used to create alarms indicating issues. For example, Here's the graph during a heavy rain storm where we can see the sump pump runs almost constantly. Only a couple minutes after the pump drains the pit the pit fills back up and the pump has to run again.
What you'll need:
- Ultrasonic Range Finder Sensor
- WiFi Board like the ESP8266 D1 Mini
- Hook-up wire, or contact us to pre-connect the devices for you
Here's the sensor wire-tied to the discharge pipe pointing down into the pit.
You'll notice there are two pumps in this pit: A primary AC powered pump and a DC powered backup pump. In a future post we'll show how to automate the backup pump.
ESP Home YAML
The ESP Home Code is trivial:
# Enable fallback hotspot (captive portal) in case wifi connection fails
ssid: "Sump Pump Level Fallback Hotspot"
# Enable logging
# Enable Home Assistant API
- platform: ultrasonic
name: "Sump Pump Ultrasonic Level"
Automation to notify if the level is too high.
We can then create an automation in Home Assistant to send a notification if the water level is too high. Here' we check if the sensor value is < 0.25M for > 2Min (the pump kicks on at about 0.27M). The automation then shuts down for 2 hrs before restarting and checking again.
- type: value
- service: notify.mobile_app_iphone
message: Sump Water Level is Too High
title: Sump Warning
- service: automation.turn_off
- delay: '02:00:00'
- service: automation.turn_on