How to filter out "flapping" status

Have a look at the delay node too.