Thanks @johnerrington - I did that, and it still works as expected. Have been reading a bit more about INPUT_PULLUP to try to understand it a bit more.
@DrDiettrich - I've redone the circuit diagram, and hope it is understandable now. I'm still a noob at all this and trying to learn more, and hopefully I'll get better at them
A couple of things to note on the diagram. I didn't know how to show the arduino being powered, but for now it is just plugged into my laptop via USB. I didn't include the rain sensor, as I've no idea how to incorporate that in a circuit diagram, just assume that the arduino is taking readings from it. I also forgot to include resistors just before the two LEDs at the bottom.

Also, contrary to what I said before, the amount of light given off by the LEDs is lower when using the push buttons over D2/D3, similar to what I noticed before with the relay.
Here's the code if you're interested:
/*
Take 10 readings and use the average to work out how wet it is. If it is above a certain threshold
open the door if it is closed, and below a certain threshhold, close the door if it is open.
There is a manual override switch that allows us to control the door and not take any sensor readings.
*/
#define sensorPower 8
#define sensorAnalogPin A0
int relay1 = 2;
int relay2 = 3;
int buzzer = 9;
const int switchPin = 4;
const int ledPin = 12;
const int push1 = 6;
const int push2 = 7;
const String OPEN = "OPEN";
const String CLOSED = "CLOSED";
int analogAverage[10]; // Store the most recent 10 readings
int arrayCount = 0; // use this to loop over the array above
int previousValue;
String state = OPEN;
boolean manualMode;
void setup() {
pinMode(sensorPower, OUTPUT);
pinMode(relay1, OUTPUT);
pinMode(relay2, OUTPUT);
pinMode(buzzer, OUTPUT);
pinMode(switchPin, INPUT_PULLUP);
pinMode(ledPin, OUTPUT);
pinMode(push1, OUTPUT);
pinMode(push2, OUTPUT);
// Initially keep the sensor OFF
digitalWrite(sensorPower, LOW);
digitalWrite(relay1, LOW);
digitalWrite(relay2, LOW);
digitalWrite(push1, HIGH);
digitalWrite(push2, HIGH);
Serial.begin(9600);
// play tone just to check it is working
tone(buzzer, 400, 500);
resetArrays();
}
void loop() {
int switchValue = digitalRead(switchPin);
Serial.println(switchValue);
if (switchValue == HIGH) {
// manual mode, so switch on push buttons and turn on light
if (!manualMode) {
digitalWrite(push1, HIGH);
digitalWrite(push2, HIGH);
digitalWrite(ledPin, HIGH);
}
manualMode = true;
} else {
// sensor mode
if (manualMode) {
// was manual mode, now going to sensor mode, so switch off push buttons and turn off light
digitalWrite(push1, LOW);
digitalWrite(push2, LOW);
digitalWrite(ledPin, LOW);
resetArrays();
}
manualMode = false;
analogAverage[arrayCount] = readSensor(); // read sensor value into array
int valAverage = arrayAverage(analogAverage, 10);
shouldDoorOpenOrClose(valAverage);
// increment, and if needed reset, the array counter
incrementAndResetArrayCount();
}
delay(5000);
}
void resetArrays() {
// fill average array with current reading over 5 seconds
for (int i = 0; i < 10; i++) {
analogAverage[i] = readSensor();
delay(500);
}
}
/**
return false to close the door, true to open.
*/
void shouldDoorOpenOrClose(int valAverage) {
// is the value on an upwards or downwards trend?
Serial.print("valAverage = ");
Serial.print(valAverage);
Serial.println("");
if (valAverage > 850) {
// almost certainly quite dry even if the sensor is getting a bit moister
controlShutterDoor(true);
} else if (valAverage < 500) {
// almost certainly quite wet even if the sensor is getting a bit dryer
controlShutterDoor(false);
}
}
void controlShutterDoor(bool shouldOpen) {
if (shouldOpen) {
Serial.print(" Status: Clear ");
if (CLOSED == state) {
Serial.println(" Opening the door");
buzzAndTurnMotor(400, relay1);
state = OPEN;
onStateChange(30000); // change to 5 minutes IRL on opening
}
} else { // should close
Serial.print(" Status: Raining ");
if (OPEN == state) {
// close the door, takes about 20 seconds
Serial.println(" Closing the door");
buzzAndTurnMotor(4000, relay2);
state = CLOSED;
onStateChange(30000); // change to 30 minutes IRL on closing
}
}
}
void onStateChange(int delayMS) {
delay(delayMS);
resetArrays();
}
int readSensor() {
//get the reading from the sensor and print it
digitalWrite(sensorPower, HIGH); // Turn the sensor ON
delay(40); // Allow power to settle
int valAnalog = analogRead(sensorAnalogPin);
digitalWrite(sensorPower, LOW); // Turn the sensor OFF
Serial.print(" Analog Output: ");
Serial.print(valAnalog);
return valAnalog;
}
int arrayAverage(int values[], int size) {
int total = 0;
Serial.print(" - ");
for ( int k = 0 ; k < size ; ++k ) {
total += values[k];
Serial.print(values[k]);
Serial.print(", ");
}
return total / size;
}
void incrementAndResetArrayCount() {
arrayCount++;
if (arrayCount > 9) {
arrayCount = 0;
}
}
void buzzAndTurnMotor(int buzzFrequency, int relayPin) {
digitalWrite(relayPin, HIGH);
for (int i = 0; i < 10; i++) {
tone(buzzer, buzzFrequency, 500);
delay(1000);
}
digitalWrite(relayPin, LOW);
}