Issue with If statement and boolean logic
I ran a test with your original code, with rain and wind varying over all the range:

(rain, wind) -&gt; action
------------------------
(600, 1) -&gt; motor_closed
(600, 2) -&gt; motor_closed
(600, 3) -&gt; motor_closed
(600, 4) -&gt; motor_closed
(600, 5) -&gt; motor_closed
(650, 1) -&gt; 
(650, 2) -&gt; 
(650, 3) -&gt; 
(650, 4) -&gt; 
(650, 5) -&gt; motor_closed
(700, 1) -&gt; 
(700, 2) -&gt; 
(700, 3) -&gt; 
(700, 4) -&gt; 
(700, 5) -&gt; motor_closed
(750, 1) -&gt; 
(750, 2) -&gt; 
(750, 3) -&gt; 
(750, 4) -&gt; 
(750, 5) -&gt; motor_closed
(800, 1) -&gt; 
(800, 2) -&gt; 
(800, 3) -&gt; 
(800, 4) -&gt; 
(800, 5) -&gt; motor_closed
(850, 1) -&gt; 
(850, 2) -&gt; 
(850, 3) -&gt; 
(850, 4) -&gt; 
(850, 5) -&gt; motor_closed
(900, 1) -&gt; 
(900, 2) -&gt; 
(900, 3) -&gt; 
(900, 4) -&gt; 
(900, 5) -&gt; motor_closed
(950, 1) -&gt; motor_open
(950, 2) -&gt; 
(950, 3) -&gt; 
(950, 4) -&gt; 
(950, 5) -&gt; motor_closed


So your logical expression reduces to this:

if (analogRead(rain) &lt; 650 || Wind &gt; 4) {motor_close();}
else if (analogRead(rain) &gt; 900 and Wind == 1) {motor_open();}


It's that what you want? 

What's that "limiting switch"? May be it's a physical problem (like installing sensor under de roof)