value_macro expression:
Available Sleep Macros
| Macro Name | Description | Output Column Name |
|---|---|---|
| Chronotype | The chronotype of the sleep session, categorized as lark, third, or owl. | chronotype |
| Sleep Score | A score from 0 to 100 computed using the Vital Horizon AI Sleep Score model. | sleep_score |
| Asleep At | Computed time of user falling asleep based on sleep session start time and latency. | asleep_at |
| Awake At | Computed time the user woke up (may differ from session end time). | awake_at |
Example query
Chronotype
Determine the chronotype of each sleep session. Chronotype categories are based on the sleep midpoint time:- lark if midpoint ≥ 17:00 or ≤ 03:30
- third if midpoint ≤ 06:00
- owl otherwise
Get last chronotype of the week
Sleep Score
Calculate a Sleep Score (0 to 100) for each sleep session.Get mean sleep score of the week
Awake At / Asleep At
Pinpoint when a user first fell asleep and when they became fully awake during each sleep session. Theasleep_at macro returns the bedtime start adjusted by the recorded sleep latency, while awake_at returns the bedtime start plus the offset of the final non-awake sleep segment.