Need help for dishwasher automation

Hi guys,

I need help with an automation system for the dishwasher.

What should happen?

When the device (dishwasher) is switched on, another smart plug with a pump should switch on. I have managed that, but this socket should switch off the pump after 1 hour, regardless of how it was triggered or if the dishwasher is still turned on.

It currently looks like this

alias: Dishwasher Pump - ON
description: ""
trigger:
  - platform: device
    type: turned_on
    device_id: 691bb8c75a7d0e3475a000ca7ad071e2
    entity_id: 5fbbbd10fe4ecd23f3c544dc1f1654f7
    domain: switch
condition: []
action:
  - type: turn_on
    device_id: ab073d15ee2221cb179974515f644ecc
    entity_id: 19208f83fb8c5dc8b66f1561a8eb8a20
    domain: switch
mode: single

If I were to write a second automation, in which the pump’s socket is switched off after an hour, it would probably go into a loop, if the dishwasher is still switched on. Or am I wrong?

You should be fine. The trigger is the dishwasher turning on: the change of state. If it remains on, nothing else will happen.

1 Like

You can do all-in-one automation

description: ""
mode: single
trigger:
  - platform: state
    entity_id:
      - switch.dishwasher_power
      - switch.pump_power
    to: "on"
condition:
  - condition: state
    entity_id: switch.pump_power
    state: "off"
action:
  - delay:
      hours: 1
      minutes: 0
      seconds: 0
      milliseconds: 0
  - type: turn_off
    device_id: 0b0f63c37ae5fd7fc393a99b2bd98d75
    entity_id: aba6f1acd078cf43943447bea3cfee09
    domain: switch

So when either the dishwasher_power socket or the pump_power socket changes state to ON, and the pump_power socket state is not already on, it will start a timer for 1 hour and then turn off pump_power

1 Like

Thank you for your help.

So if I understand you correctly, this isn’t a problem, because the script is only triggered once - when the dishwasher is switched to ON.
It doesn’t matter that the dishwasher is still switched on (after the pump is switched off), because HA doesn’t check this continuously, it just waits for the one-off trigger.

However - it works fine :smiley: