Stories

My slowest trip up the stairs took 18.76 seconds

home-assistant-config · basement.py ·

The basement lights know which way you're going on the stairs. The door opens, then the motion sensor at the bottom trips within 18 seconds: someone's coming down. Motion at the bottom, then the door: someone's leaving, so the lights can turn off behind them.

The "leaving" window was 18 seconds too, until the sensor history showed a real, slow, deliberate climb of 18.76 seconds that didn't count. The window is 25 seconds now. Leaving also gets a 20-second grace period that any new motion cancels, so nobody gets blacked out while they're still downstairs. And if someone leaves the door open, closing it soon after motion counts as leaving too.

That left one gap: someone sitting still. The stairs sensor can't see the couch, so if one person left while another stayed to watch, the lights went out on them. An mmWave presence sensor now watches the room, and a walk-out is cancelled while it still sees someone. If that sensor goes offline, it counts as empty, so the house falls back to the door and stairs logic, and a broken sensor can't keep the lights on.

Calibrating against real sensor data beats guessing, even when the test subject is me.