Looking for ideas on how to monitor and shut off a well pump

Hi all… I have a shallow well pump this is located under my house in a crawlspace. I have had issues in the past with it losing its prime or a line freezing. In both cases, the pump will run trying to build pressure but cant, instead, it just runs and runs. As you can imagine this is bad for the pump and can kill the motor if it’s not caught. In the intern, I have wired a small light up in our kitchen so that when the pump is running it is lit. What I would like to do is this:

Log when the pump turns on and then off again.
If the pump runs for XXX long it is turned off remotely.
if the pump runs for XXX long a message is sent to me alerting me there may be in an issue.

I currently have at my disposal a handful of esp32 wemos d1 mini, two classic sonoffs, and 2 of the newer light modules. My pump is 120v, 1-horsepower.

I was thinking of using the Sonoffs before the pump’s power line, to control it but also use it as a power usage monitor I’m just wondering if it is pulled enough to what I want. If the pump is running correctly it will only turn on for 30-40 seconds.

Thanks for any help.

A quick way would be to install a smart plug that monitors and reports the pump’s power consumption (you said you had one from Sonoff). Whenever the pump turns on, the plug reports an increase in power consumption. A Template Binary Sensor can be created to indicate on when power is consumed and off otherwise (binary_sensor.pump). An automation with a State Trigger can be used to detect when the binary_sensor is on for more than a minute.

trigger:
- platform: state
  entity_id: binary_sensor.pump
  to: 'on'
  for: '00:01:00'

When triggered, the automation can notify you that the pump is running for over a minute.

Agree with that suggestion. I use the same method to tell me a tumble dryer in an out building is running or not. I created a binary sensor helper and an automation to turn on the binary sensor when power draw goes above x and turn it off when it goes below y.

Thanks… I’ll try it out. I was worried that the refresh rate was not fast enough to give me accurate results…

If the Sonoff is flashed with Tasmota, power consumption values are reported in the periodic status report but, by default, that occurs every 5 minutes. Obviously that’s not frequent enough if you are monitoring power consumption in order to determine when the device is operational.

Rather than increase the frequency of status reports, there’s a Tasmota command, called PowerDelta, that can configure it to report power consumption whenever it changes. For more information, refer to the documentation for PowerDelta:

https://tasmota.github.io/docs/Commands/#power-monitoring

be careful of using Sonoff’s for a higher current load. even if the Sonoff says it is rated for it.

I would stay below 50% rating for safety.

I’ve seen them burn up on a load I never would have expected it to. Just once but it was enough to give me pause.

I have Z-Wave and Zigbee outlets. Both types update within a free seconds.