I am using the great AI on the edge project to read my analog water meter values. Works like a charm.
Now I want to receive warnings, in case the water meter consumption reaches abnormal levels. (Somebody forgot to close a tap in the garden, water pipe broke,…).
So I have created a utility meter helper entity, which resets at midnight. Our daily typical water consumption ranges between 0,3 - 0,6m3.
Now I would like to send a notification, whenever the water consumption exceeds 0,7m3, 0,8m3, 0,9m3, and for every 0,1m3 increase after that. However, the notification should only be sent once per every 0,1m3 increment.
The only solution I could think of so far was to trigger the automation when the value is greater equal 0,7 and lower 0,8. And then to add some helper variable, to indicate if a notification has been sent.
But I don’t want to do that manually for every 0,1 increment and to create tons of helper variables.
What would be the best solution to send these notifications? I’m a bit clueless.
Hi, why not have a helper variable that contains the value you want to trigger it at and base the trigger on that? As long as you convert the value into something you can numerically compare (e.g. consumpution > helper variable then increase helper variable by one and send warning)
Then you could create a separate automation/trigger to reset that value at the beginning of the day.
Use a statistics helper using the “change” algo. Set the time to 3 hours (or whatever). Then setup an automation to check of the statistics sensor goes over X units and send a notification.
Here’s mine:
alias: Water Consumption Alert
description: ""
triggers:
- trigger: time_pattern
hours: /1
conditions: []
actions:
- if:
- condition: numeric_state
entity_id: sensor.water_consumption_3_hr
above: 1
then:
- action: notify.gotify_rest
data:
message: Water usage in past 3 hours is high!
title: CHECK WATERMETER - Usage
mode: single