Most elegant way for Pump Warning

Hi I have four pumps to drain my house and drainage system.

I need an alarm if one of them runs too long because it ran dray or the sensor got stuck.
I tested this Automation:

alias: Überwachung der Tauchpumpen
description: >-
  Automatisierung zur Überwachung der Tauchpumpen und Benachrichtigung bei zu
  langem Betrieb.
triggers:
  - type: power
    device_id: cba380e5b6ebbefc07d1431c4e09abc9
    entity_id: 6aba3c4a669619a20f4e4aaf2ccee1f0
    domain: sensor
    trigger: device
    above: 100
    for:
      hours: 0
      minutes: 5
      seconds: 0
conditions: []
actions:
  - action: script.benachrichtigung_je_nach_standort
    metadata: {}
    data:
      message: Achtung Pumpe Läuft zu lange.
mode: single

I have twoe issues with them:

  1. Timer is not persistant, however it would restart if HA reboots for whatever reason?
  2. I would have to write 4 automations in the end, is there a more elegant way?

If I would use a timer I would additionally need four timer helpers right?

Kidn regards Nils

ad 1)
Nope, the ‘timer’ would not restart because the event (pump power above 100W) has already passed. It will only start counting the 5min again once the power falls below 100W and then goes above 100W again. Triggering a timer would do the trick because timers ‘survive’ restarts, but: yes, you’d need one for each pump because them triggering might overlap. Don’t forget that you’ll have to cancel the timers when the power falls below 100W again for each pump.

ad 2)
You can cover all this in 1 automation by using trigger ids which are then picked up in the action section under a ‘Choose’ building block, but I think you’d have to change the automation itself from single to parallel mode to be able to manage all 4 pumps. I’ve never needed to do that before, though.

1 Like