Somnivox: A Sleep Spell in Your Watch — On-Device AI That Puts You to Sleep
See how a Wear OS app uses on-device AI to detect sleep readiness and play sounds, running entirely on the watch with no cloud or phone needed.
Overview
What if your watch could detect the exact moment your brain is ready to sleep — and play the right sound at the right time to push you over the edge?
Somnivox is a Wear OS app that runs a real-time sleep classifier entirely on the watch. No cloud. No phone. No subscription. It monitors your heart rate epoch by epoch, detects when you’ve been lying awake in bed for 15 minutes, and fades in NSDR audio precisely during the neurological window when it works.
The classifier is a personally-calibrated state machine — 5 inputs per epoch, 30 lines of Java, tuned from real overnight data. The next phase replaces it with a quantized LiteRT model trained on multi-tester data, inferring in under 1ms on CPU within the same 17% nightly battery budget. Google shipped LiteRT to production in January 2026 — the timing is perfect.
4 nights of real data. The trigger fired correctly last night. I’ll show the epoch replay tool, the raw sensor logs, and the live watch.
Looking for Wear OS beta testers and anyone who has shipped a health app on Play Store.
Video
Transcript
Generated 3 months ago
Summary
Generating a talk summary...
View full transcript
And, I see many who didn't. So for some who didn't, like, have you did something to build, to fix it? Stop AI Tinkerers IDENTIFICATION, maybe. Okay. I built something because I have this problem.
So sometime I wake up in the middle of night, and a lot of ideas, things are in my hand hand. So I was stuck looking around if something's valuable for to get me back to sleep. And, usually, it's just triggers, and, they tell you how bad you sleep, but they didn't help you. So I I'm listening to a lot of podcast and Huberman and others. They have good ideas.
Okay. There's audio guided meditations, like body scan and and, like, breathing techniques that help you get back to sleep fast. So they lower your heart rate and then you can fall asleep in a minute. So I tried it and, I decided to build something. So basically what I built, IDENTIFICATION for watch where it's Pierre IDENTIFICATION.
And what it does, it's not connected to any it's all processing is done on the watch. So it's there's basically a small model that's running it. So what I did, I collected data from from my watch. This is about my heart rate. So first, I did this collection.
Then I built a tensor for white networks, small network. I trained it on co op. And as well, I created audio tracks. So I created audio tracks in several languages and with different type of meditation. So because for different people, it's maybe work differently.
So and as I'm I'm running it, so basically, it's looks at it's running and much. So it's for each 5 minute, it runs once. It wake up to IDENTIFICATION. It will get batch of sensor data that it collected in 5 minutes and try to interpret it using this TensorFlow network. So it's very tiny just for a case.
I quite I try to quantize it, and it doesn't matter. It's the same precision, so and the same performance. So so it's, what I did is so it works. It doesn't work all the time as I wanted, but, I was, like, Sunday night, I I was amazed. So it take me up just, when I need to go to bathroom.
So and then it plays this meditation. I fell asleep right away. So I was super happy about this. So, like, my mother will wake up. Okay.
Great. It was working. So it doesn't work all the time because I guess my my heart rate and and, like, actually features for this network is heart rate, heart rate changes, like how much it change over 5 minutes period, and as well as how much I'm moving. So, like, I collected data from myself and from another family member who cannot get so forced to do this once, so she's not happy. But, I did it.
So, right now, it's strange just on, like, 14 nights of sleep. And, to label data, I'm using my partner, which is Claude, obviously. So what I'm doing, I'm just taking picture of those just take sleep applications that tells me how I sleep. So I take pictures. So and then I give my data that I collected from my watch, these time stamps, like, okay.
What was the start rate? What was my movement and differentiation? And then I provide information, label data from my watch, and then it gives me, information overrides. So basically, I can, then I'm using this label data with overrides, and then I train my system. So this this network so it kind of helps because it's labeled data and it will be difficult to label, like, hundreds and hundreds of records manually.
So I'm pretty happy about this because I don't want to put you as in it now. And I but I'll I'll try this application so it's on my watch. I have 2 modes, basically. I have a manual mode for for, like okay. I'm laying around laying down, but it doesn't work.
But but I still want meditation. So then I can just trigger it manually so that I'll do it for now. Maybe repeat what the what the watch is saying. That's very fake. Yeah.
Okay. So this is basically an experience. And I know some people, like, sleeping with partners. So then you can just have a you can have there's a skull conducting. Full conducting.
Yeah. Yeah. So you can use a ham, so it can work as well. I want to show you some code. Okay.
So I did demo. I have some GitHub origin repos. I split project in 3 different repos. Damien Somnio X. Another 1 is Cora.
So it's kind of models that can be shared with replay tool. So replay tool is part of my training process, so it helps me visualize data. It helps as well to clean data. And, so when I need to and then build it's this kind of visualize, like, my sleep. So, like, sleeping, different rates, and features, if state change.
So we can generate different type of output CSV for training or generate, like, a few different type of output CSV for training or generate, like, the human consumption profile of. So I can understand what happened. And, like, because I know you're denied. IDX. So I'll just show it.
So this, 1 is generating audio. So I'm using I'm using a library from Microsoft that help, build this text to speech. So, again, I use Claude, to generate this meditation text in different languages. So I'm in different. So mhmm.
And then I use this HTTPS that, converted, this this text to audios, and I did as well. I generated pink noise, so it kind of helps as well brainwaves relax. And, then I'm mixing this together. So this is 1 of my notebook. Another notebook is where I train my TensorFlow Lite network.
So this is 1. I still need to improve quality because it has hard time to recognize light sleep. So this is phase before between real sleep and awakeness, so it's not super simple to do this. Okay. I'm going back to this because I have a call for action.
So I have form submission form. So if you think, I should continue with this project, I need more data. So if you want, if you can wear a device, okay, please, help. And as well, if you if you have experience with Sergey OS or this Play Store, so as well, I'm interested to hear from you guys because, like, I never, submitted applications there. My last experience was was Blackberry applications.
I've been down in 24 hours, but it was a long time ago. And if you think it's I shouldn't continue with it as well. I want to hear from you. So, like, it it's not ideas.