I try to pay attention to the small things that affect my quality of life. When something keeps bothering me, I want to investigate, find a likely cause, and act on it.
What changed recently is what I'm willing to build to support that. With AI tooling, projects I would have dismissed a few years ago as "too much effort for the payoff" now fit into a weekend. So whenever I bump into a problem in my daily life, I catch myself thinking, "actually, I could build something to look into this".
This post is about one of those problems: my sleep.
The problem
I live in a noisy city. Some nights I wake up at 3 am with no idea what woke me up. Other nights I don't fully wake up, but my watch the next morning shows that something pulled me out of deep sleep at 3:32 am.
The frustrating part is that you almost never know what caused it. When a sound wakes you up, your brain is still transitioning out of whatever sleep stage you were in, and it takes a moment to come back online properly. By the time you can register what's happening, the noise is already gone. Unless it repeats (thunder, car alarm that won't stop) or leaves a clue afterwards (a flash of lightning following the boom), you wake up confused and the cause stays a mystery.
And without naming the cause, you can't fix it. Was it inside the flat? Outside? A neighbor? A truck? A door? Any "solution" you try is just a guess, and guessing tends to be expensive.
So I was on a mission 😏
What I built, at a high level
One bit of context first: I already have a smart home setup with Home Assistant and a bunch of sensors around the flat (motion, doors, lights, temperature, humidity, CO₂, air quality). A lot of the data I needed for this project was already being collected. I only had to add the audio piece, pull in my sleep data, and tie everything together.
... continue reading