Issue with Node Red logic to alert if hot water outlet temperature is too cold

I have two entities on an ESPHome device that are monitoring the inlet/outlet temperatures of my hot water tank. I want to alert when the outlet temperature is below 40 degrees C, but I only want to do that when the input temperature is below 10 degrees C for 2 minutes.

The idea here is when there is demand for hot water, the cold water inlet temperature drops below 10 degrees. Then I want to alert if the output isn’t keeping above 40 degrees (i.e. I’ve run out of hot water).

I can make it alert fine just using a single temperature from an Event State node. How do I create an AND situation that will only alert when both states are true.

I think I figured it out. I ended up just installing: node-red-contrib-boolean-logic and using the AND gate in that.