Measuring water flow rate and automating

I’ve made the water meter for my house smart using one of these devices - Waterlezer dongle – smartstuff

I can now track amount of water and I am using and the rate, however given that it reports the pulse rate of water, I’m struggling to think of a way to automate based off it.

To clarify, I am trying to create an automation if the water flow rate is above 50L/min, along with a bunch of other condition, and then increase the volume on the bathroom speakers. Idea is that if the shower is running then increase the music volume.

I want to trigger the automation if the flow rate is above 50L/min for 25 seconds (approx refill time of toilet so I don’t want to trigger this from a flush) but because it’s a pulse rate, the value isn’t sustained for very long.

Any suggestions on how to capture this trigger?

hey niallain,

its been a while, did you ever find a suitable solution?

I have a similar issue with a gas meter sending a puls on each 0,01 cubic meter. I want to calculate the flow rate.

I would want to use the “last changed” stated of the impulse sensor and the approximate the flow rate, but I"m stuck.

This works though and gives me the time since the last pulse:

{{ relative_time(states.counter.gas_meter_impuls_count.last_changed) }}

Do I need to normalise this into seconds?
Ay hint would be appreciated

In reply to myself, the solution was easier than expected:
I use the native “Derivative Sensor” of HA and my gas meter (in m3) as input sensor.
Since this will result in the flow rate only changing values, when the input sensor changes, the last flow rate will stick forever, when the flow returns to zero.

So I use an Automation, that forces the flow rate to 0 after the input sensor has not changed state for over 180 seconds.
Works fine for me, but is not scientifically accurate .