 // You can specify the time server pool and the offset (in seconds, can be
 // changed later with setTimeOffset() ). Additionaly you can specify the
 // update interval (in milliseconds, can be changed using setUpdateInterval() ).
-NTPClient timeClient(ntpUDP,"0.us.pool.ntp.org", -25200, 60000); 
+NTPClient timeClient(ntpUDP, "0.us.pool.ntp.org", -25200, 60000);
 
 
 //------------------------------------------------------------------------------------------------

//UPDATE TEMP FUNCTION (SHITSHOW CODE, BUT IT WORKS)
//------------------------------------------------------------------------------------------------

void updateTemp(){
  
  float temperature;
  String stringVal = ""; 
  boolean alertPinState, alertRegisterState;

  // read temperature data and write to OLED screen
  temperature = sensor0.readTempF();
  //temperature = sensor0.readTempC();
  
  // convert temperature float to string
  stringVal+=String(int(temperature))+ "."+String(getDecimal(temperature)); //combining both whole and decimal part in string with a fullstop between them
  //Serial.print("stringVal: ");Serial.println(stringVal);              //display string value
  
  char charVal[stringVal.length()+1];                      //initialise character array to store the values
  stringVal.toCharArray(charVal,stringVal.length()+1);     //passing the value of the string to the character array
  
  //Serial.print("charVal: ");  
  for(uint8_t i=0; i<sizeof(charVal);i++) //Serial.print(charVal[i]); //display character array
  
  display.setTextAlignment(TEXT_ALIGN_LEFT);
  display.setFont(ArialMT_Plain_16);
  display.drawString(0, 32, "TEMP:");
  display.drawString(80, 32, "F");
  display.drawString(48, 32, (stringVal));
  
  // Check for Alert
  alertPinState = digitalRead(alertPin); // read the Alert from pin
  alertRegisterState = sensor0.alert();   // read the Alert from register
  
  /*
  // Print temperature and alarm state
  Serial.print("Temperature: ");
  Serial.print(temperature);
  
  Serial.print("\tAlert Pin: ");
  Serial.print(alertPinState);
  
  Serial.print("\tAlert Register:  ");
  Serial.println(alertRegisterState);
  */
}
//function to extract decimal part of float (SUB ROUTINE OF TEMP UPDATE)
long getDecimal(float val)
{
  int intPart = int(val);
  long decPart = 10*(val-intPart); //I am multiplying by 1000 assuming that the foat values will have a maximum of 3 decimal places. 
                                    //Change to match the number of decimal places you need
  if(decPart>0)return(decPart);           //return the decimal part of float number if it is available 
  else if(decPart<0)return((-1)*decPart); //if negative, multiply by -1
  else if(decPart=0)return(00);           //return 0 if decimal part of float number is not available
}
//FAUXMO CALLBACK FUNCTION add devices here
//------------------------------------------------------------------------------------------------
void callback(uint8_t device_id, const char * device_name, bool state) {
  Serial.printf("[MAIN] %s state: %s\n", device_name, state ? "ON" : "OFF");
  

//ZONE 1
  if ( (strcmp(device_name, "Zone A1") == 0) ) {
    if (state) {
      mcp.digitalWrite(relayPin_K1, LOW); //TURN ON RELAY


//UPDATE IP FUNCTION
//------------------------------------------------------------------------------------------------
void updateIP() {
  String ipaddress = WiFi.localIP().toString(); // convert IP address array to string
  display.setTextAlignment(TEXT_ALIGN_LEFT);
  display.setFont(ArialMT_Plain_16);
