In this case you could use the programmable logic with a delay function.
Input of the programmable logic gate would be the level sensor function, the output of the gate would be used as the socket...