We got a water softener installed near the water mains coming into the house. It’s a “dumb” softener so that it does not rely on using electricity. This means it will continue to work in a power outage but the downside is it has no smarts about it. The unit uses salt blocks and needs to replaced on a regular basis.
Making the salt level available in Home Assistant will allow automations to trigger when the salt runs low. I’ve seen two ways to do this:
Weight can use a load cell to measure the weight of the softener unit. The less salt that is left, the lighter the unit will weigh.
With salt blocks (more like bars), the top of the top surface can be measured. The lower the salt is, the further away the distance will be from a fixed point in the water softener.
Due to space constraints, I opted for the distance using an ultrasonic sensor. The water softener we got was the Kinetico Premier Compact
I used an ESP32 and a HC-SR04.
The wiring was slightly different compared to the below because my board had the VIN instead of 5V and it was on the opposite side to the 3v3 pin:
The wiring looks something like this:
You can use a combined 4 jumper leads and connect it between your ultrasonic sensor and ESP32.
The water softener lid where you remove to put new salt blocks in is an upside-down “L” shape held on with a magnet. This makes Jerry rigging something very easy: The top of the lid directly goes over the the salt blocks and the magnetic attachment allows the cables to be routed without any permanent mods.
Configuring ESPHome is fairly easy. Make a note of the GPIO pin number for the trigger and echo wires. You’ll need to set those:
sensor:
- platform: ultrasonic
trigger_pin: GPIO13
echo_pin: GPIO12
name: "Salt Level"
Full example can be found here.
I created a number help to set the low salt threshold. We have not used enough salt since we got the softener to truely know what is the the right value. Don’t forget to replace my notification script call with your own.
The YAML automation can be found here.
This will hopefully help make it easier and not forget to replace the salt. Next step is to tidy up the devices once I know it’s working. I suspect I could box the ESP32 and also fit it under the water softener case so that only the USB power cable is visible.