Building the High-Water Fail-Safe: Adding a Remote Bilge Alarm
May 2026
In our previous installments, we solved two of the biggest challenges of remote boat ownership: establishing a permanent, always-on network and monitoring battery health so the boat starts when you get to the dock. With a reliable data backbone and power monitoring in place, it is time to tackle the “middle of the night” anxiety every boat owner: Is the boat still floating?
This solution expands our ESP32-based boat monitor to include a high-water bilge alarm. This is a simple upgrade, but it adds one of the most important layers of protection for your boat either when at the dock or on the water.
The Mission: Beyond the Automatic Pump
Most boats already have an automatic bilge pump, but those pumps are silent workers. If everything is functioning correctly, the pump quietly removes nuisance water, and you never think about it. But if a hose clamp fails, a thru-hull fitting leaks, a seal starts dripping, or the pump itself cannot keep up, the situation can get serious quickly.

Even worse, the pump may run until the batteries die. At that point, you may be left with both a water problem and a dead electrical system. That is where a secondary high-water alarm becomes valuable.
By adding a separate float switch wired to the ESP32, we gain a critical layer of defense. This system does not wait for someone to check an app. It actively sends a notification the moment bilge water reaches a concerning level, giving you the lead time needed to check the boat, call the marina, or respond before a minor leak becomes a major loss.
This alarm does not replace the bilge pump. It does not replace regular inspections. It simply gives the boat a way to speak up when something is wrong.
Requirements and Prerequisites
This project is built on the existing ThrillFishing Battery Monitor, so the goal is not to create a second standalone monitor. Instead, we are adding one more critical input to the ESP32 that is already installed, powered, connected, and reporting data back to Home Assistant.
Before starting, confirm that your existing battery monitor is working reliably from the boat. The ESP32 should already be powered from the boat’s electrical system, connected to the onboard network, and able to send webhook updates back to Home Assistant through the remote network path established in the earlier always-on network project.
Important Safety Boundary
The float switch in this project is not being used to power a bilge pump.
It is only being used as a low-voltage signal input to the ESP32.
The wiring should be:
ESP32 GPIO14 → float switch lead 1
ESP32 GND → float switch lead 2
Do not connect 12V boat power to GPIO14.
The ESP32 input pin is only designed for logic-level voltage, not raw battery voltage. In this design, the ESP32’s internal pull-up keeps the pin normally high. When the float switch rises and closes, it connects the GPIO pin to ground. ESPHome then interprets that as a high-water alarm.
The Build: Components
Since we are building on top of the existing battery monitor project, the hardware requirements are minimal, but the parts still need to be suitable for a marine environment.
Component | Example | Purpose |
Marine float switch | Rule 40A Rule-A-Matic Plus Bilge Pump Float Switch | Detects when bilge water rises above the normal pump activation level |
Marine-grade tinned copper wire | 18 AWG wire | Carries the dry-contact signal from the float switch to the ESP32 |
Adhesive-lined heat shrink connectors | Marine butt connectors or solder-seal connectors | Seals splices from moisture and corrosion |
Cable clamps or wire loom | Nylon clamps, split loom, or adhesive mounts | Keeps wiring secured above the lowest wet area of the bilge |
Waterproof enclosure or protected electronics area | Existing ESP32 enclosure | Keeps the ESP32 and wiring protected from spray, condensation, and vibration |
Multimeter | Any basic continuity meter | Used to test the float switch before connecting it to the ESP32 |
Existing ESP32 battery monitor | From the previous project | Reads the float switch and sends the webhook alarm |
Existing Home Assistant webhook | From the previous project | Receives the alarm event and triggers notifications |
I used a Rule-style marine float switch because it is purpose-built for wet bilge environments and provides simple open/closed contact. Any similar marine-rated, non-mercury float switch can work if it behaves like a standard dry-contact switch.
Prerequisites Checklist
Before drilling, mounting, cutting wire, or changing ESPHome code, confirm the following:
- The ESP32 battery monitor is already online and visible in Home Assistant.
- The ESP32 can successfully send an HTTP POST to your Home Assistant webhook.
- Your Home Assistant webhook automation sends a phone notification when triggered.
- The ESP32 power supply remains active when the boat is unattended.
- The GPIO pin you plan to use is not already assigned to another sensor.
- The float switch has been tested with a multimeter.
- You have decided where “normal bilge water” ends and “high-water alarm” begins.
- All splices will be kept as high and dry as practical.
- The alarm will be tested with real water or by manually lifting the float before relying on it.
The first time you test this system should not be during a storm, power failure, or overnight leak.
The Installation
Mount the float switch slightly higher than the primary bilge pump’s normal activation point.
The goal is to avoid alerts during normal nuisance water while still catching a true high-water condition early. If the automatic bilge pump turns on at roughly 2 inches of water, you may want the alarm switch higher, such as around 4 inches, or at whatever level represents an abnormal water condition for your specific bilge.
The exact height depends on the hull shape, pump location, float switch style, and how water moves when the boat rocks in the slip.
A few installation tips:
- Mount the switch where rising water can lift it freely.
- Keep it clear of hoses, wiring, debris, and the bilge pump float.
- Do not mount it where it can jam against the hull, pump, or a wire bundle.
- Use the switch’s manual test feature if available.
- Route the signal wire above the normal wet area whenever possible.
- Secure the wire so it cannot fall into the bilge pump or float mechanism.
- Seal all splices with adhesive-lined heat shrink.
- Label the wire so future troubleshooting is easier.
Wiring is straightforward:
Float switch lead 1 → ESP32 GND
Float switch lead 2 → ESP32 GPIO14
The Logic: Combatting the “Slosh”
The biggest challenge with a bilge sensor is movement.
A passing wake, wind chop, or someone stepping onto the boat can cause water to surge in the bilge. If the float switch only flicks on for a split second, that should not be treated the same as a real high-water event.
To reduce false alarms, the ESPHome configuration uses software filtering:
filters:
– delayed_on: 3s
– delayed_off: 5s
The alarm only turns on if the float switch remains active for 3 seconds. It only clears after the switch has remained inactive for 5 seconds. That gives the system a small amount of patience, which is exactly what you want in a moving boat.
For a very active marina or a boat that rocks heavily, you could increase delayed_on to 5–10 seconds. For a tighter early-warning alarm, keep it at 3 seconds.
The Code: ESPHome Implementation
Add this block to your existing battery monitor YAML configuration.
This example uses a GPIO binary sensor with the moisture device class, so it integrates cleanly into Home Assistant. When the switch activates, the ESP32 sends an HTTP POST request to your Home Assistant webhook.
# Required once in your ESPHome config if not already present
Here is the link to the code.
Example Home Assistant Automation
On the Home Assistant side, the webhook receives the ESP32 message and sends a phone alert if the alarm is triggered.

