in my kitchen I have a switch, which should trigger an automation, when switched off.
The automation should first switch off the plug for my dishwasher and then check two different sensor values till both are true. Then the same plug should be switched on again.
“becomes” and “is” are two different things. “Becomes” will trigger the wait for trigger. “is” will not. Triggers are events, not states.
Use a wait template instead. This will wait until the two conditions are true, they can be true already and the wait will finish:
wait_template: "{{ states('sensor.battery_soc')|float(0) > 25 and states('sensor.solar_production_2')|float(0) > 3000 }}"
Note: it is not wise to wait in automations for long periods of time. The chances of you reloading automations or restarting (cancelling the automation) become more likely the longer you wait.
It would be wiser if you triggered a separate automation to turn the switch back on.
You can ensure both sensor values are true like this: