Well pump on a timer?

I bought a house in Portugal that has a unique set up. There is a sprinkler system that is supplied by a pump in a large cistern. I also have a well that is used to refill the cistern. The problem I have is that the well is not very deep and the water supply is slow. The pump runs for about 30 minutes or so then shuts off with an error message that the pump is too hot. I'd like to install some kind of timer that only powers the pump for a short period then powers off for a while, then repeat the cycle.

I was thinking about removing the power feed from the circuit breaker to the well pump control box and connect it to a smart plug like a Zigbee one. I would then run wires from the smart plug into the pump control box where I removed the original wires. I could then use a Home Assistant automation to control the smart plug. Does anyone see any problems or concerns with this solution? Or does anyone have a better suggestion? Would just putting a standard analog timer between the circuit breaker and pump control serve the purpose?

Thanks in advance for any advice.

I would use some like a Sonoff din rail smart relay that could be installed in your electric panel. And then you could write an automation to limit the time the pump runs

You have to watch out with a smart plug since the current can be to high from the pump.

Rather than a timer use a level switch/sensor so the pump turns off when the level is low. There are ultrasonic distance measuring sensors, pressure sensors that measure the water height (my favourite) or even just a couple of float switches.

Not unique, actually a common requirement with filling tanks. What is unique (and alarming) is your pump motor overheating being used as the basis for stopping pumping. Fire risk anyone?

You could actually monitor your pump motor for temperature, to make sure it is within working parameters, rather than guess at run times to keep it from tripping the circuit breaker. A waterproof DS18B20 should do the trick. Your motor life will be shortened if it is constantly run up to excessive temperature, enough to trip the temperature cutout. Find out why it heats up too much and solve that issue before continuing. If it is because you are running your pump dry without water, that can reduce the pump life considerably too, water flow providing essential cooling as part of common pump design.

Along with water height level (two float switches will do the job reliably) and a robust relay to switch the pump motor (allow a significant overhead for starter current inrush to your figures, found in the motor/pump specifications) and you should be able to built a watertight smart controller located right there next to your pump. An ESP32 should do the job comfortably, with one GPIO for your temperature sensor, one for your relay output, and two for your float switches (for the full and empty levels).

For completeness, have some GPIO outputs for different colored LEDS for status indicator for pump, float levels, etc for troubleshooting too.

You don't need to track water height, pump runtime, etc in HomeAssistant. You just have to switch the pump on when needed, and have it switch off when not needed. Allow for a bit of hysteresis so your pump does not cycle on and off every few seconds and you should be fine.

ESPHome can be used to make a suitable standalone firmware platform. You don't need networked connectivity in use, just for firmware updates, which should be rare once you have a stable platform working to your satisfaction.

For better setup advice other than just using a relay with power monitoring and water level sensors to track how full or empty the cistern is folks will need to know what the exact setup you have with this well pump.

That said these are the main two video's I have found at this time on this topic.