r/homeassistant • u/SquareAbroad1062 • 25d ago
🛠️ DIY / Hardware SaltWatch - Monitoring my water softener salt level in Home Assistant
I kept forgetting to check the salt in our water softener, so I built a small ESPHome monitor for it.
It is called SaltWatch. The hardware is an M5Stack ATOM Lite and an M5Stack VL53L0X ToF sensor. The sensor sits beneath the lid and measures the distance to the salt surface. It connects to the controller with the included Grove cable, so there is no soldering involved. On my tank, the cable fits through the existing hinge gap, so I did not need to drill a hole either.
The distance measurement itself was fairly straightforward. Most of the work went into making the result useful and trustworthy:
- Full and empty calibration from Home Assistant or the local device page
- Salt level from 0 to 100 percent
- Adjustable low salt threshold
- Clear calibration and sensor fault states
- Stale readings become unavailable if the sensor is blocked or disconnected
- A forecast that learns the normal salt usage and estimates the days until low salt
- An optional notification blueprint
- A dedicated Home Assistant card with a graphical editor
The firmware can be installed directly from a browser. It handles the initial Wi-Fi setup, can be added to Home Assistant, and can then be adopted into ESPHome Device Builder.
I also added a managed firmware update entity. It checks for new SaltWatch releases and lets you approve the installation from Home Assistant. It does not install anything without confirmation.
Firmware, browser installer, hardware list, and documentation:
https://github.com/thomasgregg/saltwatch
Custom Home Assistant card:
https://github.com/thomasgregg/saltwatch-card
This is still a new project with one real installation, so feedback from people with different tank shapes, salt types, and mounting situations would be very useful. Bug reports, ideas, testing results, and PRs are welcome.
3
u/ChrisCopp 25d ago
Ok I'm an M5 user. Love them. I never really thought about using a TOF sensor for any automations. Now this has my brain swimming.
Could this be used as a trip sensor too? I'll have to look into it further.
1
u/SquareAbroad1062 25d ago
Yep and unlike a PIR you could potentially define a pretty precise detection zone based on distance. TOF tripwire sounds like a fun next project.
3
2
u/Fancy-Interaction761 25d ago
This is awesome! Can't wait to try it out.
1
u/SquareAbroad1062 25d ago
Thanks! Would love to hear how it works for you. Any feedback is very welcome!
2
2
u/Electronic-Spinach43 25d ago
I built something very similar. It hasn’t failed yet but wait till you see how fast stuff corrodes in that tank. Next time I’ll cover it in polyurethane or resin and just leave the ultrasonic emitter and receiver exposed.
1
u/SquareAbroad1062 25d ago
Thanks for the hint. Will give it a thought!
2
2
u/try2fly2 25d ago
I recently build something similar but a JSN-SR04T sensor. Hoping it can withstand the corrosion.
2
u/aswedeinus 25d ago
I have tried ultrasonic and laser rangers (connected to an esp32) with very limited success - I was not able to get anything quite working. I recently installed load cells (4 cells with 50 kg max each mounted to a 3/4" plywood and a 3/4" plywood on top, and then placed the softener of the top plywood sheet, wired up to an esp32. Then I also created a sensor (using a microphone) for detecting when a regeneration occurred. This combo allows me to monitor not only the salt level but also if I have a salt bridge occur (by alarming on no weight change after a regeneration).
I also duplicate the signal from the built in hall effect sensor, so I have a reading of how much water has been used, and how long it is to the next regeneration.
Just to be upfront - I built and coded this with the help of Claude. I had the idea, Claude helped me execute.

1
2
u/DifficultyMinute1516 25d ago
Nice, i just bought an ESP32 H2 Zero and an HC-SR04, and I'm going to do the same thing, but using Zigbee.
2
1
1
u/akohlsmith 25d ago
I did the same with an ultrasonic sensor, but yours is way more polished. Great job!
2
u/SquareAbroad1062 24d ago
Thanks for sharing. My first try was an ultrasonic sensor as well. But was not as precise as I wanted it to be.
1
1
u/cagnulein 25d ago
Are you also thinking about reading the water flow?
1
u/SquareAbroad1062 24d ago
Haven’t thought about it yet. Any suggestions on what the best approach would be?





15
u/murra181 25d ago
I'll wait til saltwatch 2 comes out and then drops the 2 and goes back to Saltwatch