I wanted Home assistant to alert my phone of the Main water tank has a leak. (Is emptying too fast for longer than 1/2 hr)
Monitor Flow Rate
Need to monitor flow rate.
Go to Settings: Devices and Services then Helpers
Click on + Create Helper
Select Derivative
Choose your tank level as the sensor, then select the time duration.
The Helper will use calculate to give hte derivative of the sensor (turn the absolute level into a flow rate).
Watch the flow rate to determine normal values
Create a card in your dashboard and watch the flow rate for a few days.
You will be able to see what the flow rate normally is.
Create an Automation to detect large values
Create an automatic that says When flow rate is below ‘xxx’ warn me.
For me it was when dam tank derivative is below -0.18 send a notification via mobile_app_wayne with message “Dam tank is flowing fast”