So I've been looking around for a few days now for the ability to trigger a task via a sleep cycle alarm. There are several sleep cycle alarm apps out there (SleepBot, Sleep as Android, Sleep Cycle Alarm Clock) that you can set alarms for a certain "time". When it gets close to this time (ranging from around 30-90 minutes, depending on settings and such), the app will start monitoring your "sleep cycle" via the phone's sensors and microphones (for movement/sound) and wake you up when the app believe's you're in the lightest sleep.
What the reason I'm looking for this is for my home automation setup...I'd like to set my alarm (preferably via google search by voice...separate issue), then have my alarm trigger when I'm in the lightest sleep and tasker to run my "alarm". My alarm consist of connecting to my bluetooth speaker near my bed, starting iHeartRadio and gradually increasing volume, as well as I have a script that simulate a sunrise on my Philips Hue lights in my bedroom.
Any ideas here? It would be way more than greatly appreciated!