AI-Assisted Sleep Disruption Investigation with Home Automation
A software engineer built a custom tool using AI coding assistants, a Raspberry Pi, microphones, and a Garmin watch to identify what wakes him up at night in a noisy city. The system, built over a weekend, records audio events when he is in bed, syncs them with sleep stage data from his Garmin watch and sensor events from Home Assistant, and presents everything in a web app with synchronized tracks. By reviewing the highlighted moments where sleep stages shifted, he identified specific noises: doors slamming, dishes clattering, motorbikes, scooters, trucks, and trash collection. He then added acoustic panels, insulation, and had conversations with neighbors to mitigate the issues. The project demonstrates how AI tooling lowers the barrier for personal data-driven problem-solving, though the author emphasizes that the AI was used for building the tool, not for sound classification. The code is not published and runs only on his home network. He also notes that Garmin's sleep stage data is imperfect but its wake detection is sufficient for identifying moments to investigate.
Key facts
- The tool uses two USB microphones, one inside and one outside the window.
- The Raspberry Pi only records when the user is at home and in bed, controlled via Home Assistant.
- Audio clips are saved with pre- and post-context when volume crosses a threshold.
- Sleep data comes from a Garmin watch, including sleep stages, heart rate, and HRV.
- The web app displays nights as synchronized tracks, similar to a music DAW.
- The author added IKEA acoustic panels and extra insulation around the bedroom door and window.
- The project took roughly 8 hours of work using AI coding assistants.
- The author does not trust Garmin and is looking for alternatives.
- The frontend is a progressive web app with web push notifications, served only over the home network.
- The author plans to add clustering of similar sounds and conditional alerts in the future.
Entities
Institutions
- Home Assistant
- Garmin
- IKEA
- Coros
- Raspberry Pi