Brent Saltzman


Interested in all things technology with a passion for analog, design, audio, and anything that sparks creativity and imagination.


Monitoring your Sump Pump with Home Assistant

(If you are visiting this page on a mobile device and having an issue seeing the pictures, click here to visit the non-amp version)

With thunderstorm season upon us, I thought it would be fitting to talk about monitoring sump pumps. When I purchased my house one of the first things I immediately wanted to do with my smart home was figure out a way to see if my sump pump was doing it's job and pumping water away from my foundation. Water is the ultimate enemy of your house and the sump pump is the primary method to get that damaging water away from your house.

Why is a Sump Pump important?

The idea is to funnel water around your foundation into a central low area of your house (the sump pit) and then have a pump inside the pit that pumps the water out through pipes to outside where it can drain off into the lawn or sometimes into the street/storm water system. This prevents the water from causing damage to your foundation or worse a leak into your crawlspace, basement, or living space causing mold issues or other damage.

In a nutshell, if you have a sump pump you want to make sure it's working, period.

When I purchased my house the previous owner had a TripleSafe Sump Pump System installed by our local Basement Systems franchise. This blog post is not affiliated or paid for by Basement Systems, but I really appreciate this system for how it is designed, even if it's considered overkill by most people (and I wouldn't disagree either).

So what is it?

Basically my sump pit has 3 pumps in it:

  • A Primary 1/3 horsepower pump
  • A Secondary 1/2 horsepower pump
  • An Emergency 12v battery powered pump capable of pumping 11,000 gallons of water on a fully charged 120Ah 12v Battery

All with seperate discharge lines that eventually make it out to the yard into a single pop-up drain. The two pumps are staggered in the pit as well so the secondary pump will only be engaged if the primary pump has failed or is overwhelmed with water. The two main pumps are also powered by seperate 20A circuits from my electrical panel in the event of a breaker trip. A lot of people will call this overkill, but in a bad thunderstorm scenario where water will be pouring from the sky it's completely possible that the power will fail due to high winds (lookup galloping power lines) and the last thing I want is not to have a pump to get that water away from my house before it begins to backup into my basement.

Here's a cutaway of what it looks like inside, it's pretty crowded in that sump pit!
cutaway of Basement Systems TripleSafe Sump Pump System, used without permission

Cool, so how do you monitor it?

Disclaimer: I take no responsibility for anything you do to your own sump pump. Be smart, sump pumps are critical home defense devices. Water damage can lead to mold, mildew and other health hazards and cause thousands of dollars in damage.

When I first started investigating the system, I noticed the emergency pump controller/battery charger had a pair of connectors that weren't being used. Scouring the internet for an install manual, I found that this connector was for a hardwired alarm system with the intention to trigger an alarm condition if the emergency sump pump was running. We can use this for Home Assistant! (or any smart home platform that supports Z-Wave/any sort of device that can receive a dry contact input)

Just like how I used my favorite EcoLink Z-Wave Door Sensors for my Backyard Gate and Doorbell projects, I used the internal contacts on the door sensor and connected it to these contacts on the pump controller. What I found is that it's a normally open circuit when the pump is in standby and closed (dry contact) circuit when the emergency pump is running.

I wired it up using some spare jumper wires, Velcro'd it to the cable and included the sensor to the Z-Wave network and we were up and running in Home Assistant.

I used a template sensor to make it more human readable in Home Assistant:

sensor sumppumpstate:  
  - platform: template
    sensors:
      sumppumpstate:
        value_template: '{% if 
            is_state("binary_sensor.ecolink_door_sensor_9_0", "off") %}
            Running
            {% else %}
            In Standby
            {% endif %}'
        friendly_name: 'Emergency Sump Pump'

Using some new automations with the Z-Wave Sensor, we can get some notifications now when the emergency sump pump runs!

automation:  
  alias: Emergency Sump Pump Running Alert
  trigger:
    platform: state
    entity_id: binary_sensor.ecolink_door_sensor_9_0
    to: 'off'
  action:
    service: notify.pushover
    data:
      title: Emergency Sump Pump is Running!
      message: The Emergency Sump Pump turned on. 
               Power lost at {{now().strftime("%c")}}

and

automation:  
  alias: Emergency Sump Pump Stopped Alert
  trigger:
    platform: state
    entity_id: binary_sensor.ecolink_door_sensor_9_0
    to: 'on'
  action:
    service: notify.pushover
    data:
      title: Emergency Sump Pump has Stopped
      message: The Emergency Sump Pump turned off. 
               Power restored at {{now().strftime("%c")}}

