hugokernel / esphome-water-meter

Measurement of water consumption directly from your water meter with a TCRT5000 like sensor and ESPHome.
MIT License
64 stars 10 forks source link

Unit error #5

Closed libussa closed 7 months ago

libussa commented 2 years ago

Dividing by 60 here would give a flow rate in L/s, and not L/min

https://github.com/hugokernel/esphome-water-meter/blob/7f91b4f95fc51e2c77145e99344699bdcf4126b5/watermeter.yaml#L176

hugokernel commented 2 years ago

Hi, I dont understand your assumption, could you explain please ? I think it is depend of your water meter.

libussa commented 2 years ago

From the docs of the pulse counter module:

The sensor defaults to measuring its values using a unit of measurement of “pulses/min”.

All the water meters I've seen have the rotating disk measuring 1 liter per revolution. Which means that 1 pulse per minute = 1 liter per minute, there is no conversion to be done here.

Some do 0.5 liter per turn, but none do 0.0167 liter/turn (which is what your multiplication factor is saying here)

Plus, just do the experiment; fill a 10L container with water, the flow rate will make no sense with the current config.

As a side note, pulse_counter has a poor resolution in utilities applications. This PR goes into details about why https://github.com/esphome/esphome/pull/1434 pulse_meter is a better alternative

hugokernel commented 7 months ago

Fix by https://github.com/hugokernel/esphome-water-meter/commit/775f14f3aa13cf70cbd4b4709ea0aee76f6de34b