When syncing sleep from Apple Health, Habitify tracks both Time in Bed and Time Asleep.
To give you an accurate reflection of your rest without artificially inflating your hours, Habitify evaluates the start and end times of your recorded intervals and calculates your total sleep using one rule: No Double-Counting
If your "Time in Bed" and "Time Asleep" periods overlap, Habitify merges them so you aren't credited twice for the same hour. If the intervals are completely separate, Habitify adds them together.
How specific scenarios are handled
Completely Separate Intervals:
Scenario: You log Time in Bed and Time Asleep as separate, non-overlapping blocks of time (for example, taking an afternoon nap versus nighttime sleep).
How it syncs: Habitify counts both sessions and syncs the sum of both durations.
One Period Inside the Other (Fully Covered):
Scenario: Your Time Asleep falls entirely within your Time in Bed window (or vice versa).
How it syncs: Habitify syncs the longer window so the smaller duration inside it is not counted twice.
Partially Overlapping Intervals:
Scenario: Your Time in Bed and Time Asleep intervals overlap, but one starts or ends before the other.
How it syncs: Habitify merges them into a single continuous window, measuring from the earliest start time to the latest end time.
Summary Table
Sleep Data Logged in Apple Health | How Habitify Calculates It | Result |
Non-overlapping periods (e.g., 2 hrs nap + 7 hrs night) | Sums both durations | 9 hours total |
One covers the other (e.g., In Bed 11 PM–7 AM, Asleep 11:30 PM–6:30 AM) | Uses the overall enclosing window | 8 hours total (In Bed duration) |
Partial overlap (e.g., In Bed 11 PM–6 AM, Asleep 11:30 PM–7 AM) | Merges earliest start (11 PM) to latest end (7 AM) | 8 hours total |