Here is a simple example:
alias: Boat Bilge High Water Alert
description: “Notify when the ESP32 boat monitor reports high bilge water.”
mode: single
trigger:
– platform: webhook
webhook_id: !secret boat_bilge_webhook_id
allowed_methods:
– POST
local_only: true
condition:
– condition: template
value_template: “{{ trigger.json.bilgealarm == ‘ON’ }}”
action:
– service: notify.mobile_app_your_phone
data:
title: “Boat Bilge Alarm”
message: “High water detected in the bilge. Check the boat immediately.”
data:
push:
sound:
name: default
critical: 1
volume: 1.0
If your ESP32 reaches Home Assistant through a private connection like ZeroTier, VPN, or another local-only path, keeping local only: true is a good security posture.
Add an “All Clear” Notification
You may also want a second automation for when the water level returns to normal.
alias: Boat Bilge Water Back To Normal
description: “Notify when the ESP32 boat monitor reports the bilge level has returned to normal.”
mode: single
trigger:
– platform: webhook
webhook_id: !secret boat_bilge_webhook_id
allowed_methods:
– POST
local_only: true
condition:
– condition: template
value_template: “{{ trigger.json.bilgealarm == ‘OFF’ }}”
action:
– service: notify.mobile_app_your_phone
data:
title: “Boat Bilge Normal”
message: “The bilge high-water switch has cleared.”
A high-water alert tells you there is a problem. An all-clear alert tells you whether the water level dropped again, which may help you understand whether the bilge pump recovered or the water was only temporary.
Testing the Alarm
Before trusting the alarm, test it in stages.
Test | What to Do | Expected Result |
Float switch continuity test | Use a multimeter and manually lift the float | The switch should open and close consistently |
ESPHome log test | Lift the float while watching ESPHome logs | You should see BILGE HIGH WATER! after the delay |
Webhook test | Trigger the float and watch Home Assistant | The webhook automation should receive bilgealarm: ON |
Notification test | Trigger the float from the boat | Your phone should receive the high-water alert |
Clear test | Lower the float | Home Assistant should receive bilgealarm: OFF |
Slosh test | Quickly flick the float for less than 3 seconds | No alarm should be sent |
Remote test | Test while off the boat network | Confirms the full remote path works |
The most important test is the full end-to-end test:
Lift the float at the boat and confirm the notification arrives on your phone when you are away from the boat’s local Wi-Fi.
That confirms the entire system is working: the switch, ESP32, network, webhook, Home Assistant automation, and mobile notification.
Failure Modes This Helps Catch
A high-water alarm can provide early warning for several common problems:
Failure | What Happens | Why the Alarm Helps |
Bilge pump fails | Water rises above the normal pump level | Alarm tells you the pump is not keeping up |
Pump float switch sticks | Pump never turns on | Secondary switch catches the rising water |
Battery voltage drops | Pump may run weakly or stop | Combined with the battery monitor, you can see both problems |
Hose clamp or fitting leaks | Water slowly accumulates | Alarm catches the issue before the boat is in danger |
Heavy rain overwhelms drainage | Bilge fills faster than expected | Alarm gives you time to respond |
Debris blocks pump | Pump runs but does not move enough water | High-water level still triggers the alert |
This is why the high-water alarm is a strong companion to the battery monitor. Battery voltage tells you whether the boat still has electrical capacity. The bilge alarm tells you whether the boat is actively taking on or retaining water.
Together, they provide a much better picture of the boat’s health.
Practical Mounting Advice
The ideal mounting location is not always the lowest part of the bilge. I measured the hull right in front of my mid ship bilge pump with a cardboard cutout from port to starboard and left a gap below the bracket to allow water flow. Then I made a 3D printed bracket where I could mount the bilge switch with stainless bolts. This can be downloaded here. I then used JB WELD Putty: WaterWeld, Marine Repair to mount the bracket to the hull directly.


The high-water alarm should be mounted above the normal pump activation level, in a location where water should not normally remain. That makes the alarm meaningful.
A good location should be:
- High enough to avoid normal nuisance water
- Low enough to provide early warning
- Clear of moving parts
- Clear of the pump float
- Clear of debris
- Easy to inspect
- Easy to manually test
Avoid mounting the alarm switch in a place where water can splash against it constantly but not actually represent a high-water condition. Also avoid placing it somewhere that traps the float against a wall, hose, or wire bundle. After mounting, manually lift the float and confirm that it moves freely.
Summary
This project directly added to our existing battery monitoring and WiFi network solutions with a critical component of real-time bilge water level monitoring. With power and water level now under remote surveillance, you can assure your boat is not slowly (or quickly) sinking.
The battery monitor tells you whether the boat has enough power. The remote network keeps the boat online. The high-water bilge alarm tells you the answer to the most important question – Is the boat floating?
I realize this is a technical article and you might have some questions. Feel free to reach out directly by email at [email protected].
Tight lines … Captain P.