Delay Off water pump

Hello,

I would like to do a very simple thing but I am new in NR and every time something is wrong.
I need to add a delay to switch off the water pump, for example, 10 minutes after switching off the manual switch.
When I use the delay node it looks easy, but… it collects all messages, and if, for example, do switch off and during this 10 minutes switch on again then all collected messages during this time will switch off the water pump and again do switch on because of a status manual switch.
How to do that -check if the pump is on then switch it off but if is off then no delay new messages.

Several ways of achieving it.
One Idea is that you could filter the on & off message with a switch node.
Then the Off message you just send to the timer node.
The On message you can also send to the timer node, but add a change node in between that then sends the cancel message to the timer node.