I want this too, I tried downloading some but they aren't very good the free ones at least. Seems the only alternative is a smartwatch or fitbit. Some of the apps can tell when you wake up in the night, record when you snooze or any other bumps in the night that wake you up

I was super paranoid years ago thought aliens were abducting me, ghosts in the house, etc. I set my webcam up to record, found an app that only recorded whenever there was sound or movement in the room. You could set the program up however you liked but it never recorded anything particularly interesting which was both a relief and disappointment. Alternatively, this program could also be used in some nefarious ways like recording lets say some umm errr extra-curricular activities when the other is completely unaware. Not that I got lucky, or would even do this (who me? of course not) just sayin'