Rebuilding aquarium controller sketch

I recently had to re-install Windows and forgot to save the sketch I built for my aquarium controller. I needed to make some adjustments, so had to rebuild it. All of the small adjustments I originally made I, of course, can’t remember how to them.
I could use some help figuring out why my heater and fan relays don’t work correctly, don’t delay.
I had my temperature reading out to only 1 decimal place and can’t remember or find the simple code for that.
I had also made serious adjustments to the code I’m using for my LEDs and have no idea what I did originally. There seems to be a 4 hour delay in the middle of the cycle and when I made tweaks to some other things, they turned off completely and haven’t come back on.
I have posted the full code and any constructive help would be appreciated.

everythingDaylightSavings.ino (10.2 KB)

whoops!

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <OneWire.h>
#include <DS1307RTC.h>
#include <Time.h>
#include <Timezone.h>

TimeChangeRule myDST = {"PST", First, Sun, Nov, 2, -420};     //Standard time = UTC - 8 hours
TimeChangeRule mySTD = {"PDT", Second, Sun, Mar, 2, -480};    //Daylight time = UTC - 7 hours
Timezone myTZ(myDST, mySTD);

TimeChangeRule *tcr;        //pointer to the time change rule, use to get TZ abbrev
time_t utc, local;


int DS18S20_Pin = 10;      //DS18S20 Signal
OneWire ds(DS18S20_Pin);   //Temperature chip i/o
LiquidCrystal_I2C lcd(0x27, 20, 4);

#define RELAY1  30   //open                     
#define RELAY2  32   //fan                     
#define RELAY3  34   //heater                     
#define RELAY4  36   //ATO pump

const int FloatSwitch1 = 38;  //pump control
const int FloatSwitch2 = 40;  //overfill safety
const int FloatSwitch3 = 42;  //reservoir empty
const int FloatSwitch4 = 44;  //reservoir low

int buttonState1 = 0;
int buttonState2 = 0;
int buttonState3 = 0;
int buttonState4 = 0;

int blueLed = 2;
int whiteLed = 3;
int violetLed = 4;
int ocwLed = 5;

/***************   LED variables    ******************/

int minCounter = 0;         // counter that resets at midnight. Don't change this.
int fadeDuration = 240;      // duration of the fade on and off for sunrise and sunset.

int blueStartMins = 540;    // number of minutes past midnight to start
int whiteStartMins = 540;
int violetStartMins = 540;
int ocwStartMins = 540;

int bluePhotoPeriod = 240;  // photoperiod in minutes.
int whitePhotoPeriod = 240;
int violetPhotoPeriod = 240;
int ocwPhotoPeriod = 240;

int blueMax = 200;          // max intensity.
int whiteMax = 200;
int violetMax = 255;
int ocwMax = 255;

/**************     LED functions     *******************/

//set LED brightness according to time of day - fade up, hold, fade down
void setLed(int mins,    // current time in minutes
            int ledPin,  // pin for this channel of LEDs
            int start,   // start time for this channel of LEDs
            int period,  // photoperiod for this channel of LEDs
            int fade,    // fade duration for this channel of LEDs
            int ledMax   // max value for this channel
           )  {
  if (mins > start && mins <= start + fade)  {
    analogWrite(ledPin, map(mins - start, 0, fade, 0, ledMax));
  }
  if (mins > start + period && mins <= start + period - fade)  {
    analogWrite(ledPin, ledMax);
  }
  if (mins > start + period - fade && mins <= start + period)  {
    analogWrite(ledPin, map(mins - start + period - fade, 0, fade, ledMax, 0));
  }
}

void setup() {

  Serial.begin(115200);  // Used to type in characters
  lcd.begin();         // initialize the lcd
  setSyncProvider(RTC.get);   // the function to get the time from the RTC
  if (timeStatus() != timeSet)
    Serial.println("Unable to sync with the RTC");
  else
    Serial.println("RTC has set the system time");

  pinMode(RELAY1, OUTPUT);
  pinMode(RELAY2, OUTPUT);
  pinMode(RELAY3, OUTPUT);
  pinMode(RELAY4, OUTPUT);
  digitalWrite(RELAY1, LOW);
  digitalWrite(RELAY2, HIGH);
  digitalWrite(RELAY3, HIGH);
  digitalWrite(RELAY4, HIGH);
  pinMode(FloatSwitch1, INPUT);
  pinMode(FloatSwitch2, INPUT);
  pinMode(FloatSwitch3, INPUT);
  pinMode(FloatSwitch4, INPUT);
  digitalWrite(FloatSwitch1, HIGH);
  digitalWrite(FloatSwitch2, HIGH);
  digitalWrite(FloatSwitch3, HIGH);
  digitalWrite(FloatSwitch4, HIGH);


}


