   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
+    } else {
+      mcp.digitalWrite(relayPin_K1, HIGH); //TURN OFF RELAY
+    }
+  }
+//ZONE 2
+  if ( (strcmp(device_name, "Zone A2") == 0) ) {
+    if (state) {
+      mcp.digitalWrite(relayPin_K2, LOW); //TURN ON RELAY
+    } else {
+      mcp.digitalWrite(relayPin_K2, HIGH); //TURN OFF RELAY
+    }
+  }
+//ZONE 3
+  if ( (strcmp(device_name, "Zone A3") == 0) ) { 
+    if (state) {
+      mcp.digitalWrite(relayPin_K3, LOW); //TURN ON RELAY
+    } else {
+      mcp.digitalWrite(relayPin_K3, HIGH); //TURN OFF RELAY
+    }
+  }
+//ZONE 4
+  if ( (strcmp(device_name, "Zone A4") == 0) ) {
+    if (state) {
+      mcp.digitalWrite(relayPin_K4, LOW); //TURN ON RELAY
+    } else {
+      mcp.digitalWrite(relayPin_K4, HIGH); //TURN OFF RELAY
+    }
+  }
+//ZONE 5
+  if ( (strcmp(device_name, "Zone A5") == 0) ) {
+    if (state) {
+      mcp.digitalWrite(relayPin_K5, LOW); //TURN ON RELAY
+    } else {
+      mcp.digitalWrite(relayPin_K5, HIGH); //TURN OFF RELAY
+    }
+  } 
+//ZONE 6
+  if ( (strcmp(device_name, "Zone A6") == 0) ) {
+    if (state) {
+      mcp.digitalWrite(relayPin_K6, LOW); //TURN ON RELAY
+    } else {
+      mcp.digitalWrite(relayPin_K6, HIGH); //TURN OFF RELAY
+    }
+  }  
+//ZONE 7
+  if ( (strcmp(device_name, "Zone A7") == 0) ) {
+    if (state) {
+      mcp.digitalWrite(relayPin_K7, LOW); //TURN ON RELAY
+    } else {
+      mcp.digitalWrite(relayPin_K7, HIGH); //TURN OFF RELAY
+    }
+  }
+//ZONE 8
+  if ( (strcmp(device_name, "Zone A8") == 0) ) {
+    if (state) {
+      mcp.digitalWrite(relayPin_K8, LOW); //TURN ON RELAY
+    } else {
+      mcp.digitalWrite(relayPin_K8, HIGH); //TURN OFF RELAY
+    }
+  }
+} // end function
+
+// WIFI setup function
+//------------------------------------------------------------------------------------------------
+
+void wifiSetup() {
+  // Set WIFI module to STA mode
+  WiFi.mode(WIFI_STA);
+
+  // Connect
+  Serial.printf("[WIFI] Connecting to %s ", WIFI_SSID);
+  WiFi.begin(WIFI_SSID, WIFI_PASS);
+
+  // Wait
+  while (WiFi.status() != WL_CONNECTED) {
+      Serial.print(".");
+      delay(100);
+  }
+  Serial.println();
+
+  // Connected!
+  Serial.printf("[WIFI] STATION Mode, SSID: %s, IP address: %s\n", WiFi.SSID().c_str(), WiFi.localIP().toString().c_str());
+}
+//------------------------------------------------------------------------------------------------
+

  display.drawString(48, 45, (stringVal));
  
  // Check for Alert
  alertPinState = digitalRead(ALERT_PIN); // read the Alert from pin
  alertRegisterState = sensor0.alert();   // read the Alert from register


  /*
  // Print temperature and alarm state
  Serial.print("Temperature: ");

  Serial.println(alertRegisterState);
  */
}
//function to extract decimal part of float (SUB ROUTINE OF TEMP UPDATE)
long getDecimal(float val)
{
  int intPart = int(val);
