The ESP32 runs on 3.3 Volt. The sensor needs 5 Volts, so in theory a level shifter is required. Even though the Espressif CEO claims that the chip is 5V tolerant, I still added a protection circuit to the proximity sensor, limiting the input voltage to safe values.
Test-installation
For testing, I mounted the components on a breadboard:
And 3D-printed a sensor mount:
Software
The ESPHome configuration YAML looks like this:
Software backlog
The water meter does not yet integrate nicely with the Energy Dashboard in HomeAssistant. Probably needs a specific data format / unit to be added.
Total water consumption resets to zero when rebooting the board - this leads to hilarious water consumption rates, for example 800.000 liters in one minute. I assumed that “total_increasing” would detect and solve this.
Initially I enabled the “Bluetooth Proxy” functionality on the water meter, but I encountered frequent reboots so I disabled it for now. That seems to have helped, not sure what causes this.