people are like "no kink at chaos this is a hacking event", but tbh, the latest stuff I found motivation to hack on and build has very much been for kinky reasons
@kitten yeah tbh I find it pretty cool. I was like "oh kitten has slept 3 times already tonight and I'm not even in bed yet". What sensor does it use ? Is it based on a smart watch?
so, this is an app I developed in my smartwatch, running Android Wear OS. so, essentially an Android app.
this registers a callback on boot to what it's called the "Health Services API". that's essentially a black box for us, we can't see or influence what heuristics it uses to determine if I'm asleep or not, but I know part of them use the accelerometer (since it doesn't work if I'm moving, like when sleeping in a night train), and I suspect the microphone too. so yeah, we register that callback requesting updates on what they call "user activity", and every time I wake up or fall asleep that gets an event saying which one is it, and a timestamp (they can sometimes be delayed).
I pack all that and send it through an MQTT queue, which is received in my server by one of those "workflow programming" kind of applications, like node-red. run some deduplication logic, save the event in a database, and publish an update here