I have a Submersible dirty water pump and Iwould like to monitor how many times per hour the pump is running.
The pump is strating and stopping automaticly via a integrated flow siwtch (not integrated in home assistant)
The good point is that I can see via the monitored electric consumtion when the pomp is running. = ± 250W
The bad point is that there is another device on the same electric line . But I know the consumation of this one ± 800W)
My first attempt would be to create an automation like this:
alias: New Automation
description: ''
mode: single
trigger:
- platform: numeric_state
entity_id: sensor.power
above: '200'
below: '300'
for: '00:00:02'
- platform: numeric_state
entity_id: sensor.power
above: '1000'
for: '00:00:02'
condition: []
action:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.pump_running
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
- service: input_boolean.turn_off
target:
entity_id: input_boolean.pump_running
- delay:
hours: 0
minutes: 0
seconds: 20 # longer than normal run time but less than between runs, to keep it from triggering twice in the same run
milliseconds: 0
Then an statistics or history stats on the boolean.
That is not what I meant.
Set the timespan to a smaller window. Say 05:00 to 05:05 (or whatever timespan it was started).
Then use the cursor to see if you get a reading along the line where it says between 200 and 300 w.
If it does then the sensor based may trigger when it was on it’s way to 800, but the automation based needs 2 seconds where it stays between 200 and 300 w to trigger.
You can also use the derivative sensor to see the rises and only accept rises that are at a specific rate. It would be pretty easy to see the differences here, however if they both turn on at the same time, you’d have a problem.