Turning off switch to dishwasher based on energy pattern

My dishwasher washes & dries. The dry is useless as I have pools of water on the bottoms of cups anyway. I want to turn it off at that point

Here’s the power pattern

Plugged in at 10.15
Does 2 humps over 2kw
I’ve done a few measurements but it seems to take around about an hour and 20 minutes to finish, plus or minus 10 minutes?

Measurements are a bit coarse, I think due to plug being in a cupboard? Hence the straight lines.

The 11:10 hump is still washing. After 1hr 15 it’s still going.

Around 11.37 I checked, it was in dry mode so I switched it off. So this time it was 1hr 22min.

I want to make some automation to turn off the plug after the pattern is reached. I figure I would be saving electricity although looking at it now I’m surprised that the drying mode does not seem to do much. I wonder what the big boosts in power usage are during the actual wash?

I guess one easy way would be simply set a timer after the first breach of 2 kW

I thought something more reliable might be a timer from the second time it drops after 2 kW. How would I go about doing this?

Have a look here too
Dishwasher automation with condition - Configuration - Home Assistant Community (home-assistant.io)