Hi all, I am building this exact setup at the moment.
My hardware is a Wemos D1 Mini and I have the LJ12A3-4-Z-BX-5V. I placed a logic level shifter in between the D1 and the sensor, as the D1 is 3,3V and the sensor runs at 5V. Main advantage of this setup is that you can use the D1 Power Shield and plug in almost any 6-24V adaptor.
I now have to put it in place which is kind of hard as I do not have a piece of metal to mount it on at the moment. So I will let you guys once I am done…
So… I’m back after some while, with for me a solution for measuring my water.
I don’t need to know how many liters are currently flowing at all… Well it’s still possible with my previous post but not too accurate sometimes, but it can give a good indication.
Instead, I just want to see what I use each day… And that’s pretty easy in the end.
So this will just show ‘on’ or ‘off’ when the sensor detects the metal piece in the meter.
And then ofcourse I want it every day, so I have something like this in my sensors.yaml:
- platform: history_stats
name: Waterdaily
entity_id: binary_sensor.watermeter
state: 'off' #Or on, you can choose...
type: count
start: '{{ now().replace(hour=0, minute=0, second=0) }}'
end: '{{ now() }}'
This will just count the times a day the sensor registered on (off).
In the end HA just writes all my daily numbers (electricity usage, gas-consumption, solar-panel numbers,…) to a csv-file around 23:59:50 at night.
There are almost no miscounts (normally like 1 liter a day cause you can have the first count being missed), maybe when you are resetting HA a lot cause of checks and so on it will be more (will add one if the state is on (off).)