     delay(5000);
   }
 }
+

  // flash Qmote LED as indicator
  flash_LED();

  if(!qmoteDisconnected)
  {
    // turn on FAN through WeMo Switch
    wemo_fan_on();
  }
  else
  {
    // turn off FAN through WeMo Switch
    // Note: this control is tricky. If Qmote is disconnected, this command never goes to WeMo.
    //       the ultimate solution will be a disconnected trigger of Qmote on IFTTT.
    wemo_fan_off();
  }
}


/**
 * Heat Index Calculator

    unsigned int currentRhInt = (unsigned int) currentRh;
    float currentHeatIndex = heatIndex((double) currentTemp, (double) currentRh);

    /*
    //debug output
    unsigned int teim = timeElapsed / (long) 60000;
    qmoteCmd = "ATBN=0x0A,\"";        // using click combination code 0x0A, --..
    qmoteCmd += isOn;
    qmoteCmd += ",";
    qmoteCmd += teim;
    qmoteCmd += "\"\r\n";
    portOne.write(qmoteCmd.c_str());
    delay(3000);
    */

    // RhT logging in text file
    qmoteCmd = "ATBN=0x0A,\"RH";      // using click combination code 0x0A, --..
    qmoteCmd += currentRhInt;
    qmoteCmd += ",T";
