****This tutorial assumes a decent level of tasker knowledge****
After trying a few different alarm clock apps, and getting very frustrated with how tasker could or could not interact with them, I finally decided to create my own tasker alarm clock. What I initially wanted was simple: an alarm clock that could reliably be used to trigger tasker tasks upon dismissing the alarm. I know there are third party alarm clocks with tasker integration, but I decided that for me, it would be better to just make an alarm using tasker.
First, we need to make a scene to display for when the alarm actually goes off. I just made a simple scene with 2 buttons. One button says DISMISS and the other says SNOOZE. Feel free to create as many buttons as you choose, and design the look and feel however you desire (my scenes are ugly and purely functional). For me it was very simple (I created a 3rd button that I won’t be going over in this tutorial):
We will fill in these buttons’ tap events in a moment (my mind jumps around a lot when creating things in tasker). For now let’s move on to creating a task that will display this alarm scene and play our alarm song/sound. Create a new task and call it Alarm (or whatever you want). This task will turn the display on, show the alarm scene, and play the alarm sound. There are also 2 global variables that we need to set here. I am using the variables %ALARM and %CANCELSNOOZE (you can name them whatever you want). The %ALARM variable will be used to hold the state of the alarm (on|off) and the %CANCELSNOOZE variable will be used to hold information if we have canceled a snooze after snoozing (no|yes)(for example, your alarm goes off, you hit snooze, then you wake up before the snooze time runs out so you decide to turn off the alarm). My Alarm task looks like the below images:
Now go back to the alarm scene that we created earlier. You could have any number of buttons on this scene, but I would recommend at least having a DISMISS and SNOOZE button. For the DISMISS button, you only NEED to set the %ALARM variable to off and destroy the alarm scene. Add any other things you want to happen upon alarm dismissal to this buttons tap element.
The SNOOZE button will be very similar. You need to set %ALARM to off and destroy the alarm scene. Then, you can issue a wait command for however long you want the snooze to be (I have chosen 10 minutes). After the wait, perform the alarm task. If you do not want to use AutoNotification (a great tasker plugin), then you can simply ignore the AutoNotification lines in the image below (I am using AutoNotification to be able to cancel a snooze…see next paragraph).
If you would like a way to cancel a snooze before it goes off, I suggest using a tasker plugin called AutoNotification. When snooze is pressed, an AutoNotification can be created with an action on touch. Call this action cancelsnooze or something similar, then setup an AutoNotification profile for cancelsnooze that when triggered will set the variable %CANCELSNOOZE to yes. Then before you run the alarm task after the wait, check if %CANCELSNOOZE is still set to no.
You can now run your alarm task manually and see if everything is working correctly. If everything is working, you can now setup tasker profiles for your alarms. I have 3 alarm profiles: Work, Church, and Misc. I recommend setting up these profiles using variables for the times.
You can now setup a scene for setting your alarm times. Below is a scene that I created to do just that. It is super simple and will set my %WORKALARM, %CHURCHALARM, or %MISCALARM variable to whatever I input in the box (in the format hH.MM). These are the time variables that are used in the alarm profiles. Make sure to set the time profile to go from %WORKALARM to %WORKALARM; it will not work correctly if you just set the profile for %WORKALARM :
At this point there are a number of things you can do to improve this alarm clock. One thing I have done is created AutoNotifications that tell me when my next alarm is, and allows me to ‘skip’ the next alarm (example use: I go out of town on Thursday evening and won’t be going to work on Friday, I can simply ‘skip’ the next alarm for Friday morning by clicking the AutoNotification.)