         
         snprintf(message, sizeof(message), "level:%d", (int)cm);
         smartthing.send(message);
+
+        lastDistance = 0;
 #endif        
-      }        
+      }
     }
     
     lastCheck = time;

      }

      Serial.print(diff);
      
      Serial.print("  :: Last 10 :: ");
      
      for (int i = max(0, measurements.size() - 10); i < measurements.size(); ++i) 

        Serial.print((float)measurements.values()[i] / US_ROUNDTRIP_CM);
        Serial.print(" ");
      }
#endif      
      Serial.println("");
#endif  

      if (fabs(lastDistance - cm) > 1.5f || firstUpdate) {
        lastDistance = cm;
        firstUpdate = false;

#if DEBUG_ENABLED       
        Serial.print("Ping: ");
