The wearable on the wrist gives a sleep score every morning, and it is not wrong. It is also not the house's. It knows nothing about the door to the bathroom, the CO₂ in the bedroom at three in the morning, the light in the hall, or the fan that ran all night because the room was too warm.
The house had been watching us sleep for years without drawing any conclusions, which is either discretion or a missed opportunity. We decided it was the latter, and taught it to grade the night.
The house knows all of that and had been throwing it away. So now, at a quarter past six and again when the sleep flag drops, a script reads the night back out of the recorder and scores it.
What counts as a bad night
The window runs from "went to bed", the sleep detector's flag capped at half past midnight, to "got up", the flag dropping after four. Inside it the script counts things a person would recognise as a bad night, each with a cost:
- Getting up. Motion at the entrance is the way to the toilet, so bursts of it (plus the bathroom door) are trips; the first one is free, every further one costs.
- Restlessness. The bedroom's presence radar holds "on" while somebody lies still; each flip is somebody moving at the edge of its range or getting up.
- Air. Minutes above 1,500 and above 2,000 ppm of CO₂, which a closed bedroom with two people reaches by two in the morning.
- Climate. Average temperature above 24 degrees or below 17; humidity above 65 percent.
- Light in the hall at night, duration under six hours, bedtime after one, and a bedroom cardio session, which is a wake-up by definition and logged, not punished.
The wearable's score is blended in at thirty percent, but only when its bedtime belongs to this night. It syncs in the afternoon, so at six in the morning it is usually still telling us about yesterday, and a score from the wrong night is worse than none.
The morning after
The number feeds three places. The house spirit's ladder gets a morning branch: a night under fifty makes it sleepy until ten, and its diary says why ("restless night: 3× to the toilet, 25 degrees, light on twice"). The display's morning thoughts open with the verdict. And a card on the dashboard shows the breakdown, so a bad score can be argued with.
The first night scored 67, "solid": two trips, a warm room, the hall light three times, one cardio session, and perfect air because the window was open. The second scored 58 and blamed the heat again. We believe the direction more than the number.
Twenty-six radar flips in six hours might be a restless sleeper or might be the normal noise of two people turning over; a week of logged nights will tell us which, and the thresholds will move. They are written down as a first draft, in the code and on the page, so that nobody, including the nightly reviewer, mistakes them for calibration.
Early for a reason
Since the calendars arrived, the script also checks whether a timed event before nine (a flight, an appointment, anything longer than half an hour) sits on today's date. If so, a short night is not scored as a bad one, and the reason says so. Getting up at five for a plane is not insomnia, and a spirit that pouts about it would be wrong.
The first score was 67. We chose to take that as encouraging, on the grounds that it was the house's opinion and the house had been up all night too.