 void toggleHeater() {
   if (heaterState) {
     digitalWrite(heaterRelay, LOW);
+    if (Debugging) {
+      debugger.println("Water heater off.");
+    }
     mqtt.publish(pStatus, "water heater|off");
   }
   else {
     digitalWrite(heaterRelay, HIGH);
+    if (Debugging) {
+      debugger.println("Water heater on.");
+    }
     mqtt.publish(pStatus, "water heater|on");
   }
   heaterState = !heaterState;

  if (Debugging) {
    debugger.println("MQTT Connected");
  }
  
  // Subscribe to time beacon channel to keep RTC up to date.
  mqtt.subscribe(sTime);
  
  // Subscribe to remote trigger channel to allow remote control of chicken coop
  mqtt.subscribe(sRemote);
}

  digitalWrite(doorBottom, HIGH); // Enable resistor
  digitalWrite(fan, LOW);
  digitalWrite(fanSpeed, LOW);
}

/**
 * Main program loop
 */
void loop() {
  esp.process();

  // Only fetch new sensor data if it's been long enough since the last reading.
  if ((unsigned long)(millis() - readingInterval) >= lastReading) {
    // Read new data from sensors
    readSensors();

    // Respond ot sensor data
    handleSensorReadings();
  }

  // Move the door as needed
  doorMove();

  // Update door LEDs as needed
  doorLEDs();
  
  // Update the LCD display
  updateLCD();
}
