+// The DHT library for the temp sensor (I used V 1.2.3 by adafruit)
 #include <DHT.h>
-
-/*
-  Web Server
-
- A simple web server that shows the value of the analog input pins.
- using an Arduino Wiznet Ethernet shield.
-
- Circuit:
- * Ethernet shield attached to pins 10, 11, 12, 13
- * Analog inputs attached to pins A0 through A5 (optional)
-
- created 18 Dec 2009
- by David A. Mellis
- modified 9 Apr 2012
- by Tom Igoe
- modified 02 Sept 2015
- by Arturo Guadalupi
-
- */
 
 #include <SPI.h>
 #include <Ethernet.h>

        // character) and the line is blank, the http request has ended,
        // so you can send a reply
        if (c == '\n' && currentLineIsBlank) {

            // send a standard http response header
            client.println("HTTP/1.1 200 OK");
            client.println("Content-Type: application/xml");
            client.println("Connection: close");  // the connection will be closed after completion of the response          
            client.println();
            client.println("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>");
            client.println("<prtg>");

            switchValue = digitalRead(switchPin);


            // read the analog in value:
            sensorValue = analogRead(analogInPin);

                      
            // map it to the range of the analog out:
            outputValue = map(sensorValue, 0, 800, 0, 100);
            if(outputValue >100)
            {
              outputValue = 100;
            }
            client.print("<result><channel>Light</channel><unit>Percent</unit><float>1</float><value>");
            client.print(outputValue);
            client.println("</value></result>");

               client.print("<result><channel>Reservoir</channel><valueLookup>developingtrends.greenhouse.reservoir</valueLookup><value>");
            client.print(switchValue);
            client.println("</value></result>");
            
                client.print("<result><channel>Temperature</channel><unit>Custom</unit><customUnit>°C</customUnit><float>1</float><value>");
                client.print(myDHT22.readTemperature());
                client.print("</value></result><result><channel>Humidity</channel><unit>Percent</unit><float>1</float><value>");
                client.print(myDHT22.readHumidity());
                client.println("</value></result>");
                // Alternately, with integer formatting which is clumsier but more compact to store and
             // can be compared reliably for equality:
              //    
          //      char buf[128];
           //     sprintf(buf, "Integer-only reading: Temperature %hi.%01hi C, Humidity %i.%01i %% RH",
           //                  myDHT22.getTemperatureCInt()/10, abs(myDHT22.getTemperatureCInt()%10),
           //                  myDHT22.getHumidityInt()/10, myDHT22.getHumidityInt()%10);
            //    client.println(buf);
            

  

                
          client.println("</prtg>");
          break;
        }
        if (c == '\n') {

byte mac[] = {
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};

IPAddress ip(192, 168, 1, 44);

// Initialize the Ethernet server library
