-//#include <Time.h>
 #include <DHT22.h>
 
 #define DHT22_PIN 6


void loop() {
  getValues();
  
  // clamp the envelope min/max, decay otherwise
  if (env_min > humidity) {

  thresholdLow = env_min + (env_max - env_min) / 20.0f;
  thresholdHigh = env_min + (env_max - env_min) / 2.0f;

  /*
   * Check state
   */
  int new_state = FAN_NOCHANGE;
  if (humidity < thresholdLow) {
    new_state = FAN_OFF;
