I let AI build a tool to help me figure out what was waking me up at night

· ai · Source ↗

TLDR

  • Software engineer used AI-assisted coding to build a weekend Home Assistant + Raspberry Pi audio monitor that correlates night noises with Garmin sleep data on a DAW-style timeline.

Key Takeaways

  • Two USB mics (indoor + outdoor), a Raspberry Pi rolling buffer, and a Home Assistant automation gate recording to only activate when the user is home and in bed.
  • The web app stitches three data sources (Garmin sleep stages, Home Assistant sensor events, Pi audio clips) onto a synced multi-track timeline; wake events are highlighted in red as the primary navigation signal.
  • AI did architecture and code generation, not sound classification; the author still listens manually, using the timeline to skip to moments worth reviewing.
  • Identified culprits: neighbor door slams, dish sounds, motorbikes, and trash trucks; fixes included IKEA acoustic panels, door/window sealing, and one household conversation.
  • Total build time was ~8 hours; author explicitly would not publish the code due to no formal review, but the home-lab network restriction limits exposure.

Hacker News Comment Review

  • Commenters noted Garmin is consistently rated among the worst smartwatches for accurate sleep-stage tracking in comparative tests, though wake-event detection is considered adequate for this use case.
  • CO2 levels visible in the screenshots drew attention as a potentially significant sleep quality factor independent of noise, with one commenter sharing that a cracked window kept bedroom CO2 below 600 PPM even near a motorway.
  • Several builders shared prior DIY equivalents using phone mics and Python amplitude-threshold scripts, confirming the core approach is sound but AI tooling compressed iteration time substantially.

Notable Comments

  • @nevi-me: CO2 in the screenshots looks unhealthy; bedroom ventilation may affect sleep quality beyond just acting as a noise source.
  • @phainopepla2: Raises that 3am waking is a known cortisol-spike pattern, and sleep-tracking anxiety can itself worsen sleep.

Original | Discuss on HN