In my last two houses, I had a blockage from schmutz in the A/C condensate drain line, and fortunately caught it early,
A friend of my Son who does A/C work recommended this item.
about $20. Its a float that shuts off the "Y" wire on the A/C so if the pan if plugged it won't keep running the compressor so it will prevent over flow to your carpet or hardwood flooring. Most A/C pans have a 3/4"plug to accept one of these.