№ 027 · 2026-10-08 · shipped · home assistant + linktap gateway (local api)

Draining the pool by the gallon, not by the clock

home-assistantpoollinktapflow-meterautomationlovelacesafetyfamily

Florida rain doesn’t drizzle. A few hours of a summer storm can put an inch or two of water in the pool, and it has to come back down. Plenty of pools have an automatic overflow or drain for exactly this. Ours didn’t come with one.

So for a long time, draining it was a little ritual. Usually in the evening, usually while it was still raining: open the pool app and turn on the pump, open a second app and start the drain, then keep half an eye on the clock and guess when enough water had gone.

A hose and a very good valve

The plumbing part was simple. The pool pump has a drain line, so I put a hose on it and ran it to where the water should go. In that line sits a LinkTap valve. It’s sold mostly for garden irrigation, and it turns out to be a great little device for this:

Measure the thing you actually care about

The flow meter changed how I think about draining. “Open the valve for an hour” is a guess, because how much water comes out in an hour depends on things that change: how hard the pump is pushing, whether the pump basket is half full of leaves, whether the valve’s own little filter is starting to clog. Some days an hour is two inches. Some days it isn’t.

What I actually care about is how far the water level drops. So over a few drains I worked out the conversion for our pool: about 200 gallons per inch of water level. That turns “I need to drop it about two inches” into “drain 400 gallons”, and that’s a number the valve can count.

So the drain now runs by volume: it stops when 400 gallons have gone. Time is only the backstop. If the flow is slow because something is clogged, it just takes longer to reach the same water level, and if something goes really wrong, the run still ends at 90 minutes no matter what.

One button, for everyone

The last annoyance was the pump. The drain line only moves water while the pool pump is running. Open the valve with the pump off and the timer counts down while nothing happens. That’s exactly the kind of thing that’s easy to forget in the dark, in the rain, juggling two apps.

So I wired the two together in Home Assistant and put the whole thing on the Pool page of the tablet on our wall, where anyone in the house can use it: me, my wife, or our daughter.

The Pool page on the wall tablet. The "Drain the pool" card sits under the pool controls: about 2 inches (400 gal), max 90 min, runs the pump if needed; a Drain the Pool button; and the last drain, 412.6 gal, with the running total. The spa, status and pool light colours are alongside, and the backyard camera is blurred

It’s one tap and one confirmation: drain about two inches, which is 400 gallons, with 90 minutes as the backstop. Whoever presses it doesn’t have to think about the pump at all. If the pump is already running, the valve opens and the pump is left alone. If the pump is off, the drain turns it on first, waits until it’s actually running, and makes a note that it was the one that started it. When the drain finishes, that note is how it knows to switch the pump back off. A pump that was already on for its normal schedule stays on.

The drain button in four states. Pump off: the same blue button, whose confirmation says the pump will be turned on for the drain and back off afterwards. Pump already on: one confirmation, and the pump is left running. Draining: amber, with the card filling left to right by whichever is further along, gallons or minutes. Done: the last drain's gallons and the running total, and the pump back off if the drain started it

While it runs, the main screen makes it obvious what’s happening. The card turns amber, its background fills up like a progress bar, and the icon pulses. It shows when the drain started, how many of the 400 gallons have gone, the current flow rate, and roughly how many minutes are left, with a gauge and a big Stop button that asks before it stops anything.

If the pool pump turns off partway through anyway, whether someone switched it off or the pump’s own schedule did, an automation closes the valve straight away and says why. No more running the timer down on an empty line.

How one tap becomes a drain. Tap Drain the Pool; if the pump is off, start it, wait until it is really running and remember that; set 90 min and 400 gal and stamp the start time; open the valve over the gateway's local API. It stops at 400 gal, at 90 minutes as a backstop, when Stop is pressed, or if the pump turns off. Then the flow meter is re-read, the session is logged, and the pump goes back off if the drain started it

When it finishes, an automation waits a moment for the meter’s final count to settle, then logs the session: how many gallons this drain moved, when it finished, and a running total. If the drain was the one that started the pump, the pump goes back off at the same time, so the pool ends up exactly how it was, minus two inches. The next person to walk past the tablet can see the last drain and how much water has come out of the pool, ever.

The lesson

Two things made this work better than a plain timer ever did. First, measure the outcome you care about, not a proxy for it: gallons, converted to inches, beat minutes every time the flow changes. Second, keep the dumb safety net anyway: a time limit that ends the run no matter what the smart part thinks. With both in place, a rainy evening now takes one tap on the wall, by whoever happens to be closest.