Previously i was using a Cyble Sensor on my Aquadis Watermeter. I connected it to an S0PCM attached to an docker image to count. The Cyble Sensor is broken so i had to replaced it. But it cost arround 80 euro, so this had to be done much cheaper :-).
On this watermeter there is a little metal meter which counts every liter. This little meter can be measured by a proximity sensor. I bought this one.
This sensor is Normally Open and has 3 wires;
- Blue – GROUND
- Brown: V
- Black: Data
Because i already have a S0PCM counter connected to USB i would like to connect it to this S0PCM.
I connected this S0PCM to my Intel NUC and running this docker container.
This is counting and converting to MQTT, and can send the information to Home Assistant.
But because the proximity sensor is 12V and the S0PCM cannot have voltage on its inputs, i connected it to this relay:
With this relay the proximity sensor can be connected and a potential free output to the s0pcm.
The drawing is like this:
The MQTT code is as follows:
- platform: mqtt name: Watermeter Totaal state_topic: "s0pcm-reader/1/total" unit_of_measurement: "L" force_update: true availability_topic: "s0pcm-reader/status" qos: 1 payload_available: "online" payload_not_available: "offline" - platform: mqtt name: Watermeter Dag state_topic: "s0pcm-reader/1/today" unit_of_measurement: "L" force_update: true availability_topic: "s0pcm-reader/status" qos: 1 payload_available: "online" payload_not_available: "offline"
This is giving a daily and total sensor.
The sensor needs a precise placement above the metal part. i used a clamp and bracket to fixe the setup. Final setup is looking like this:
Edit: It is important to set a large debounce time within the S0PCM. I have set mine at 500ms, which is working fine. For more info see docs of the s0pcm module.