   last_interrupt_time = interrupt_time;
 }
 
+boolean isExposedToWater() {
+  return (digitalRead(WATER_PIN) == LOW);
+}

   Circuit:
   * Arduino UNO
   * Ethernet shield attached to pins 10, 11, 12, 13
   * Water sensor attached to digitial pin 2
   * Temperature/Humidity (DHT11) sensor attached to digital pin 3
 
   Created 22-JAN-2017 by Jon Brule
----------------------------------------------------------------------------- */

void loop() {
  mqtt.check();
  readSensors();
  delay(10000);
  //sleep();
}

void readSensors() {
  float temperature = dhts.temperature();
  float humidity = dhts.humidity();
  boolean waterPresent = isExposedToWater();

  String json = "{";
  json += "\"temperature\": ";
  json += temperature;
  json += ", \"humidity\": ";
  json += humidity;
  json += ", \"water\": ";
  json += (waterPresent ? "PRESENT" : "NOT PRESENT");
  json += ", \"door\": \"";
  json += (doorState == LOW ? "OPEN" : "CLOSED");
  json += "\"}";
