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.
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?
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
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.