Cistern, Fountain and a Touch of Megalomania: How Our Garden Got Smart(er)
My cistern kept running dry – and I always noticed too late. How I made it smart with a LiDAR sensor and MQTT, and the fountain along with it.

There's that one moment in summer every garden owner knows: you turn on the tap, the pump gurgles briefly – and then nothing. Cistern empty. Last summer we had several of those moments. 10 m³ sounds like a lot, but during weeks of drought it really isn't.
The real annoyance wasn't the empty tank, though. It was that I only ever noticed when it was already too late. And there I am, talking every day at work about predictive maintenance, about data transparency and about how you need to know a state before it escalates – and I don't know how much water is sitting in the ground ten meters from my front door. That wouldn't leave me alone.
What came of it is a nice example of what happens when an engineer has an actually small problem and a lot of time to think.
First attempt: the pressure sensor
My first thought was the obvious one: a pressure sensor at the bottom of the cistern, connected to a small ESP32 with a Wi-Fi antenna. Measure the water column, convert, done. Charmingly cheap, quickly built, and it would have satisfied my urge to tinker.
The longer I thought about it, though, the more uneasy I got. Over the years, sediment settles in a cistern. Fine dirt from the roof, bits of leaves, sludge. And that's exactly where my sensor would sit. A measuring method that systematically becomes less accurate over time without me noticing is, in the end, worse than no measurement at all – because I'd even trust the wrong values.
So: discarded.
Second attempt: ultrasound
Next idea: ultrasound, again via an ESP32. Contactless, no contact with the water, no sediment problem. Sounds good.
In practice, though, it was too imprecise for me. Ultrasound is sensitive to temperature layers, condensation on the sensor and the geometry of the shaft. I didn't want a measurement that's right “more or less” – I wanted a value I can blindly trust at eleven at night.
Third attempt: LiDAR – and finally a solution
As so often, the community helped me along. I looked at what others are doing in the smart home space and, through a YouTube video, came across the level sensor from Senvolon: contactless measurement via LiDAR, accurate to the centimeter, IP65, with a 3D-printed housing and a connector for an external Wi-Fi antenna.
And now comes the part that really convinced me:
- German manufacturer, developed and produced in Germany.
- No cloud lock-in. The data stays local, configuration via a simple web interface of its own.
- Open interface. All values can be read directly via MQTT.
That third point was the dealbreaker for me – in the right direction. In the meantime I had built my own Unified Namespace at home – all data from the house runs through a central MQTT broker, cleanly structured and available to every consumer. A sensor that speaks MQTT out of the box fits in as if it had always belonged there. No gateway fiddling, no proprietary app, no account anywhere. Sensor in, enter the tank geometry, subscribe to the topic, done.
Since then I always know how much water is left. Above all, though, I see the trend: how fast does the level drop at 30 degrees? How much does a proper rain shower actually bring? Going from “oops, empty” to “things will get tight in four days” is exactly the leap the whole predictive topic is really about.
While you've got the lid open anyway
And since I was down there anyway, installing the sensor turned into a small overall project. I took the opportunity to clean the cistern completely. I also properly redid the existing pump wiring – let's diplomatically call it “grown over time”.
I built the mounting tree for the sensor and antenna myself. And now comes the part where my wife could only shake her head: I painted the mount in the black RAL shade that matches the house. In a cistern. Under a closed lid. Where no human being other than me will ever see it again.
I know it looks consistent down there. That's quite enough for me.
Finally, I displayed everything nicely in my Homeassistant dashboard.
Part two: the fountain
In parallel, the second water project was underway. My parents had put a ready-made fountain in their garden. Set it up, water in, plug in, running. One afternoon of work, then coffee.
For me, it turned into five weeks.
At first that wasn't down to the technology at all, but to physics. The stone I had picked was simply too heavy for the standard polypropylene solution that came with it (PP up to 250 kg). So I redesigned the entire statics of the basin, including the GRP (glass-fiber reinforced plastic) mount – for 800 kg. That sounds excessive, and in a way it is. But our little ones play in the water at this fountain. I don't want to calculate whether it's enough. I want to know that nothing can happen, even if someone hangs on it with their full weight.
Once the stone was chosen, the hole drilled and the whole construction lifted into the garden by crane, the pump went in. And with it the next problem: it has a perfectly ordinary 230 V Schuko plug.
The plug had to go
Of course my family should be able to control the fountain via our smart home app – without anyone rummaging behind the bushes for a socket. You could use a timer, of course. But a timer isn't smart, it's just punctual.
So: plug off, everything wired through a Shelly 2PM. I then integrated it into the Gira X1 using a routine I developed myself. Once again, a big thank-you at this point to Kai and his Smarthome-Appstore, which brings the Shelly integration right out of the box. Without this commitment to the Gira community, a lot of things in my house would be much more tedious.
Still, it got a bit tricky in the end. In the house I basically want to control everything via KNX, but the Shelly speaks MQTT – so I needed a clean gateway between the two worlds. Switching was done quickly. The way back took me considerably more time: I didn't just want to send a command, I also wanted to reliably get the real actual state back into the app. Because a switch that claims the pump is running without knowing it is exactly the kind of half-knowledge I don't want in my house.
After some trial and error, it worked. The fountain now reports what it's doing by itself.
The routine for controlling the fountain in the Gira Project Assistant
Conclusion: totally over the top – and exactly right
Let's be honest: a folding ruler and a timer would have been enough for the same result. A look under the lid, a twist of the timer, done. No LiDAR, no MQTT topics, no statics calculation for 800 kg, no RAL-painted mount that nobody will ever see.
But that was never the point. For me, the appeal lies exactly in this step: from “let me go and check” to “my house knows and tells me”. An empty tank became a data source. A pump with a Schuko plug became a participant in the system. And along the way, the cistern is clean, the wiring is tidy and the fountain is built so that I sleep soundly at night when the kids have played on it during the day.
Yes, this is over-engineered. And yes, I'm pretty proud of it. 🙂
Next, I want to link the fill level data with the weather forecast: if rain is announced, I don't need to water sparingly today. And at some point the pump should know by itself when it had better not start at all. As always, I'll keep you posted.