diff --git a/NodeManager.cpp b/NodeManager.cpp
index b6fc63d5e854b23879178abb5c0caa72e9f69a9c..801298736408832f1764ab6380830dac7bf2d55c 100755
--- a/NodeManager.cpp
+++ b/NodeManager.cpp
@@ -66,7 +66,7 @@ Timer::Timer(NodeManager* node_manager) {
 }
 
 // start the timer
-void Timer::start(long target, int unit) {
+void Timer::start(int target, int unit) {
   set(target,unit);
   start();
 }
@@ -79,51 +79,52 @@ void Timer::stop() {
   _is_running = false;
 }
 
-// setup the timer
-void Timer::set(long target, int unit) {
+// reset the timer
+void Timer::reset() {
   // reset the timer
   _elapsed = 0;
-  _use_millis = false;
   _last_millis = 0;
-  _sleep_time = 0;
+}
+
+// restart the timer
+void Timer::restart() {
+  if (! isRunning()) return;
+  stop();
+  reset();
+  // if using millis(), keep track of the current timestamp for calculating the difference
+  if (! _node_manager->isSleepingNode()) _last_millis = millis();
+  start();
+}
+
+// setup the timer
+void Timer::set(int target, int unit) {
+  reset();
   // save the settings
   _target = target;
-  _unit = unit;
-  if (_unit == MINUTES) {
-    if (_node_manager->isSleepingNode()) {
-      // this is a sleeping node and millis() is not reliable so calculate how long a sleep/wait cycle would last
-      int sleep_unit = _node_manager->getSleepUnit();
-      _sleep_time = (float)_node_manager->getSleepTime();
-      if (sleep_unit == SECONDS) _sleep_time = _sleep_time/60;
-      else if (sleep_unit == HOURS) _sleep_time = _sleep_time*60;
-      else if (sleep_unit == DAYS) _sleep_time = _sleep_time*1440;
-    }
-    else {
-      // this is not a sleeping node, use millis() to keep track of the elapsed time
-      _use_millis = true;
-    }
-  }
+  if (unit == MINUTES) _target = _target * 60;
+  else if (unit == HOURS) _target = _target * 60 *60;
+  else if (unit == DAYS) _target = _target * 60 * 60 *24;
+  _is_running = false;
+  _is_configured = true;
+}
+
+// unset the timer
+void Timer::unset() {
+  stop();
   _is_configured = true;
 }
 
 // update the timer at every cycle
 void Timer::update() {
   if (! isRunning()) return;
-  if (_unit == CYCLES) {
-    // if not a sleeping node, counting the cycles do not make sense
-    if (! _node_manager->isSleepingNode()) return;
-    // just increase the cycle counter
-    _elapsed++;
-  }
-  else if (_unit == MINUTES) {
-    // if using millis(), calculate the elapsed minutes, otherwise add a sleep interval
-    if (_use_millis) {
-      _elapsed = (float)(millis() - _last_millis)/1000/60;
-    }
-    else {
-      _elapsed += _sleep_time;
-    }
+  if (_node_manager->isSleepingNode()) {
+    // millis() is not reliable while sleeping so calculate how long a sleep cycle would last in seconds and update the elapsed time
+    _elapsed += _node_manager->getSleepSeconds();
+  } else {
+    // use millis() to calculate the elapsed time in seconds
+    _elapsed = (long)((millis() - _last_millis)/1000);
   }
+  _first_run = false;
 }
 
 // return true if the time is over
@@ -138,6 +139,7 @@ bool Timer::isOver() {
 
 // return true if the timer is running
 bool Timer::isRunning() {
+  if (! isConfigured()) return false;
   return _is_running;
 }
 
@@ -146,25 +148,16 @@ bool Timer::isConfigured() {
   return _is_configured;
 }
 
-// restart the timer
-void Timer::restart() {
-  if (! isRunning()) return;
-  // reset elapsed
-  _elapsed = 0;
-  // if using millis, keep track of the now timestamp
-  if (_use_millis) _last_millis = millis();
+// return true if this is the first time the timer runs
+bool Timer::isFirstRun() {
+  return _first_run;
 }
 
-// return elapsed minutes so far
+// return elapsed seconds so far
 float Timer::getElapsed() {
   return _elapsed;
 }
 
-// return the configured unit
-int Timer::getUnit() {
-  return _unit;
-}
-
 
 /******************************************
     Request
@@ -268,15 +261,12 @@ void Sensor::setSamplesInterval(int value) {
 void Sensor::setTrackLastValue(bool value) {
   _track_last_value = value;
 }
-void Sensor::setForceUpdate(int value) {
-  setForceUpdateCycles(value);
-}
-void Sensor::setForceUpdateCycles(int value) {
-  _force_update_timer->start(value,CYCLES);
-}
 void Sensor::setForceUpdateMinutes(int value) {
   _force_update_timer->start(value,MINUTES);
 }
+void Sensor::setForceUpdateHours(int value) {
+  _force_update_timer->start(value,HOURS);
+}
 void Sensor::setValueType(int value) {
   _value_type = value;
 }
@@ -313,16 +303,21 @@ char* Sensor::getValueString() {
   return _last_value_string;
 }
 
-// After how many cycles the sensor will report back its measure (default: 1 cycle)
-void Sensor::setReportIntervalCycles(int value) {
-  _report_timer->start(value,CYCLES);
-}
-
-// After how many minutes the sensor will report back its measure (default: 1 cycle)
+// After how many minutes the sensor will report back its measure 
 void Sensor::setReportIntervalMinutes(int value) {
   _report_timer->start(value,MINUTES);
 }
 
+// After how many seconds the sensor will report back its measure
+void Sensor::setReportIntervalSeconds(int value) {
+  _report_timer->start(value,SECONDS);
+}
+
+// return true if the report interval has been already configured
+bool Sensor::isReportIntervalConfigured() {
+  return _report_timer->isConfigured();
+}
+
 // listen for interrupts on the given pin so interrupt() will be called when occurring
 void Sensor::setInterrupt(int pin, int mode, int initial) {
   _interrupt_pin = pin;
@@ -358,10 +353,12 @@ void Sensor::loop(const MyMessage & message) {
   // update the timers if within a loop cycle
   if (! _isReceive(message)) {
     if (_report_timer->isRunning()) {
+      // store the elapsed time before updating it
+      bool first_run = _report_timer->isFirstRun();
       // update the timer
       _report_timer->update();
-      // if it is not the time yet to report a new measure, just return
-      if (! _report_timer->isOver()) return;
+      // if it is not the time yet to report a new measure, just return (unless the first time)
+      if (! _report_timer->isOver() && ! first_run) return;
     }
     if (_force_update_timer->isRunning()) _force_update_timer->update();
   }
@@ -464,7 +461,6 @@ void Sensor::process(Request & request) {
     case 5: setSamples(request.getValueInt()); break;
     case 6: setSamplesInterval(request.getValueInt()); break;
     case 7: setTrackLastValue(request.getValueInt()); break;
-    case 8: setForceUpdateCycles(request.getValueInt()); break;
     case 9: setForceUpdateMinutes(request.getValueInt()); break;
     case 10: setValueType(request.getValueInt()); break;
     case 11: setFloatPrecision(request.getValueInt()); break;
@@ -473,8 +469,9 @@ void Sensor::process(Request & request) {
       case 13: powerOn(); break;
       case 14: powerOff(); break;
     #endif
-    case 15: setReportIntervalCycles(request.getValueInt()); break;
     case 16: setReportIntervalMinutes(request.getValueInt()); break;
+    case 17: setReportIntervalSeconds(request.getValueInt()); break;
+    case 18: setForceUpdateHours(request.getValueInt()); break;
     default: return;
   }
   _send(_msg_service.set(function));
@@ -705,7 +702,7 @@ void SensorThermistor::onLoop() {
     Serial.print(F(" V="));
     Serial.print(adc);
     Serial.print(F(" T="));
-    Serial.print(temperature);
+    Serial.println(temperature);
   #endif
   // store the value
   _value_float = temperature;
@@ -1438,15 +1435,14 @@ void SensorSwitch::setInitial(int value) {
 
 // what to do during before
 void SensorSwitch::onBefore() {
-  // initialize the value
-  if (_mode == RISING) _value_int = LOW;
-  else if (_mode == FALLING) _value_int = HIGH;
   // set the interrupt pin so it will be called only when waking up from that interrupt
   setInterrupt(_pin,_mode,_initial);
 }
 
 // what to do during setup
 void SensorSwitch::onSetup() {
+  // report immediately
+  _report_timer->unset();
 }
 
 // what to do during loop
@@ -1510,8 +1506,6 @@ SensorDoor::SensorDoor(NodeManager* node_manager, int child_id, int pin): Sensor
  */
 SensorMotion::SensorMotion(NodeManager* node_manager, int child_id, int pin): SensorSwitch(node_manager, child_id,pin) {
   setPresentation(S_MOTION);
-  // capture only when it triggers
-  setMode(RISING);
   // set initial value to LOW
   setInitial(LOW);
 }
@@ -2846,9 +2840,6 @@ int NodeManager::getRetries() {
   void NodeManager::setBatteryMax(float value) {
     _battery_max = value;
   }
-  void NodeManager::setBatteryReportCycles(int value) {
-    _battery_report_timer.set(value,CYCLES);
-  }
   void NodeManager::setBatteryReportMinutes(int value) {
     _battery_report_timer.set(value,MINUTES);
   }
@@ -2865,31 +2856,24 @@ int NodeManager::getRetries() {
     _battery_report_with_interrupt = value;
   }
 #endif
-void NodeManager::setSleepMode(int value) {
-  _sleep_mode = value;
-}
-void NodeManager::setMode(int value) {
-  setSleepMode(value);
-}
-int NodeManager::getMode() {
-  return _sleep_mode;
-}
-void NodeManager::setSleepTime(int value) {
+void NodeManager::setSleepSeconds(int value) {
+  // set the status to AWAKE if the time provided is 0, SLEEP otherwise
+  if (value == 0) _status = AWAKE;
+  else _status = SLEEP;
+  // store the time
   _sleep_time = value;
 }
-int NodeManager::getSleepTime() {
-  return _sleep_time;
+void NodeManager::setSleepMinutes(int value) {
+  setSleepSeconds(value*60);
 }
-void NodeManager::setSleepUnit(int value) {
-  _sleep_unit = value;
+void NodeManager::setSleepHours(int value) {
+  setSleepMinutes(value*60);
 }
-int NodeManager::getSleepUnit() {
-  return _sleep_unit;
+void NodeManager::setSleepDays(int value) {
+  setSleepHours(value*24);
 }
-void NodeManager::setSleep(int value1, int value2, int value3) {
-  setMode(value1);
-  setSleepTime(value2);
-  setSleepUnit(value3);
+long NodeManager::getSleepSeconds() {
+  return _sleep_time;
 }
 void NodeManager::setSleepInterruptPin(int value) {
   _sleep_interrupt_pin = value;
@@ -2952,7 +2936,7 @@ float NodeManager::celsiusToFahrenheit(float temperature) {
 
 // return true if sleep or wait is configured and hence this is a sleeping node
 bool NodeManager::isSleepingNode() {
-  if (_sleep_mode == SLEEP || _sleep_mode == WAIT) return true;
+  if (_status == SLEEP) return true;
   return false;
 }
 
@@ -3261,14 +3245,16 @@ void NodeManager::before() {
   #if BATTERY_MANAGER == 1 && !defined(MY_GATEWAY_ESP8266)
     // set analogReference to internal if measuring the battery through a pin
     if (! _battery_internal_vcc && _battery_pin > -1) analogReference(INTERNAL);
-    // if not configured report battery every 10 cycles
+    // if not already configured, report battery level every 60 minutes
     if (! _battery_report_timer.isConfigured()) _battery_report_timer.set(60,MINUTES);
     _battery_report_timer.start();
   #endif
   // setup individual sensors
   for (int i = 1; i <= MAX_SENSORS; i++) {
     if (_sensors[i] == 0) continue;
-    // call each sensor's setup()
+    // configure reporting interval
+    if (! _sensors[i]->isReportIntervalConfigured()) _sensors[i]->setReportIntervalSeconds(_report_interval_seconds);
+    // call each sensor's before()
     _sensors[i]->before();
   }
   // setup the interrupt pins
@@ -3329,14 +3315,9 @@ void NodeManager::setup() {
 // run the main function for all the register sensors
 void NodeManager::loop() {
   MyMessage empty;
-  // if in idle mode, do nothing
-  if (_sleep_mode == IDLE) return;
-  // if sleep time is not set, do nothing
-  if (isSleepingNode() &&  _sleep_time == 0) return;
   #if BATTERY_MANAGER == 1
-    // update the timer for battery report
-    if (_battery_report_timer.getUnit() == MINUTES) _battery_report_timer.update();
-    if (_battery_report_timer.getUnit() == CYCLES && (_last_interrupt_pin == -1 || _battery_report_with_interrupt)) _battery_report_timer.update();
+    // update the timer for battery report when not waking up from an interrupt
+    if (_battery_report_timer.isRunning() && _last_interrupt_pin == -1) _battery_report_timer.update();
     // if it is time to report the battery level
     if (_battery_report_timer.isOver()) {
       // time to report the battery level again
@@ -3351,15 +3332,20 @@ void NodeManager::loop() {
   #endif
   // run loop for all the registered sensors
   for (int i = 1; i <= MAX_SENSORS; i++) {
-    // skip not configured sensors
+    // skip unconfigured sensors
     if (_sensors[i] == 0) continue;
-    // if there was an interrupt for this sensor, call the sensor's interrupt()
-    if (_last_interrupt_pin != -1 && _sensors[i]->getInterruptPin() == _last_interrupt_pin) _sensors[i]->interrupt();
-    // call the sensor's loop()
-    _sensors[i]->loop(empty);
+    if (_last_interrupt_pin != -1 && _sensors[i]->getInterruptPin() == _last_interrupt_pin) {
+      // if there was an interrupt for this sensor, call the sensor's interrupt() and then loop()
+      _sensors[i]->interrupt();
+      _sensors[i]->loop(empty);
+        // reset the last interrupt pin
+      _last_interrupt_pin = -1;
+    }
+    else if (_last_interrupt_pin == -1) {
+      // if just at the end of a cycle, call the sensor's loop() 
+      _sensors[i]->loop(empty);
+    }
   }
-  // reset the last interrupt pin
-  _last_interrupt_pin = -1;
   #if POWER_MANAGER == 1
     // turn off the pin powering all the sensors
     if (_auto_power_pins) powerOff();
@@ -3441,7 +3427,6 @@ void NodeManager::process(Request & request) {
       case 2: batteryReport(); return;
       case 11: setBatteryMin(request.getValueFloat()); break;
       case 12: setBatteryMax(request.getValueFloat()); break;
-      case 13: setBatteryReportCycles(request.getValueInt()); break;
       case 14: setBatteryReportMinutes(request.getValueInt()); break;
       case 15: setBatteryInternalVcc(request.getValueInt()); break;
       case 16: setBatteryPin(request.getValueInt()); break;
@@ -3449,21 +3434,27 @@ void NodeManager::process(Request & request) {
       case 18: setBatteryReportWithInterrupt(request.getValueInt()); break;
     #endif
     case 3:
-      setSleepMode(request.getValueInt());
+      setSleepSeconds(request.getValueInt());
       #if PERSIST == 1
-        _saveConfig(SAVE_SLEEP_MODE);
+        _saveConfig();
       #endif
       break;
     case 4:
-      setSleepTime(request.getValueInt());
+      setSleepMinutes(request.getValueInt());
       #if PERSIST == 1
-        _saveConfig(SAVE_SLEEP_TIME);
+        _saveConfig();
       #endif
       break;
     case 5:
-      setSleepUnit(request.getValueInt());
+      setSleepHours(request.getValueInt());
+      #if PERSIST == 1
+        _saveConfig();
+      #endif
+      break;
+    case 29:
+      setSleepDays(request.getValueInt());
       #if PERSIST == 1
-        _saveConfig(SAVE_SLEEP_UNIT);
+        _saveConfig();
       #endif
       break;
     #ifndef MY_GATEWAY_ESP8266
@@ -3554,7 +3545,7 @@ void NodeManager::wakeup() {
   #if DEBUG == 1
     Serial.println(F("WAKEUP"));
   #endif
-  _sleep_mode = IDLE;
+  _status = AWAKE;
 }
 
 // return the value stored at the requested index from the EEPROM
@@ -3604,13 +3595,13 @@ void NodeManager::setupInterrupts() {
     pinMode(INTERRUPT_PIN_1,INPUT);
     if (_interrupt_1_initial > -1) digitalWrite(INTERRUPT_PIN_1,_interrupt_1_initial);
     // for non sleeping nodes, we need to handle the interrupt by ourselves  
-    if (_sleep_mode != SLEEP) attachInterrupt(digitalPinToInterrupt(INTERRUPT_PIN_1), _onInterrupt_1, _interrupt_1_mode);
+    if (_status != SLEEP) attachInterrupt(digitalPinToInterrupt(INTERRUPT_PIN_1), _onInterrupt_1, _interrupt_1_mode);
   }
   if (_interrupt_2_mode != MODE_NOT_DEFINED) {
     pinMode(INTERRUPT_PIN_2, INPUT);
     if (_interrupt_2_initial > -1) digitalWrite(INTERRUPT_PIN_2,_interrupt_2_initial);
     // for non sleeping nodes, we need to handle the interrupt by ourselves  
-    if (_sleep_mode != SLEEP) attachInterrupt(digitalPinToInterrupt(INTERRUPT_PIN_2), _onInterrupt_2, _interrupt_2_mode);
+    if (_status != SLEEP) attachInterrupt(digitalPinToInterrupt(INTERRUPT_PIN_2), _onInterrupt_2, _interrupt_2_mode);
   }
   #if DEBUG == 1
     Serial.print(F("INT P="));
@@ -3629,6 +3620,16 @@ int NodeManager::getLastInterruptPin() {
   return _last_interrupt_pin;
 }
 
+// set the default interval in minutes all the sensors will report their measures
+void NodeManager::setReportIntervalMinutes(int value) {
+  _report_interval_seconds = value*60;
+}
+
+// set the default interval in seconds all the sensors will report their measures
+void NodeManager::setReportIntervalSeconds(int value) {
+  _report_interval_seconds = value;
+}
+
 // handle an interrupt
 void NodeManager::_onInterrupt_1() {
   long now = millis();
@@ -3681,15 +3682,9 @@ void NodeManager::_send(MyMessage & message) {
 
 // wrapper of smart sleep
 void NodeManager::_sleep() {
-  // calculate the seconds to sleep
-  long sleep_sec = _sleep_time;
-  if (_sleep_unit == MINUTES) sleep_sec = sleep_sec * 60;
-  else if (_sleep_unit == HOURS) sleep_sec = sleep_sec * 3600;
-  else if (_sleep_unit == DAYS) sleep_sec = sleep_sec * 43200;
-  long sleep_ms = sleep_sec * 1000;
   #if DEBUG == 1
     Serial.print(F("SLEEP "));
-    Serial.print(sleep_sec);
+    Serial.print(_sleep_time);
     Serial.println(F("s"));
   #endif
   #if SERVICE_MESSAGES == 1
@@ -3702,41 +3697,33 @@ void NodeManager::_sleep() {
   #endif
   // go to sleep
   int interrupt = -1;
-  if (_sleep_mode == WAIT) {
-    // wait for the given interval
-    wait(sleep_ms);
-    // send heartbeat to the controller
-    sendHeartbeat(_ack);
-  }
-  else if (_sleep_mode == SLEEP) {
-    // setup interrupt pins
-    int interrupt_1_pin = _interrupt_1_mode == MODE_NOT_DEFINED ? INTERRUPT_NOT_DEFINED  : digitalPinToInterrupt(INTERRUPT_PIN_1);
-    int interrupt_2_pin = _interrupt_2_mode == MODE_NOT_DEFINED ? INTERRUPT_NOT_DEFINED  : digitalPinToInterrupt(INTERRUPT_PIN_2);
-    // enter smart sleep for the requested sleep interval and with the configured interrupts
-    interrupt = sleep(interrupt_1_pin,_interrupt_1_mode,interrupt_2_pin,_interrupt_2_mode,sleep_ms, true);
-    if (interrupt > -1) {
-      // woke up by an interrupt
-      int pin_number = -1;
-      int interrupt_mode = -1;
-      // map the interrupt to the pin
-      if (digitalPinToInterrupt(INTERRUPT_PIN_1) == interrupt) {
-        pin_number = INTERRUPT_PIN_1;
-        interrupt_mode = _interrupt_1_mode;
-      }
-      if (digitalPinToInterrupt(INTERRUPT_PIN_2) == interrupt) {
-        pin_number = INTERRUPT_PIN_2;
-        interrupt_mode = _interrupt_2_mode;
-      }
-      _last_interrupt_pin = pin_number;
-      #if DEBUG == 1
-        Serial.print(F("WAKE P="));
-        Serial.print(pin_number);
-        Serial.print(F(", M="));
-        Serial.println(interrupt_mode);
-      #endif
-      // when waking up from an interrupt on the wakup pin, stop sleeping
-      if (_sleep_interrupt_pin == pin_number) _sleep_mode = IDLE;
+  // setup interrupt pins
+  int interrupt_1_pin = _interrupt_1_mode == MODE_NOT_DEFINED ? INTERRUPT_NOT_DEFINED  : digitalPinToInterrupt(INTERRUPT_PIN_1);
+  int interrupt_2_pin = _interrupt_2_mode == MODE_NOT_DEFINED ? INTERRUPT_NOT_DEFINED  : digitalPinToInterrupt(INTERRUPT_PIN_2);
+  // enter smart sleep for the requested sleep interval and with the configured interrupts
+  interrupt = sleep(interrupt_1_pin,_interrupt_1_mode,interrupt_2_pin,_interrupt_2_mode,_sleep_time*1000, true);
+  if (interrupt > -1) {
+    // woke up by an interrupt
+    int pin_number = -1;
+    int interrupt_mode = -1;
+    // map the interrupt to the pin
+    if (digitalPinToInterrupt(INTERRUPT_PIN_1) == interrupt) {
+      pin_number = INTERRUPT_PIN_1;
+      interrupt_mode = _interrupt_1_mode;
     }
+    if (digitalPinToInterrupt(INTERRUPT_PIN_2) == interrupt) {
+      pin_number = INTERRUPT_PIN_2;
+      interrupt_mode = _interrupt_2_mode;
+    }
+    _last_interrupt_pin = pin_number;
+    #if DEBUG == 1
+      Serial.print(F("INT P="));
+      Serial.print(pin_number);
+      Serial.print(F(", M="));
+      Serial.println(interrupt_mode);
+    #endif
+    // when waking up from an interrupt on the wakup pin, stop sleeping
+    if (_sleep_interrupt_pin == pin_number) _status = AWAKE;
   }
   // coming out of sleep
   #if DEBUG == 1
@@ -3781,43 +3768,35 @@ int NodeManager::_getInterruptInitialValue(int mode) {
 // load the configuration stored in the eeprom
 void NodeManager::_loadConfig() {
   if (loadState(EEPROM_SLEEP_SAVED) == 1) {
-    // sleep settings found in the eeprom, restore them
-    _sleep_mode = loadState(EEPROM_SLEEP_MODE);
-    _sleep_time = loadState(EEPROM_SLEEP_TIME_MINOR);
-    int major = loadState(EEPROM_SLEEP_TIME_MAJOR);
-    if (major == 1) _sleep_time =  _sleep_time + 250;
-    else if (major == 2) _sleep_time =  _sleep_time + 250 * 2;
-    else if (major == 3) _sleep_time =  _sleep_time + 250 * 3;
-    _sleep_unit = loadState(EEPROM_SLEEP_UNIT);
+    // load sleep settings
+    int bit_1 = loadState(EEPROM_SLEEP_1);
+    int bit_2 = loadState(EEPROM_SLEEP_2);
+    int bit_3 = loadState(EEPROM_SLEEP_3);
+    _sleep_time = bit_3*255*255 + bit_2*255 + bit_1;
     #if DEBUG == 1
-      Serial.print(F("LOADSLP M="));
-      Serial.print(_sleep_mode);
-      Serial.print(F(" T="));
-      Serial.print(_sleep_time);
-      Serial.print(F(" U="));
-      Serial.println(_sleep_unit);
+      Serial.print(F("LOADSLP T="));
+      Serial.println(_sleep_time);
     #endif
   }
 }
 
 // save the configuration in the eeprom
-void NodeManager::_saveConfig(int what) {
-  if (what == SAVE_SLEEP_MODE) {
-    saveState(EEPROM_SLEEP_SAVED, 1);
-    saveState(EEPROM_SLEEP_MODE, _sleep_mode);
-  }
-  else if (what == SAVE_SLEEP_TIME) {
-    // encode sleep time
-    int major = 0;
-    if (_sleep_time > 750) major = 3;
-    else if (_sleep_time > 500) major = 2;
-    else if (_sleep_time > 250) major = 1;
-    int minor = _sleep_time - 250 * major;
-    saveState(EEPROM_SLEEP_SAVED, 1);
-    saveState(EEPROM_SLEEP_TIME_MINOR, minor);
-    saveState(EEPROM_SLEEP_TIME_MAJOR, major);
-  }
-  else if (what == SAVE_SLEEP_UNIT) {
-    saveState(EEPROM_SLEEP_UNIT, _sleep_unit);
-  }
+void NodeManager::_saveConfig() {
+  if (_sleep_time == 0) return;
+  // encode the sleep time in 3 bits
+  int bit_1, bit_2, bit_3 = 0;
+  bit_1 = _sleep_time;
+  if (bit_1 >= 255) {
+    bit_2 = (int)bit_1/255;
+    bit_1 = bit_1 - bit_2*255;
+  }
+  if (bit_2 >= 255) {
+    bit_3 = (int)bit_2/255;
+    bit_2 = bit_2 - bit_3*255;
+  }
+  // save the 3 bits
+  saveState(EEPROM_SLEEP_SAVED,1);
+  saveState(EEPROM_SLEEP_1,bit_1);
+  saveState(EEPROM_SLEEP_2,bit_2);
+  saveState(EEPROM_SLEEP_3,bit_3);
 }
diff --git a/NodeManager.h b/NodeManager.h
index 77dac5e61839a67118dee48fbaf74c00a31e676a..8728831f7fa0df34d737b330c3f00eee5aa7d88a 100755
--- a/NodeManager.h
+++ b/NodeManager.h
@@ -13,18 +13,15 @@
    Constants
 */
 
-// define sleep mode
-#define IDLE 0
+// define board status
+#define AWAKE 0
 #define SLEEP 1
-#define WAIT 2
-#define ALWAYS_ON 3
 
 // define time unit
 #define SECONDS 0
 #define MINUTES 1
 #define HOURS 2
 #define DAYS 3
-#define CYCLES 4
 
 // define on/off
 #define OFF 0
@@ -39,17 +36,11 @@
 #define INTERRUPT_PIN_1 3
 #define INTERRUPT_PIN_2 2
 
-// define configuration settings that can be saved and loaded from the EEPROM
-#define SAVE_SLEEP_MODE 0
-#define SAVE_SLEEP_TIME 1
-#define SAVE_SLEEP_UNIT 2
-
 // define eeprom addresses
 #define EEPROM_SLEEP_SAVED 0
-#define EEPROM_SLEEP_MODE 1
-#define EEPROM_SLEEP_TIME_MAJOR 2
-#define EEPROM_SLEEP_TIME_MINOR 3
-#define EEPROM_SLEEP_UNIT 4
+#define EEPROM_SLEEP_1 5
+#define EEPROM_SLEEP_2 6
+#define EEPROM_SLEEP_3 7
 #define EEPROM_USER_START 100
 
 // define requests
@@ -410,39 +401,38 @@ class PowerManager {
 class Timer {
   public:
     Timer(NodeManager* node_manager);
-    // start the timer which will be over when interval passes by. Unit can be either CYCLES or MINUTES
-    void start(long target, int unit);
+    // start the timer which will be over when the configured target passes by
+    void start(int target, int unit);
     void start();
     // stop the timer
     void stop();
+    // reset the timer
+    void reset();
+    // reset the timer and start over
+    void restart();
     // set the timer configuration but do not start it
-    void set(long target, int unit);
+    void set(int target, int unit);
+    void unset();
     // update the timer. To be called at every cycle
     void update();
-    // returns true if the time is over
+    // return true if the time is over
     bool isOver();
     // return true if the timer is running
     bool isRunning();
-    // returns true if the timer has been configured
+    // return true if the timer has been configured
     bool isConfigured();
-    // reset the timer and start over
-    void restart();
+    // return true if this is the first time the timer runs
+    bool isFirstRun();
     // return the current elapsed time
     float getElapsed();
-    // return the configured unit
-    int getUnit();
-    // return the configured target
-    int getTarget();
    private:
     NodeManager* _node_manager;
-    long _target = 0;
-    int _unit = 0;
-    float _elapsed = 0;
-    bool _use_millis = false;
+    int _target = 0;
+    long _elapsed = 0;
     long _last_millis = 0;
-    float _sleep_time = 0;
     bool _is_running = false;
     bool _is_configured = false;
+    bool _first_run = true;
 };
 
 /*
@@ -492,11 +482,10 @@ class Sensor {
     void setSamplesInterval(int value);
     // [7] if true will report the measure only if different than the previous one (default: false)
     void setTrackLastValue(bool value);
-    // [8] if track last value is enabled, force to send an update after the configured number of cycles (default: -1)
-    void setForceUpdate(int value);
-    void setForceUpdateCycles(int value);
-    // [9] if track last value is enabled, force to send an update after the configured number of minutes (default: -1)
+    // [9] if track last value is enabled, force to send an update after the configured number of minutes
     void setForceUpdateMinutes(int value);
+    // [19] if track last value is enabled, force to send an update after the configured number of hours
+    void setForceUpdateHours(int value);
     // [10] the value type of this sensor (default: TYPE_INTEGER)
     void setValueType(int value);
     int getValueType();
@@ -516,10 +505,12 @@ class Sensor {
     int getValueInt();
     float getValueFloat();
     char* getValueString();
-    // [15] After how many cycles the sensor will report back its measure (default: 1 cycle)
-    void setReportIntervalCycles(int value);
-    // [16] After how many minutes the sensor will report back its measure (default: 1 cycle)
+    // [16] After how many minutes the sensor will report back its measure (default: 10 minutes)
     void setReportIntervalMinutes(int value);
+    // [17] After how many minutes the sensor will report back its measure (default: 10 minutes)
+    void setReportIntervalSeconds(int value);
+    // return true if the report interval has been already configured
+    bool isReportIntervalConfigured();
     // process a remote request
     void process(Request & request);
     // return the pin the interrupt is attached to
@@ -1338,8 +1329,6 @@ class NodeManager {
       void setBatteryMin(float value);
       // [12] the expected vcc when the batter is fully charged, used to calculate the percentage (default: 3.3)
       void setBatteryMax(float value);
-      // [13] after how many sleeping cycles report the battery level to the controller. When reset the battery is always reported (default: -)
-      void setBatteryReportCycles(int value);
       // [14] after how many minutes report the battery level to the controller. When reset the battery is always reported (default: 60)
       void setBatteryReportMinutes(int value);
       // [15] if true, the battery level will be evaluated by measuring the internal vcc without the need to connect any pin, if false the voltage divider methon will be used (default: true)
@@ -1353,18 +1342,15 @@ class NodeManager {
       // [2] Send a battery level report to the controller
       void batteryReport();
     #endif
-    // [3] define the way the node should behave. It can be (0) IDLE (stay awake withtout executing each sensors' loop), (1) SLEEP (go to sleep for the configured interval), (2) WAIT (wait for the configured interval), (3) ALWAYS_ON (stay awake and execute each sensors' loop)
-    void setSleepMode(int value);
-    void setMode(int value);
-    int getMode();
-    // [4] define for how long the board will sleep (default: 0)
-    void setSleepTime(int value);
-    int getSleepTime();
-    // [5] define the unit of SLEEP_TIME. It can be SECONDS, MINUTES, HOURS or DAYS (default: MINUTES)
-    void setSleepUnit(int value);
-    int getSleepUnit();
-    // configure the node's behavior, parameters are mode, time and unit
-    void setSleep(int value1, int value2, int value3);
+    // [3] set the duration (in seconds) of a sleep cycle
+    void setSleepSeconds(int value);
+    long getSleepSeconds();
+    // [4] set the duration (in minutes) of a sleep cycle
+    void setSleepMinutes(int value);
+    // [5] set the duration (in hours) of a sleep cycle
+    void setSleepHours(int value);
+    // [29] set the duration (in days) of a sleep cycle
+    void setSleepDays(int value);
     // [19] if enabled, when waking up from the interrupt, the board stops sleeping. Disable it when attaching e.g. a motion sensor (default: true)
     void setSleepInterruptPin(int value);
     // configure the interrupt pin and mode. Mode can be CHANGE, RISING, FALLING (default: MODE_NOT_DEFINED)
@@ -1431,6 +1417,11 @@ class NodeManager {
     void setupInterrupts();
     // return the pin from which the last interrupt came
     int getLastInterruptPin();
+    // set the default interval in minutes all the sensors will report their measures. 
+    // If the same function is called on a specific sensor, this will not change the previously set value 
+    // For sleeping sensors, the elapsed time can be evaluated only upon wake up (default: 10 minutes)
+    void setReportIntervalMinutes(int value);
+    void setReportIntervalSeconds(int value);
     // hook into the main sketch functions
     void before();
     void presentation();
@@ -1458,9 +1449,8 @@ class NodeManager {
     #endif
     MyMessage _msg;
     void _send(MyMessage & msg);
-    int _sleep_mode = IDLE;
-    int _sleep_time = 0;
-    int _sleep_unit = MINUTES;
+    int _status = AWAKE;
+    long _sleep_time = 0;
     int _sleep_interrupt_pin = -1;
     int _sleep_between_send = 0;
     int _retries = 1;
@@ -1481,8 +1471,9 @@ class NodeManager {
     int _getInterruptInitialValue(int mode);
     bool _get_controller_config = true;
     int _is_metric = 1;
+    int _report_interval_seconds = 10*60;
     void _loadConfig();
-    void _saveConfig(int what);
+    void _saveConfig();
 };
 
 #endif
diff --git a/NodeManager.ino b/NodeManager.ino
index ad7a457a5aa34f33a5b6421c1acaaf841fc2a647..3df7d4749d1c34e584a3d9ea91d0d291d4504046 100755
--- a/NodeManager.ino
+++ b/NodeManager.ino
@@ -35,6 +35,7 @@ void before() {
 
 
 
+
   /*
    * Register above your sensors
   */
diff --git a/README.md b/README.md
index 24e820d280348103a002f9b5ab1062436eb3f096..daf0971caa480e7a654183f13fa96efa12ed8a20 100755
--- a/README.md
+++ b/README.md
@@ -11,19 +11,19 @@ NodeManager includes the following main components:
 ## Features
 
 * Manage all the aspects of a sleeping cycle by leveraging smart sleep
-* Allow configuring the sleep mode and the sleep duration remotely
+* Allow configuring the node and any attached sensors remotely
 * Allow waking up a sleeping node remotely at the end of a sleeping cycle
 * Allow powering on each connected sensor only while the node is awake to save battery
-* Report battery level periodically and automatically
+* Report battery level periodically and automatically or on demand
 * Calculate battery level without requiring an additional pin and the resistors
-* Report battery voltage through a built-in sensor
-* Can report battery level on demand
 * Allow rebooting the board remotely
 * Provide out-of-the-box sensors personalities and automatically execute their main task at each cycle
+* Allow collecting and averaging multiple samples, tracking the last value and forcing periodic updates for any sensor
+* Provide buil-in capabilities to handle interrupt-based sensors 
 
 ## Installation
-* Download the package or clone the git repository at https://github.com/mysensors/NodeManager
-* Open the provided sketch template and save it under a different name
+* Download the package or clone the git repository from https://github.com/mysensors/NodeManager
+* Open the provided sketch and save it under a different name
 * Open `config.h` and customize both MySensors configuration and NodeManager global settings
 * Register your sensors in the sketch file
 * Upload the sketch to your arduino board
@@ -36,7 +36,7 @@ Please note NodeManager cannot be used as an arduino library since requires acce
 * Review the release notes in case there is any manual change required to the existing sketch or config.h file
 
 ## Configuration
-NodeManager configuration includes compile-time configuration directives (which can be set in config.h), runtime global and per-sensor configuration settings (which can be set in your sketch) and settings that can be customized remotely (via a special child id).
+NodeManager configuration includes compile-time configuration directives (which can be set in config.h), runtime global and per-sensor configuration settings (which can be set in your sketch).
 
 ### Setup MySensors
 Since NodeManager has to communicate with the MySensors gateway on your behalf, it has to know how to do it. Place on top of the `config.h` file all the MySensors typical directives you are used to set on top of your sketch so both your sketch AND NodeManager will be able to share the same configuration. For example:
@@ -123,38 +123,41 @@ Since NodeManager has to communicate with the MySensors gateway on your behalf,
 
 ### Enable/Disable NodeManager's modules
 
-Those NodeManager's directives in the `config.h` file control which module/library/functionality will be made available to your sketch. Enable (e.g. set to 1) only what you need to ensure enough space is left to your custom code.
+The next step is to enable NodeManager's additional functionalities and the modules required for your sensors. The directives in the `config.h` file control which module/library/functionality will be made available to your sketch. Enable (e.g. set to 1) only what you need to ensure enough storage is left to your custom code.
 
 ~~~c
+/***********************************
+ * NodeManager configuration
+ */
+
 // if enabled, enable debug messages on serial port
 #define DEBUG 1
 
 // if enabled, enable the capability to power on sensors with the arduino's pins to save battery while sleeping
-#define POWER_MANAGER 1
+#define POWER_MANAGER 0
 // if enabled, will load the battery manager library to allow the battery level to be reported automatically or on demand
-#define BATTERY_MANAGER 1
+#define BATTERY_MANAGER 0
 // if enabled, allow modifying the configuration remotely by interacting with the configuration child id
-#define REMOTE_CONFIGURATION 1
-// if enabled, persist the configuration settings on EEPROM
+#define REMOTE_CONFIGURATION 0
+// if enabled, persist the remote configuration settings on EEPROM
 #define PERSIST 0
-
+// if enabled, a battery sensor will be created at BATTERY_CHILD_ID and will report vcc voltage together with the battery level percentage
+#define BATTERY_SENSOR 0
 // if enabled, send a SLEEPING and AWAKE service messages just before entering and just after leaving a sleep cycle and STARTED when starting/rebooting
 #define SERVICE_MESSAGES 0
-// if enabled, a battery sensor will be created at BATTERY_CHILD_ID and will report vcc voltage together with the battery level percentage
-#define BATTERY_SENSOR 1
 
 // Enable this module to use one of the following sensors: SENSOR_ANALOG_INPUT, SENSOR_LDR, SENSOR_THERMISTOR, SENSOR_ML8511, SENSOR_ACS712, SENSOR_RAIN_GAUGE, SENSOR_RAIN, SENSOR_SOIL_MOISTURE
 #define MODULE_ANALOG_INPUT 1
 // Enable this module to use one of the following sensors: SENSOR_DIGITAL_INPUT
-#define MODULE_DIGITAL_INPUT 1
+#define MODULE_DIGITAL_INPUT 0
 // Enable this module to use one of the following sensors: SENSOR_DIGITAL_OUTPUT, SENSOR_RELAY, SENSOR_LATCHING_RELAY
-#define MODULE_DIGITAL_OUTPUT 1
-// Enable this module to use one of the following sensors: SENSOR_SHT21
-#define MODULE_SHT21 0
+#define MODULE_DIGITAL_OUTPUT 0
 // Enable this module to use one of the following sensors: SENSOR_DHT11, SENSOR_DHT22, SENSOR_DHT21
 #define MODULE_DHT 0
+// Enable this module to use one of the following sensors: SENSOR_SHT21
+#define MODULE_SHT21 0
 // Enable this module to use one of the following sensors: SENSOR_SWITCH, SENSOR_DOOR, SENSOR_MOTION
-#define MODULE_SWITCH 0
+#define MODULE_SWITCH 1
 // Enable this module to use one of the following sensors: SENSOR_DS18B20
 #define MODULE_DS18B20 0
 // Enable this module to use one of the following sensors: SENSOR_BH1750
@@ -175,9 +178,9 @@ Those NodeManager's directives in the `config.h` file control which module/libra
 #define MODULE_MQ 0
 // Enable this module to use one of the following sensors: SENSOR_MHZ19
 #define MODULE_MHZ19 0
-// Enable this module to use one of the following sensors: SENSOR_AM2320
+// Enable this module to use one of the following sensors: SENSOR_AM2320    
 #define MODULE_AM2320 0
-// Enable this module to use one of the following sensors: SENSOR_TSL2561
+// Enable this module to use one of the following sensors: SENSOR_TSL2561    
 #define MODULE_TSL2561 0
 // Enable this module to use one of the following sensors: SENSOR_PT100
 #define MODULE_PT100 0
@@ -188,7 +191,7 @@ Those NodeManager's directives in the `config.h` file control which module/libra
 
 ### Installing the dependencies
 
-Some of the modules above rely on third party libraries. Those libraries are not included within NodeManager and have to be installed from the Arduino IDE Library Manager (Sketch -> Include Library -> Manager Libraries). You need to install the library ONLY if the module is enabled:
+Some of the modules above rely on third party libraries. Those libraries are not included within NodeManager and have to be installed from the Arduino IDE Library Manager (Sketch -> Include Library -> Manager Libraries) or manually. You need to install the library ONLY if the module is enabled:
 
 Module  | Required Library
  ------------- | -------------
@@ -208,7 +211,7 @@ MODULE_BMP280 | https://github.com/adafruit/Adafruit_BMP280_Library
 
 ### Configure NodeManager
 
-Node Manager comes with a reasonable default configuration. If you want/need to change its settings, this can be done in your sketch, inside the `before()` function and just before registering your sensors. The following methods are exposed for your convenience:
+The next step is to configure NodeManager with settings which will instruct how the node should behave. To do so, go to the main sketch, inside the `before()` function and add call one or more of the functions below just before registering your sensors. The following methods are exposed for your convenience and can be called on the `nodeManager` object already created for you:
 
 ~~~c
     // [10] send the same service message multiple times (default: 1)
@@ -219,8 +222,6 @@ Node Manager comes with a reasonable default configuration. If you want/need to
       void setBatteryMin(float value);
       // [12] the expected vcc when the batter is fully charged, used to calculate the percentage (default: 3.3)
       void setBatteryMax(float value);
-      // [13] after how many sleeping cycles report the battery level to the controller. When reset the battery is always reported (default: -)
-      void setBatteryReportCycles(int value);
       // [14] after how many minutes report the battery level to the controller. When reset the battery is always reported (default: 60)
       void setBatteryReportMinutes(int value);
       // [15] if true, the battery level will be evaluated by measuring the internal vcc without the need to connect any pin, if false the voltage divider methon will be used (default: true)
@@ -234,22 +235,21 @@ Node Manager comes with a reasonable default configuration. If you want/need to
       // [2] Send a battery level report to the controller
       void batteryReport();
     #endif
-    // [3] define the way the node should behave. It can be (0) IDLE (stay awake withtout executing each sensors' loop), (1) SLEEP (go to sleep for the configured interval), (2) WAIT (wait for the configured interval), (3) ALWAYS_ON (stay awake and execute each sensors' loop)
-    void setSleepMode(int value);
-    void setMode(int value);
-    int getMode();
-    // [4] define for how long the board will sleep (default: 0)
-    void setSleepTime(int value);
-    int getSleepTime();
-    // [5] define the unit of SLEEP_TIME. It can be SECONDS, MINUTES, HOURS or DAYS (default: MINUTES)
-    void setSleepUnit(int value);
-    int getSleepUnit();
-    // configure the node's behavior, parameters are mode, time and unit
-    void setSleep(int value1, int value2, int value3);
+    // [3] set the duration (in seconds) of a sleep cycle
+    void setSleepSeconds(int value);
+    long getSleepSeconds();
+    // [4] set the duration (in minutes) of a sleep cycle
+    void setSleepMinutes(int value);
+    // [5] set the duration (in hours) of a sleep cycle
+    void setSleepHours(int value);
+    // [29] set the duration (in days) of a sleep cycle
+    void setSleepDays(int value);
     // [19] if enabled, when waking up from the interrupt, the board stops sleeping. Disable it when attaching e.g. a motion sensor (default: true)
     void setSleepInterruptPin(int value);
     // configure the interrupt pin and mode. Mode can be CHANGE, RISING, FALLING (default: MODE_NOT_DEFINED)
-    void setInterrupt(int pin, int mode, int pull = -1);
+    void setInterrupt(int pin, int mode, int initial = -1);
+    // [28] ignore two consecutive interrupts if happening within this timeframe in milliseconds (default: 100)
+    void setInterruptMinDelta(long value);
     // [20] optionally sleep interval in milliseconds before sending each message to the radio network (default: 0)
     void setSleepBetweenSend(int value);
     int getSleepBetweenSend();
@@ -272,7 +272,7 @@ Node Manager comes with a reasonable default configuration. If you want/need to
       // [24] manually turn the power on
       void powerOn();
       // [25] manually turn the power off
-      void powerOff(); 
+      void powerOff();
     #endif
     // [21] set this to true if you want destination node to send ack back to this node (default: false)
     void setAck(bool value);
@@ -310,16 +310,41 @@ Node Manager comes with a reasonable default configuration. If you want/need to
     void setupInterrupts();
     // return the pin from which the last interrupt came
     int getLastInterruptPin();
+    // set the default interval in minutes all the sensors will report their measures. 
+    // If the same function is called on a specific sensor, this will not change the previously set value 
+    // For sleeping sensors, the elapsed time can be evaluated only upon wake up (default: 10 minutes)
+    void setReportIntervalMinutes(int value);
+    void setReportIntervalSeconds(int value);
 ~~~
 
-For example
+### Set reporting intervals and sleeping cycles
+
+If not instructed differently, the node will stay in awake, all the sensors will report every 10 minutes and the battery level will be automatically reported every 60 minutes. To change those settings, you can call the following functions on the nodeManager object:
 
+Function  | Description
+------------ | -------------
+setSleepSeconds()/setSleepMinutes()/setSleepHours()/setSleepDays() | the time interval the node will spend in a (smart) sleep cycle
+setReportIntervalMinutes() / setReportIntervalSeconds() | the time interval the node will report the measures of all the attached sensors
+setBatteryReportMinutes() | the time interval the node will report the battery level
+
+For example, to put the node to sleep in cycles of 10 minutes:
+
+~~~c
+	nodeManager.setSleepMinutes(10);
+~~~
+
+If you need every sensor to report at a different time interval, you can call `setReportIntervalMinutes()` or `setReportIntervalSeconds()` on the sensor's object. For example to have a DHT sensor reporting every 60 seconds while all the other sensors every 20 minutes:
 ~~~c
-	nodeManager.setBatteryMin(1.8);
+int id = nodeManager.registerSensor(SENSOR_DHT22,6);
+SensorDHT* dht = (SensorDHT*)nodeManager.get(id);
+dht->setReportIntervalSeconds(60);
+nodeManager.setReportIntervalMinutes(20);
 ~~~
 
+Please note, if you configure a sleep cycle, this may have an impact on the reporting interval since the sensor will be able to report its measures ONLY when awake. For example if you set a report interval of 5 minutes and a sleep cycle of 10 minutes, the sensors will report every 10 minutes.
+
 ### Register your sensors
-In your sketch, inside the `before()` function and just before calling `nodeManager.before()`, you can register your sensors against NodeManager. The following built-in sensor types are available:
+Once configured the node, it is time to tell NodeManager which sensors are attached to the board and where. In your sketch, inside the `before()` function and just before calling `nodeManager.before()`, you can register your sensors against NodeManager. The following built-in sensor types are available. Remember the corresponding module should be enabled in `config.h` for a successful compilation: 
 
 Sensor type  | Description
  ------------- | -------------
@@ -357,15 +382,15 @@ SENSOR_AM2320 | AM2320 sensors, return temperature/humidity based on the attache
 SENSOR_PT100 | High temperature sensor associated with DFRobot Driver, return the temperature in C° from the attached PT100 sensor
 SENSOR_BMP280 | BMP280 sensor, return temperature/pressure based on the attached BMP280 sensor
 
-To register a sensor simply call the NodeManager instance with the sensory type and the pin the sensor is conncted to. For example:
+To register a sensor simply call the NodeManager instance with the sensory type and the pin the sensor is conncted to and optionally a child id. For example:
 ~~~c
 	nodeManager.registerSensor(SENSOR_THERMISTOR,A2);
-	nodeManager.registerSensor(SENSOR_DOOR,3);
+	nodeManager.registerSensor(SENSOR_DOOR,3,1);
 ~~~
 
-Once registered, your job is done. NodeManager will assign a child id automatically, present each sensor for you to the controller, query each sensor and report the value back to the gateway/controller at at the end of each sleep cycle. An optional child id can be provided as a third argument if you want to assign it manually. For actuators (e.g. relays) those can be triggered by sending a `REQ` message to their assigned child id.
+Once registered, your job is done. NodeManager will assign a child id automatically if not instructed differently, present each sensor for you to the controller, query each sensor and report the measure back to the gateway/controller. For actuators (e.g. relays) those can be triggered by sending a `REQ` message with the expected type to their assigned child id.
 
-When called, registerSensor returns the child_id of the sensor so you will be able to retrieve it later if needed. If you want to set a child_id manually, this can be passed as third argument to the function.
+When called, registerSensor returns the child_id of the sensor so you will be able to retrieve it later if needed. Please note for sensors creating multiple child IDs (like a DHT sensor which creates a temperature and humidity sensor with different IDs), the last id is returned.
 
 #### Creating a custom sensor
 
@@ -396,13 +421,14 @@ Each built-in sensor class comes with reasonable default settings. In case you w
 To do so, use `nodeManager.getSensor(child_id)` which will return a pointer to the sensor. Remeber to cast it to the right class before calling their functions. For example:
 
 ~~~c
-	((SensorLatchingRelay*)nodeManager.getSensor(2))->setPulseWidth(50);
+	SensorLatchingRelay* relay = (SensorLatchingRelay*) nodeManager.getSensor(2);
+	relay->setPulseWidth(50);
 ~~~
 
 
 #### Sensor's general configuration
 
-The following methods are available for all the sensors:
+The following methods are available for all the sensors and can be called on the object reference as per the example above:
 ~~~c
     // [1] where the sensor is attached to (default: not set)
     void setPin(int value);
@@ -424,11 +450,10 @@ The following methods are available for all the sensors:
     void setSamplesInterval(int value);
     // [7] if true will report the measure only if different than the previous one (default: false)
     void setTrackLastValue(bool value);
-    // [8] if track last value is enabled, force to send an update after the configured number of cycles (default: -1)
-    void setForceUpdate(int value);
-    void setForceUpdateCycles(int value);
-    // [9] if track last value is enabled, force to send an update after the configured number of minutes (default: -1)
+    // [9] if track last value is enabled, force to send an update after the configured number of minutes
     void setForceUpdateMinutes(int value);
+    // [19] if track last value is enabled, force to send an update after the configured number of hours
+    void setForceUpdateHours(int value);
     // [10] the value type of this sensor (default: TYPE_INTEGER)
     void setValueType(int value);
     int getValueType();
@@ -448,10 +473,12 @@ The following methods are available for all the sensors:
     int getValueInt();
     float getValueFloat();
     char* getValueString();
-    // [15] After how many cycles the sensor will report back its measure (default: 1 cycle)
-    void setReportIntervalCycles(int value);
-    // [16] After how many minutes the sensor will report back its measure (default: 1 cycle)
+    // [16] After how many minutes the sensor will report back its measure (default: 10 minutes)
     void setReportIntervalMinutes(int value);
+    // [17] After how many minutes the sensor will report back its measure (default: 10 minutes)
+    void setReportIntervalSeconds(int value);
+    // return true if the report interval has been already configured
+    bool isReportIntervalConfigured();
     // process a remote request
     void process(Request & request);
     // return the pin the interrupt is attached to
@@ -639,51 +666,43 @@ When `DEBUG` is enabled, detailed information is available through the serial po
 
 ### Communicate with NodeManager and its sensors
 
-You can interact with each registered sensor by asking to execute their main tasks by sending to the child id a `REQ` command (or a `SET` for output sensors like relays). For example to request the temperature to node_id 254 and child_id 1:
+You can interact with each registered sensor by sending to the child id a `REQ` command (or a `SET` for output sensors like relays). For example to request the temperature to node_id 254 and child_id 1:
 
 `254;1;2;0;0;`
 
-To activate a relay connected to the same node, child_id 100:
+To activate a relay connected to the same node, child_id 100 we need to send a `SET` command with payload set to 1:
 
 `254;100;1;0;2;1`
 
-No need to implement anything on your side since for built-in sensor types this is handled automatically. 
-Once the node will be sleeping, it will report automatically each measure at the end of every sleep cycle, unless configured otherwise.
+No need to implement anything on your side since for built-in sensors this is handled automatically. 
 
-NodeManager exposes also a configuration service by default on child_id 200 so you can interact with it by sending `V_CUSTOM` type of messages and commands within the payload. For each `REQ` message, the node will respond with a `SET` message if successful. 
-Almost all the functions made available through the API can be called remotely. To do so, the payload must be in the format `<function_id>[,<value_to_set>]` where function_id is the number between square brackets you can find in the description just above each function and, if the function takes and argument, this can be passed along in value_to_set. 
+NodeManager exposes also a configuration service which is by default on child_id 200 so you can interact with it by sending `V_CUSTOM` type of messages and commands within the payload. For each `REQ` message, the node will respond with a `SET` message if successful. 
+Almost all the functions made available through the API can be called remotely. To do so, the payload must be in the format `<function_id>[,<value_to_set>]` where `function_id` is the number between square brackets you can find in the description above and, if the function takes and argument, this can be passed along in `value_to_set`. 
 For example, to request a battery report, find the function you need to call remotely within the documentation:
 ~~~c
     // [2] Send a battery level report to the controller
     void batteryReport();
 ~~~
-In this case the function_id will be 2. To request a battery report to the node_id 100, send the following message:
+In this case `function_id` will be 2. To request a battery report to the node_id 100, send the following message:
 `<node_id>;<configuration_child_id>;<req>;0;<V_CUSTOM>;<function_id>`
 `100;200;2;0;48;2`
 
-The change the sleep time from e.g. 10 minutes as set in the sketch to 5 minutes:
+The change the sleep time to e.g. 10 minutes:
 ~~~c
-    // [4] define for how long the board will sleep (default: 0)
-    void setSleepTime(int value);
+    // [4] set the duration (in minutes) of a sleep cycle
+    void setSleepMinutes(int value);
 ~~~
 `<node_id>;<configuration_child_id>;<req>;0;<V_CUSTOM>;<function_id>,<value>`
-`100;200;2;0;48;4,5`
+`100;200;2;0;48;4,10`
 
-To ask the node to start sleeping (and waking up based on the previously configured interval):
-~~~c
-    // [3] define the way the node should behave. It can be (0) IDLE (stay awake withtout executing each sensors' loop), (1) SLEEP (go to sleep for the configured interval), (2) WAIT (wait for the configured interval), (3) ALWAYS_ON (stay awake and execute each sensors' loop)
-    void setSleepMode(int value);
-~~~
-`100;200;2;0;48;3,1`
-
-To wake up a node previously configured as sleeping, send the following just it wakes up next:
+To wake up a node previously configured as sleeping, send the following as the node wakes up next:
 ~~~c
     // [9] wake up the board
     void wakeup();
 ~~~
 `100;200;2;0;48;9`
 
-The same protocol can be used to execute remotely also sensor-specific functions. In this case the message has to be sent to the sensor's child_id, with a V_CUSTOM type of message. For example if you want to collect and average 10 samples for child_id 1:
+The same protocol can be used to execute remotely also sensor-specific functions. In this case the message has to be sent to the sensor's child_id, with a `V_CUSTOM` type of message. For example if you want to collect and average 10 samples for child_id 1:
 ~~~c
     // [5] For some sensors, the measurement can be queried multiple times and an average is returned (default: 1)
     void setSamples(int value);
@@ -697,14 +716,14 @@ If you want to decrease the temperature offset of a thermistor sensor to -2:
 ~~~
 `100;1;2;0;48;105,-2`
 
-Please note that anything set remotely will NOT persist a reboot apart from those provided to setSleepMode(), setSleepTime() and setSleepUnit() which are saved to the EEPROM (provided `PERSIST` is enabled).
+Please note that anything set remotely will NOT persist a reboot apart from those setting the sleep interval which are saved to the EEPROM (provided `PERSIST` is enabled).
 
 ## Understanding NodeManager: how it works
 
-A NodeManager object must be created and called from within your sketch during `before()`, `presentation()`, `loop()` and `receive()` to work properly. NodeManager will do the following during each phase:
+A NodeManager object is created for you at the beginning of your sketch and its main functions must called from within `before()`, `presentation()`, `loop()` and `receive()` to work properly. NodeManager will do the following during each phase:
 
 NodeManager::before():
-* Setup the interrupt pins to wake up the board based on the configured interrupts (e.g. stop sleeping when the pin is connected to ground or wake up and notify when a motion sensor has trigger)
+* Setup the interrupt pins to wake up the board based on the configured interrupts
 * If persistance is enabled, restore from the EEPROM the latest sleeping settings
 * Call `before()` of each registered sensor
 
@@ -719,16 +738,16 @@ Sensor::setup():
 * Call sensor-specific implementation of setup by invoking `onSetup()` to initialize the sensor
 
 NodeManager::loop():
-* If all the sensors are powered by an arduino pin, this is set to HIGH
+* If all the sensors are powered by an arduino pin, this is turned on
 * Call `loop()` of each registered sensor
-* If all the sensors are powered by an arduino pin, this is set to LOW
+* If all the sensors are powered by an arduino pin, this is turned off
 
 Sensor::loop():
-* If the sensor is powered by an arduino pin, this is set to HIGH
-* For each registered sensor, the sensor-specific `onLoop()` is called. If multiple samples are requested, this is run multiple times.
+* If the sensor is powered by an arduino pin, this is set to on
+* For each registered sensor, the sensor-specific `onLoop()` is called. If multiple samples are requested, this is run multiple times. `onLoop()` is not intended to send out any message but just sets a new value to a local variable
 * In case multiple samples have been collected, the average is calculated
 * A message is sent to the gateway with the calculated value. Depending on the configuration, this is not sent if it is the same as the previous value or sent anyway after a given number of cycles. These functionalies are not sensor-specific and common to all the sensors inheriting from the `Sensor` class.
-* If the sensor is powered by an arduino pin, this is set to LOW
+* If the sensor is powered by an arduino pin, this is turned off
 
 NodeManager::receive():
 * Receive a message from the radio network 
@@ -742,10 +761,10 @@ NodeManager::process():
 
 Sensor::process():
 * Process a sensor-generic incoming remote configuration request
-* Calls onProcess() for sensor-specific incoming remote configuration request
+* Calls `onProcess()` for sensor-specific incoming remote configuration request
 
 Sensor::interrupt():
-* Calls the sensor's implementation of onInterrupt() to handle the interrupt
+* Calls the sensor's implementation of `onInterrupt()` to handle the interrupt
 
 ## Examples
 All the examples below takes place within the before() function in the main sketch, just below the "Register below your sensors" comment.
@@ -760,7 +779,7 @@ Set battery minimum and maxium voltage. This will be used to calculate the level
 Instruct the board to sleep for 10 minutes at each cycle:
 
 ~~~c
-    nodeManager.setSleep(SLEEP,10,MINUTES);
+    nodeManager.setSleepMinutes(10);
 ~~~
 
 Configure a wake up pin. When pin 3 is connected to ground, the board will stop sleeping:
@@ -781,7 +800,7 @@ Register a thermistor sensor attached to pin A2. NodeManager will then send the
    nodeManager.registerSensor(SENSOR_THERMISTOR,A2);
 ~~~
 
-Register a SHT21 temperature/humidity sensor; since using i2c for communicating with the sensor, the pins used are implicit (A4 and A5). NodeManager will then send the temperature and the humidity to the controller at the end of each sleeping cycle:
+Register a SHT21 temperature/humidity sensor; since using I2C for communicating with the sensor, the pins used are implicit (A4 and A5). NodeManager will then send the temperature and the humidity to the controller at the end of each sleeping cycle:
 
 ~~~c
    nodeManager.registerSensor(SENSOR_SHT21);
@@ -820,9 +839,9 @@ Register a latching relay connecting to pin 6 (set) and pin 7 (unset):
 
 The following sketch can be used to report the temperature and the light level based on a thermistor and LDR sensors attached to two analog pins of the arduino board (A1 and A2). Both the thermistor and the LDR are connected to ground on one side and to vcc via a resistor on the other so to measure the voltage drop across each of them through the analog pins. 
 
-The sensor will be put to sleep after startup and will report both the measures every 10 minutes. NodeManager will take care of presenting the sensors, managing the sleep cycle, reporting the battery level every 10 cycles and report the measures in the appropriate format. This sketch requires MODULE_ANALOG_INPUT enabled in the global config.h file.
+The sensor will be put to sleep after startup and will report both the measures every 10 minutes. NodeManager will take care of presenting the sensors, managing the sleep cycle, reporting the battery level every hour and report the measures in the appropriate format. This sketch requires MODULE_ANALOG_INPUT enabled in the global config.h file.
 
-Even if the sensor is sleeping most of the time, it can be potentially woke up by sending a V_CUSTOM message with a WAKEUP payload to NodeManager service child id (200 by default) just after having reported its heartbeat. At this point the node will report AWAKE and the user can interact with it by e.g. sending REQ messages to its child IDs, changing the duration of a sleep cycle with a V_CUSTOM message to the NodeManager service child id, etc.
+Even if the sensor is sleeping most of the time, it can be potentially woke up by sending a V_CUSTOM message to NodeManager service child id (200 by default) just after having reported its heartbeat. At this point the node will report awake and the user can interact with it by e.g. sending REQ messages to its child IDs, changing the duration of a sleep cycle, etc.
 
 ~~~c
 /*
@@ -856,7 +875,8 @@ void before() {
   /*
    * Register below your sensors
   */
-  nodeManager.setSleep(SLEEP,10,MINUTES); 
+  nodeManager.setSleepMinutes(10);
+  nodeManager.setReportIntervalMinutes(10);
   nodeManager.registerSensor(SENSOR_THERMISTOR,A1);
   nodeManager.registerSensor(SENSOR_LDR,A2);
   /*
@@ -938,7 +958,7 @@ void before() {
   /*
    * Register below your sensors
   */
-  nodeManager.setSleep(SLEEP,60,MINUTES); 
+  nodeManager.setSleepHours(1);
   nodeManager.registerSensor(SENSOR_MOTION,3);
 
   /*
@@ -1026,7 +1046,7 @@ void before() {
   */
   nodeManager.setBatteryMin(1.8);
   nodeManager.setBatteryMax(3.2);
-  nodeManager.setSleep(SLEEP,5,MINUTES);
+  nodeManager.setSleepMinutes(5);
   nodeManager.registerSensor(SENSOR_LATCHING_RELAY,6);
 
   /*
@@ -1117,7 +1137,8 @@ void before() {
    * Register below your sensors
   */
   analogReference(DEFAULT);
-  nodeManager.setSleep(SLEEP,10,MINUTES);
+  nodeManager.setSleepMinutes(10);
+  nodeManager.setReportIntervalMinutes(10);
   
   int rain = nodeManager.registerSensor(SENSOR_ANALOG_INPUT,A1);
   int soil = nodeManager.registerSensor(SENSOR_ANALOG_INPUT,A2);
@@ -1209,11 +1230,11 @@ Create a branch for the fix/feature you want to work on and apply changes to the
 * Create and switch to a new branch (give it a significant name, e.g. fix/enum-sensors): `git checkout -b <yourbranch>`
 * Do any required change to the code
 * Include all the files changed for your commit: `git add .`
-* Commit the changes: `git  commit -m"Use enum instead of define for defining each sensor #121"`
 * Ensure both the main sketch and the config.h file do not present any change
+* Commit the changes: `git  commit -m"Use enum instead of define for defining each sensor #121"`
 * Push the branch with the changes to your repository: `git push origin <yourbranch>`
 * Visit `https://github.com/<username>/NodeManager/branches` and click the "New pull request" button just aside your newly created branch
-* Fill in the request with a significant title and description and select the "development" branch from the main repository to be compared against your branch
+* Fill in the request with a significant title and description and select the "development" branch from the main repository to be compared against your branch. Ensure there is one or more issues the pull request will fix and make it explicit within the description
 * Submit the request and start the discussion
 * Any additional commits to your branch which will be presented within the same pull request
 * When the pull request is merged, delete your working branch: `git branch -D <yourbranch>`
@@ -1285,3 +1306,22 @@ v1.5:
 * Added receiveTime() wrapper in the main sketch
 * Fixed the logic for output sensors
 * Added common gateway settings in config.h
+
+v1.6:
+* Introduced new remote API to allow calling all NodeManager's and sensors' functions remotely
+* Decoupled reporting intervals from sleeping cycles
+* All intervals (measure/battery reports) are now time-based
+* Added support for BMP280 temperature and pressure sensor
+* Added support for RS485 serial transport 
+* Added support for TSL2561 light sensor
+* Added support for DHT21 temperature/humidity sensor
+* Added support for AM2320 temperature/humidity sensor
+* Added support for PT100 high temperature sensor
+* Added support for MH-Z19 CO2 sensor
+* Added buil-in rain and soil moisture analog sensors
+* SensorRainGauge now supports sleep mode
+* SensorSwitch now supports awake mode
+* SensorLatchingRealy now handles automatically both on and off commands
+* SensorMQ now depends on its own module
+* Added automatic off capability (safeguard) to SensorDigitalOutput
+* Any sensor can now access all NodeManager's functions