void loop() {
void loop() {

  /*************************************************/
  /*************         Time          *************/
  /*************************************************/

  Serial.print(hour());
  Serial.print(minute());
  Serial.print(" ");
  Serial.print(second());
  Serial.print(" ");
  Serial.print(day());
  Serial.print(" ");
  Serial.print(month());
  Serial.print(" ");
  Serial.print(year());
  Serial.println();

  int yr;
  yr = year() - 2000;
  int hr_24, hr_12;
  hr_24 = hour();
  hr_12 = hr_24 - 12;

  if (hr_24 == 0) hr_12 = 12;
  else hr_12;

  lcd.setCursor(0, 0);
  if (hr_12 < 10) {
    lcd.print(" ");
  }
  lcd.print(hr_12);
  lcd.print(":");
  if (minute() < 10) {
    lcd.print(0);
  }
  lcd.print (minute());
  if (hr_24 < 12) lcd.print("a");
  else lcd.print("p");
  lcd.setCursor(11, 0);
  lcd.print(month());
  lcd.print("/");
  lcd.print(day());
  lcd.print("/");
  lcd.print(yr);


  /*************************************************/
  /*************     ONE-WIRE TEMP     *************/
  /*************************************************/

  byte i;
  byte present = 0;
  byte type_s;
  byte data[12];
  byte addr[8];
  float celsius, fahrenheit;

  if ( !ds.search(addr)) {
    Serial.println("No more addresses.");
    Serial.println();
    ds.reset_search();
    delay(250);
    return;
  }

  Serial.print("ROM =");
  for ( i = 0; i < 8; i++) {
    Serial.write(' ');
    Serial.print(addr[i], HEX);
  }

  if (OneWire::crc8(addr, 7) != addr[7]) {
    Serial.println("CRC is not valid!");
    return;
  }
  Serial.println();

  // the first ROM byte indicates which chip
  switch (addr[0]) {
    case 0x10:
      Serial.println("  Chip = DS18S20");  // or old DS1820
      type_s = 1;
      break;
    case 0x28:
      Serial.println("  Chip = DS18B20");
      type_s = 0;
      break;
    case 0x22:
      Serial.println("  Chip = DS1822");
      type_s = 0;
      break;
    default:
      Serial.println("Device is not a DS18x20 family device.");
      return;
  }

  ds.reset();
  ds.select(addr);
  ds.write(0x44, 1);        // start conversion, with parasite power on at the end

  delay(1000);     // maybe 750ms is enough, maybe not
  // we might do a ds.depower() here, but the reset will take care of it.

  present = ds.reset();
  ds.select(addr);
  ds.write(0xBE);         // Read Scratchpad

  Serial.print("  Data = ");
  Serial.print(present, HEX);
  Serial.print(" ");
  for ( i = 0; i < 9; i++) {           // we need 9 bytes
    data[i] = ds.read();
    Serial.print(data[i], HEX);
    Serial.print(" ");
  }
  Serial.print(" CRC=");
  Serial.print(OneWire::crc8(data, 8), HEX);
  Serial.println();

  // Convert the data to actual temperature
  // because the result is a 16 bit signed integer, it should
  // be stored to an "int16_t" type, which is always 16 bits
  // even when compiled on a 32 bit processor.
  int16_t raw = (data[1] << 8) | data[0];
  if (type_s) {
    raw = raw << 3; // 9 bit resolution default
    if (data[7] == 0x10) {
      // "count remain" gives full 12 bit resolution
      raw = (raw & 0xFFF0) + 12 - data[6];
    }
  } else {
    byte cfg = (data[4] & 0x60);
    // at lower res, the low bits are undefined, so let's zero them
    if (cfg == 0x00) raw = raw & ~7;  // 9 bit resolution, 93.75 ms
    else if (cfg == 0x20) raw = raw & ~3; // 10 bit res, 187.5 ms
    else if (cfg == 0x40) raw = raw & ~1; // 11 bit res, 375 ms
    //// default is 12 bit resolution, 750 ms conversion time
  }
  celsius = (float)raw / 16.0;
  fahrenheit = celsius * 1.8 + 32.0;
  Serial.print("  Temperature = ");
  Serial.print(celsius);
  Serial.print(" Celsius, ");
  Serial.print(fahrenheit);
  Serial.println(" Fahrenheit");
  float TemperatureSum = ((float)raw / 16.0 * 1.8 + 32.0);

  /**************************************************/
  /************     Temp to LCD in F     ************/
  /**************************************************/

    lcd.setCursor(0, 1);     //Start at character 0 on line 0
    lcd.print(TemperatureSum);     //output the temperature to lcd
    lcd.setCursor(5, 1);
    lcd.print((char)223);      //degrees symbol
    lcd.setCursor(6, 1);
    lcd.print("F");
  /************************************************/
  /************       LED Control      ************/
  /************************************************/

  minCounter = (hour() * 60 + minute());

  // determine if it is day or night, and act accordingly
  if ((minCounter > blueStartMins || minCounter > whiteStartMins || minCounter > violetStartMins || minCounter > ocwStartMins)
      && (minCounter < blueStartMins + bluePhotoPeriod || minCounter < whiteStartMins + whitePhotoPeriod ||
          minCounter < violetStartMins + violetPhotoPeriod || minCounter < ocwStartMins + ocwPhotoPeriod))  { //day
      // set LED states
      setLed(minCounter, blueLed, blueStartMins, bluePhotoPeriod, fadeDuration, blueMax);
      setLed(minCounter, whiteLed, whiteStartMins, whitePhotoPeriod, fadeDuration, whiteMax);
      setLed(minCounter, violetLed, violetStartMins, violetPhotoPeriod, fadeDuration, violetMax);
      setLed(minCounter, ocwLed, ocwStartMins, ocwPhotoPeriod, fadeDuration, ocwMax);
  }
  else  {
    analogWrite(blueLed, 0);    //night
    analogWrite(whiteLed, 0);
    analogWrite(violetLed, 0);
    analogWrite(ocwLed, 0);
  }

  /************************************************/
  /************     Heater Control     ************/
  /************************************************/

  if (TemperatureSum < 77.4) {
    digitalWrite(RELAY3, LOW);
    delay(TemperatureSum == 77.8);

    lcd.setCursor(0, 2);
      lcd.print("Heat");
  }
  else {
    digitalWrite(RELAY3, HIGH);

  }

  /*********************************************/
  /************     Fan Control     ************/
  /*********************************************/

  if (TemperatureSum > 77.80) {
    digitalWrite(RELAY2, LOW);
     delay(TemperatureSum == 77.30); 
     
   lcd.setCursor(0, 2);
     lcd.print(" Fan");
  }
  else {
  digitalWrite(RELAY2, HIGH);
  }

/*********************************************/
/************     ATO Control     ************/
/*********************************************/

buttonState1 = digitalRead(FloatSwitch1);
buttonState2 = digitalRead(FloatSwitch2);
buttonState3 = digitalRead(FloatSwitch3);
buttonState4 = digitalRead(FloatSwitch4);

  if (buttonState4 == LOW) {    /////Low indicator
       lcd.setCursor(12, 1);
         lcd.print("Fill Res");
  }

  if (buttonState2 == LOW) {    /////Overfill safety
      digitalWrite(RELAY4, HIGH);
  }
  else {
      digitalWrite(RELAY4, HIGH);
  }
  if (buttonState1 == LOW && buttonState2 == HIGH && buttonState4 == HIGH) {
      digitalWrite(RELAY4, LOW);
  }
  else {
      digitalWrite(RELAY4, HIGH);
  }

  if (buttonState3 == LOW) {    /////Empty indicator
      digitalWrite(RELAY4, HIGH);
        lcd.setCursor(12, 1);
          lcd.print("Res EMPTY");
          
    delay(500);
    lcd.setCursor(12, 1);
    lcd.print("         ");
    delay(500);
  }

}