I have about six years worth of sleep duration (and activity during sleep) data. There still isn't a single piece of FOSS software that would deal with that, I could import it into Postgres and view with Grafana, but I ain't no scientist or super interested in sleep science so there's very few conclusions I could make from it. Would love someone picking up this task :P
It's Windows-only and doesn't contain any knowledge about sleep science. As I said, I could import the data anywhere, but that alone is not worth much.
I’m pretty sure someone could take a raspberry pi with a battery power source and reconstruct a home sleep apnea device. If you just want to use an accelerometer you could probably do the same.