     if (queue[i]==2) {
       action="on";
     }
-    statusUpdate.concat (action + i + ",");
-  }
-  if (isDebugEnabled) {
-    Serial.print("Sending Update Message ");
-    Serial.println(statusUpdate);
-  }
-  //smartthing.send(statusUpdate);
-  sendNotify();
-  statusUpdate = "";
-  if (isDebugEnabled) {
-    Serial.println("Ending sendUpdate ");
-  }
-}
-
-String makeUpdate(String statusUpdate) {
-  if (isDebugEnabled) {
-    Serial.println("Starting makeUpdate");
-  }
-  //statusUpdate="{";
-  // builds a status update to send to SmartThings hub
-  String action="";
-  for (int i=1; i<stations+1; i++) {
-    
-    if (queue[i]==0) {
-      action="off";
-    }
-    if (queue[i]==1) {
-      action="q";
-    }
-    if (queue[i]==2) {
-      action="on";
-    }
-    statusUpdate.concat (action + i + ",");
-  }
-  //statusUpdate.concat ("}");
+
+    //rel["name"] = key;
+    //rel["action"] = action;
+    rel[key] = action;
+    key="";
+  }
+
+  if (isConfigPump && configPumpStatus == "enabled") {
+    json["pump"] = "pumpAdded";
+  }
+  if (!isConfigPump && !isPin4Pump) {
+    json["pump"] = "pumpRemoved";
+  }
+  if (configPumpStatus == "on" || pin4PumpStatus == "on") {
+    json["pump"] = "onPump";
+  }
+  if (configPumpStatus =="off" && isConfigPump) {
+    json["pump"] = "offPump";
+  }
+  if (pin4PumpStatus =="off" && isPin4Pump) {
+    json["pump"] = "offPump";
+  }
+  
+  json["version"] = version;
+  
+  Serial.print("JSON ");
+  json.printTo(Serial);
+  json.printTo(statusUpdate);
   
   if (isDebugEnabled) {
     Serial.print("Created Update Message ");

      }
    }
    if (strcmp(inValue[1],"1")==0) {
      //pumpOff();
    }
    if (strcmp(inValue[1],"2")==0) {
       //pumpOn();
    }
    if (strcmp(inValue[1],"3")==0) {
      isConfigPump = true;

  
  server.on("/command", handleCommand);
  server.on("/status", handleStatus);
  server.on("/update", HTTP_GET, [](){
      server.sendHeader("Connection", "close");
      server.sendHeader("Access-Control-Allow-Origin", "*");
      server.send(200, "text/html", serverIndex);
    });
  server.on("/updateOTA", HTTP_POST, [](){
      server.sendHeader("Connection", "close");
      server.sendHeader("Access-Control-Allow-Origin", "*");
      server.send(200, "text/plain", (Update.hasError())?"FAIL":"OK");
      ESP.restart();
    },[](){
      HTTPUpload& upload = server.upload();
      if(upload.status == UPLOAD_FILE_START){
        Serial.setDebugOutput(true);
        WiFiUDP::stopAll();
        Serial.printf("Update: %s\n", upload.filename.c_str());
        uint32_t maxSketchSpace = (ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000;
        if(!Update.begin(maxSketchSpace)){//start with max available size
          Update.printError(Serial);
        }
      } else if(upload.status == UPLOAD_FILE_WRITE){
        if(Update.write(upload.buf, upload.currentSize) != upload.currentSize){
          Update.printError(Serial);
        }
      } else if(upload.status == UPLOAD_FILE_END){
        if(Update.end(true)){ //true to set the size to the current progress
          Serial.printf("Update Success: %u\nRebooting...\n", upload.totalSize);
        } else {
          Update.printError(Serial);
        }
        Serial.setDebugOutput(false);
      }
      yield();
    });

  server.on("/esp8266ic.xml", HTTP_GET, [](){
    if (isDebugEnabled) {
