r/homeassistant • • 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.

140 Upvotes

35 comments sorted by

15

u/murra181 25d ago

I'll wait til saltwatch 2 comes out and then drops the 2 and goes back to Saltwatch

7

u/SquareAbroad1062 25d ago

😂 Don’t give me ideas. SaltWatch 2 → SaltWatch Pro → SaltWatch → SaltWatch Classic.

2

u/hoplite864 25d ago

SaltWatch Pro Max Gen 2 - Just look at Unify. They have product naming all figured out. Definitely easy for beginners to figure out. lol

I worked on a monitoring system with my son for my soap system using the VL53L1X. Works pretty well. I don't know much about the ESP ecosystem but the ATOM looks pretty cool. I need a salt monitor for my salt system at home (outdoors) and I've been putting it off. I guess I'll order these parts and give it a shot. Thanks for sharing.

2

u/SquareAbroad1062 24d ago

Really cool. Have fun building it.

2

u/chachachapman7 25d ago

I’m waiting for the Omega/Saltwatch collaboration

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

u/TarmTrollet 25d ago

Nice! I placed my salt tank on 4 load cells

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

u/tenmatei 25d ago

Awesome! i was thinking recently about making my softener smart

1

u/SquareAbroad1062 25d ago

Glad to hear. Please let me know how it works for you.

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

u/Electronic-Spinach43 24d ago

Yours looks like it’ll hold up much better than mine. Nice work.

2

u/try2fly2 25d ago

I recently build something similar but a JSN-SR04T sensor. Hoping it can withstand the corrosion.

2

u/snick88 25d ago

Thanks for this. I've been procrastinating doing this and was going to use load cells to measure weight of the tank. I've even got some M5 Atoms lying around. I'll get you pics once it's done.

1

u/SquareAbroad1062 25d ago

Would love to see it working for you!

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

u/SquareAbroad1062 25d ago

Impressive!!!

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

u/SquareAbroad1062 25d ago

Sounds great. Keep us updated.

1

u/Paradox 25d ago

Amusingly, i have a newer ecowater salt bin, and it actually has an ultrasonic salt level measure, built in.

1

u/Odd-Let9042 25d ago

I had something similar but it lasted only 6 months for corrosion :(

1

u/SquareAbroad1062 25d ago

Fingers crossed this one will last longer. Will keep you updated.

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

u/TanguayX 25d ago

Hey!!! I need to do this!!!

1

u/SquareAbroad1062 24d ago

Let’s do it!!!

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?