 boolean airing = false;
 boolean furnace = false;
 
+String getTemperature(String data, int index)
+{
+  String retVal = "";
+  int currentfound = 0;
+
+  for (int i = 0; i <= data.length() - 1; i++) {
+    if (data.charAt(i) == ':') {
+      if (currentfound == index) {
+        for (int j = 1; j <= 6; j++) {
+          if (isDigit(data.charAt(i + j)) || data.charAt(i + j) == '.') {
+            retVal += data.charAt(i + j);
+          }
+        }
+        return retVal;
+      } else {
+        currentfound++;
+      }
+    }
+  }
+}
+
 void handleRoot() {
   server.send(200, "text/plain", "hello from esp8266!");
 }

      digitalWrite(AIRING_PIN, LOW);
    }

    server.send(200, "text/plain", "{furnace: " + String(airing) + "}");
  });

  server.on("/getFurnace", []() {
    server.send(200, "text/plain", "{furnace: " + String(furnace) + "}" );
  });

  server.on("/putFurnace", []() {

void handlePutCurrentSet() {

  if (server.hasArg("plain") == false) {
    server.send(200, "text/plain", "Body not received");
    return;
  }

  autoMode = true;

  String message = server.arg("plain");

  String humidity = getTemperature(message, 0);
  String temperature = getTemperature(message, 1);

  temperatureToLaunch = temperature.toFloat();
  humidityToLaunch = humidity.toFloat();

  server.send(200, "application/json", "{temperature: " + temperature + ", humidity: " + humidity + "}");

}

void setup(void) {
