arthur@homelab:~$ cat ~/posts/diy-basement-water-sensor.md
Design Notes for a Basement Water Sensor
This is a design notebook, not a completed build guide. The original note was an empty project placeholder; I am publishing the requirements and open questions instead of inventing results I have not measured.
A basement water sensor sounds like a tiny project: two contacts, a controller, and an alert. The difficult part is not detecting water once on a workbench. The difficult part is trusting the system after it has sat unnoticed for a year.
What I want from it
The sensor should:
- detect water at the lowest likely entry point;
- sound a local alarm even if the network is down;
- expose a simple metric to the homelab monitoring stack;
- alert when water is detected;
- also alert when the sensor itself disappears;
- make testing easy enough that I will actually do it.
That last requirement matters. A safety device that cannot be tested without disassembly will eventually become decoration.
A deliberately boring architecture
The likely first version is a low-voltage contact probe connected to a small controller such as a Raspberry Pi or microcontroller. The controller should maintain the local buzzer and export only a few values:
basement_water_detected 0
basement_water_sensor_up 1
basement_water_last_test_timestamp_seconds 0
Prometheus can scrape those values, and Alertmanager can distinguish an actual water event from a dead exporter. The local buzzer remains independent of Prometheus, DNS, Tailscale, and my phone.
There is already a legacy water_sensor scrape target in my monitoring
configuration. It currently points at an obsolete raspberrypi:8000 endpoint
that no longer resolves. A real rebuild should either replace that target with
an explicitly owned service or remove it; leaving a permanently red target
teaches everyone to ignore alarms.
Failure modes to design for
- Corroded or dirty probe contacts
- A controller that has lost power
- Wi-Fi or DNS failure
- An exporter process that stopped while the buzzer still works
- A cable pulled loose during unrelated basement work
- Alert delivery that has not been tested recently
- A probe mounted above the first place water actually collects
The physical placement deserves at least as much care as the code. Before mounting anything, I need to observe where water would travel, identify the lowest points, and decide whether one probe is enough.
Definition of done
I will consider this project complete only when pouring a small, controlled amount of water at the probe causes both the local alarm and a remote alert, disconnecting the controller produces a separate “sensor unavailable” alert, and the test procedure is written down.
Until then, this remains a useful project plan—not a safety claim.