Here's the end result using Pushover as my notify platform of choice:

Awesome! But isn't it unlikely that the Emergency Pump will turn on?

It's true, there's got to be a significant amount of water AND with no power during the event for the Emergency sump pump to activate. It's entirely plausible that by the time this occurs the UPS batteries that power my Home Assistant server, network switch, router, and ISP modem will also be depleted and so Home Assistant won't be able to notify me anyway. See at the bottom for some ideas around this.

I still want to be aware of my sump pump and make sure it's running when it needs to. Home Assistant can still help with that. I found the TP Link HS110 Smart Switch with Energy Monitoring and it integrates really nicely into Home Assistant and lets me pull all of the energy usage data out so I can use it to drive notifications and other automations.

Connect your TP Link HS110 in-line with the primary sump pump power connection like this:
TPLink HS110 inline with pump

Add the TP Link switch to Home Assistant following the directions on the integrations page. I went ahead and created a new template sensor to seperate the wattage value from the attributes of the switch itself.

sensor:  
  - platform: template
    sensors:
      sumppump_watt:
        value_template: "{{ states.switch.sumppump1.attributes.current_power_w }}"
        unit_of_measurement: 'watts'
        friendly_name: 'Sump Pump Current Power'

And we end up with a sensor like this:
sump pump wattage sensor card

The thought here is that when the pump is activated by the float switch, it's going to draw current and that will be picked up through the TP Link HS110. I'm really using it like a Kill O' Watt here in this case, I never want the switch to ever be turned off as that would prevent the pump from running all together (see more on this below). We can use the reading from the energy sensor to know when the pump turns on and when it turns off and create automations like below:

automation:  
  alias: SumpPump Running
  trigger:
    platform: numeric_state
    entity_id: sensor.sumppump_watt
    above: 2
  action:
    - service: notify.pushover
      data:
        message: "Sump Pump is running"

and

automation:  
  alias: SumpPump Stopped
  trigger:
    platform: state
    entity_id: sensor.sumppump_watt
    to: '0.00'
    for:
      minutes: 1
  action:
    - service: notify.pushover
      data:
        message: "Sump Pump Stopped!"

That's all there is to it! When the TP Link HS110 sees an energy draw of over 2 watts, it'll send me a notification in Pushover that the pump is running and then when the wattage draw drops back down to 0 for at least a minute, It will alert me using Pushover that the Sump Pump has stopped running.

But what if the TP Link Smart Switch gets turned off?

First off, a second disclaimer: I take no responsibility if you follow this blog post and use a TP Link HS110 to monitor your sump pump and then you find that your sump pump has no power for whatever reason- this is totally possible and you need to take every precaution that it doesn’t happen to you.

In my case I'm not that worried because I have a secondary pump on a completely independent circuit without a TP Link switch on it. So be wise and don't do anything that will put your sump pump in jeopardy.

That said, Home Assistant to the rescue once again!
You can make a very simple automation that will ensure that the switch is turned on all the time:

automation:  
  alias: Keep Sump Pump Switch on
  trigger:
    platform: state
    entity_id: switch.sumppump1
    to: 'off'
  action:
    service: switch.turn_on
    entity_id:
      - switch.sumppump1

If Home Assistant ever sees the state of the switch change to the "Off" state. Home Assistant will simply turn it back on.

Internet and Power Outages and What's next?

I mentioned above that if the power is out, it's possible that the UPS that supports my home network, internet connection, and Home Assistant server could also be shut down by the time the emergency pump needs to run. Obviously there are methods to use a cellular service connected to a device to also alert you, but these are often very expensive at $200+ not including the monthly cellular service from Verizon, Sprint, or AT&T. I'm really not keen on paying a fee for this connectivity (Or spending over $200 on a device for this), especially for this limited purpose in the event of a catastrophic storm in which case, I hope I'm already safe at home anyway so I would be able to take needed action.

That being said, as a amateur radio operator I could see how APRS could play a role here. It could broadcast telemetry about my emergency pump's status and battery charge over the 2M radio band using an inexpensive FM transceiver and a TNC which would be picked up eventually by a local I-Gate and would appear on aprs.fi similar to how Weather Stations show up. This is common for monitoring radio tower equipment rooms from afar. Things like temperature, humidity, voltages, are all things that are easy to transmit over APRS packets. Sure there's an FCC license barrier here, but it's an easy test to study for and there's a ton of online resources to help.

That's all there is to it! Be safe and happy sump pump monitoring!

More information on the TripleSafe System from Basement Systems can be found here

Check out my other posts on Home Automation and other Smart Home technologies here!

Previous Post |