📏 Understanding Distance Concepts in PuffiMail¶
PuffiMail uses a time-of-flight distance sensor (VL53L0X) to detect whether new mail has arrived. It does this by comparing two key values: the Current Distance and the Baseline Distance.
🔹 Current Distance¶
The real-time measured distance (in millimeters) from the sensor to the bottom of your mailbox.
- Automatically measured whenever the device is triggered (e.g., mailbox opens or sensor wakes up)
- A smaller value usually indicates that something (like mail) is present
- Displayed in the web interface or sent to MQTT as
current
🔹 Baseline Distance¶
A reference distance saved when the mailbox is completely empty.
- Acts as the "normal" distance with no mail inside
- Used to compare with current readings to determine mailbox status
- Can be updated manually from the web UI using the "Measure Distance" button
- Displayed as
baseline
in MQTT
🔹 "Measure Distance" Button¶
Manually triggers a distance reading and sets it as the new baseline.
- Use this when:
- First installing the device
- Cleaning or re-emptying the mailbox
- Repositioning or adjusting the sensor
- PuffiMail will save the current reading as the new
baseline
✅ Status Example Table¶
Situation | Current Distance | Baseline Distance | Reported Status |
---|---|---|---|
Mailbox is empty | 850 mm | 850 mm | empty |
New mail present | 600 mm | 850 mm | new_mail |
Sensor error / invalid | -1 or NaN | 850 mm | unknown |
💡 Tip: Always reset the Baseline Distance after installing or repositioning PuffiMail to ensure reliable detection.