DC motor pulls in clothes into the home when raining, and push out to outdoors when the rain stops.

Replace moisture sensor in the sketch to water level sensor.

 

When water sensor detects water, DC motor pulls in clothes, and tri-colour LED turns red.

 

When water sensor does not detect water, Dc motor push out clothes, and tri-colour LED turns green.