Every time the pump is working the idle (around 1W) power jumps to around 550W.
Is there a way to create an automation and sensor to show how many times a day the pump does its work?
My experience in YAML is rather basic and I don’t even know where to begin.
What you basically want to do is describe to HA what you count as a “flush”, as well as when this single flush is over so a second flush can be detected.
I guess a rule like the following should do the job:
If power goes above 10W (any suited threshold)
Count as flush, increment an input_number, send notification, trigger a service, …
As simple as that. It might become tricky when your power consumption varies over one flush, e.g. goes back to 1W on-between. In this case a simple for in the trigger might be sufficient.