I wanted home assistant compatible plant watering solution that works on a solar panel and does not require being connected to the water line and is Zigbee compatible. Unfortunately, I could not find any. So I did a DIY solution: a big barrel which I manually fill with water, a 12V pump (usually sold for camper vans), some rechargeable batteries, 10W solar panel, a solar charging controller, and Tuya ZG-2002-RF switch.

I dabbled in hydroponics for some years. Due to my inability to get my Rasberry Pi and Arduino working I ended up using a 12V pump and one of those cheap $10 electric timers on Aliexpress. I estimated how much time it took for my hydroponics system to drain and that's what I set on the timer. Other people I followed had all sorts of sensors rigged up, which I would have done if I had the time and skill but I failed, so in the end it was just the timer. I too had single solar panel and battery and the system worked for over 7 years with no issues. I just replaced the pump once or twice.

This feels like one of those cases where DIY ends up being simpler than waiting for the perfect product to exist

There are also irrigation controllers that use a ball valve and will work fine under gravity pressure e.g. raised rain barrel. Powered via battery that lasts months and months. No home assistant of course but water usage can be estimated from expected flow and programming.

An art student of mine once needed a way to electrically control precise small amounts of water. We solved that using:

  1. Water tank and gravity  
  
  2. Medical IV flow regulator¹  
  
  3. Servo hooked up to that IV flow regulator via a 3D-printed part  
  
It worked very well. In medical applications off must be really off, so it was also quite safe in that regard as well. Her 3D-printed part had a little bit too much flex in it, but in principle this works quite well. If it is really, really safety critical I would still recommend a mechanical fallback that protects in case of power loss or when the servo fails open (e.g. bending the hose with the force of a spring if electricity is gone).

¹: see https://www.gvs.com/en/catalog/iv-flow-regulators

> If it is really, really safety critical

Your suggestions should be fine for hardware failure but I'd be more concerned about software failure: what if a bug in your software makes it unresponsive and stuck in the state with the flow open? Maybe a watchdog or some other system running in parallel checking for a heartbeat or a max amount of time water can be flowing?

Good point. In my case the program was so simple and the risk low enough that this wasn't needed. The worst thing thar could have bappened was some minor water damage to an exhibition space.

Also my track record of writing stable, bug free embedded software has been pretty solid as of now. But if human life would be on the line (for example) special precautions like multiple independent failsafe mechanisms are non-negotiable.