Summary: I'm trying to figure out how to change either the time or the smart period setting on an alarm to account for a very erratic sleep schedule, or a way to remove alarms that are no longer needed.
I'm hoping that the Dev's have added more extras to com.urbandroid.sleep.alarmclock.ALARM_STATE_CHANGE that just havn't been added to the developer-api page...
Alternately, I'm open for suggestions on ways to mitigate the issue without ending up with 200 separate alarms that I have to delete by hand.
----
This is the end result I'm working the bugs out of.
I've been working on setting up an automated alarm system with Sleep as Android and tasker, and I've got most of it figured out thanks to the developer-api page.
I have my phone programmed to setup an alarm to wake me up after 8
hours when I put it next to the bed, since I don't have a static
schedule.
I am also able to automatically set a power nap up to trigger in 30 minutes by scanning an NFC tag next to my bed or at the office.
Additionally, I have a 5 minute power nap that is created whenever my office send me a service alert in the middle of the night.
(I'm on-call most of the time, the idea is for the power nap to wake me on the next light sleep phase when there's a major problem at the office).
Unfortunately, people have a habit of waking me up from naps and the on-call power nap alarms regularly cause me to skip my normal wake up alarm.
This results in my having a ton of alarms that are disabled before they get the chance to trigger and delete themselves, and they start to interfere with each other after a while.
So far, I've tried the following:
1) Setting up a Nap alarm and just enabling it with "com.urbandroid.sleep.alarmclock.ALARM_STATE_CHANGE"
Result: the scheduled time doesn't change to reflect the current time.
If I create a 30 minute nap at noon monday, and then reenable it at 2pm tuesday, the alarm is scheduled for 12:30 pm wednesday.
(ideally the app should remember that "this was a 30 minute nap", and adjust the time when it is reenabled.)
2) Setting application defaults to match one alarm type, and then creating a new alarm via "android.intent.action.SET_ALARM"
Result: Partially works, until I wake up before the alarm triggers and it gets disabled without getting to delete itself.
This leaves an orphaned alarm which interferes with the next nap and having the defaults set makes it impossible to automatically create other types of alarm.
3) Using Joaomcg's autoalarm to identify orphaned alarms and use tasker to disable them, then just change the alarm label to include the date.
Result: mostly corrects the issues with alarms interfering or remaining enabled, but it still conflicts with automatically creating other alarm types.
None of these options allow for me to automatically generate different types of alarm with different settings.
Possible solutions:
1) If I could adjust the times on existing alarms, I would be able to create one alarm for a full nights sleep and another for a nap, configure them completely, and just reuse them indefinitely.
2) If I could change the Smart period, I would be able to generate either type of alarm.
Other than that, I'm stumped.
Does anyone have any ideas?