[TUT] Tasker | The Ultimate (over-informative & annoying) Alarm Clock V3|With Snooze!

Search This thread

brandall

Senior Member
May 16, 2008
2,679
5,219
Birmingham
[TUT] Tasker | The Ultimate (over-informative & annoying) Alarm Clock V3|With Snooze!

I had a look at the alarm clock on the Tasker wiki and decided to update it with screen actions for snooze. When I was done, I felt that something was missing... so I added a couple of things, then a few more and then a few more….

First install

Download the .zip file below.

In menu options/profile data 'Import One Task':

AlarmAPOTD.tsk.xml
AlarmDayHoro.tsk.xml
AlarmInfo.tsk.xml
AlarmMQoTD.tsk.xml
AlarmNewsHeadlines.tsk.xml
AlarmNGPOTD.tsk.xml
AlarmNPOTD.tsk.xml
AlarmReset.tsk.xml
AlarmSnooze.tsk.xml
AlarmSnoozeMaths.tsk.xml
AlarmSnoozeTime.tsk.xml
AlarmUPSMaths.tsk.xml
VariableClear
AlarmHTTPCheck
(added in V2)

In menu options/profile data 'Import One Profile':

AlarmClock

In a file explorer, navigate to /sdcard/Tasker and within this folder, create the following three folders:

APOTD
NPOTD
NGPOTD


In Tasker, click ‘Tasks’ and select AlarmReset. Click on ‘Test’ within the task to set up the initial variables.

Select the task Alarm. Edit action #11 and choose the alarm sound you wish.

Turn your screen lock off and adjust your screen-time-out to 5 minutes (just for testing).

Make sure you have an active wifi (or mobile data, but profile is data intensive) connection.

Click on the time in the profile AlarmClock and press now, add one minute to each time, click done, click apply… and off we go...

Hit 'snooze' when each speech action has finished.

New to Tasker? Download the free trial here
 
Last edited:

brandall

Senior Member
May 16, 2008
2,679
5,219
Birmingham
Disclaimer

Should this alarm fail, not wake you up, you lose your job, followed by your house and wife, please note that compensation claims will only be payable by cheque and may take up to 400 years to process <- You know what I’m sayin ;)

Theory

Q) Do you honestly think I’m ever going to use this? You seriously need to get out more.
A) Well maybe? I do!

I did give some thought to what I’d like to wake up to every morning, but unfortunately Tasker can’t perform that… :eek: So, I decided to go a little OTT and make this alarm useful for plenty of Tasker Tips and Tricks.

I separated out all of the tasks so you can easily see what I’ve done. They are then available for you to use or amalgamate into other profiles you have or wish to create. How nice am I…? Let’s take a look at them:

Alarm

This task is first to kick off and controls the flow of what Tasker is going to do. It starts by performing the task AlarmSnoozeMaths (we’ll look at this below) and then encounters its first IF check on the created variable %ALARMCOUNT. Every time you snooze the alarm clock it increases %ALARMCOUNT by 1. When the count is greater than 10, the alarm will stop activating.

As the task continues, it encounters more IF statements for %ALARMCOUNT and performs the action if the IF is true. This way, I was able to create different alarms for different ‘snooze times’. There are four custom speaking alarms and after that, it just plays your selected alarm ringtone.

AlarmSnoozeMaths

This task calculates what the time will be (to display on the screen) when you snooze for 10 minutes. %TIME + 0.10 would have been just so easy wouldn’t it..? But unfortunately when the time is 07:52, telling you your alarm was going to go off at 07:62 was just too untidy. Following the task through, you’ll see how I’ve split the variable %TIME by the ‘.’ and therefore had two variables ‘07’ and ‘52’. From there I add 10 to ‘52’ getting ‘62’. I say that IF it’s greater than 60, minus 60 from it; leaving ‘2’. I then say IF that number is less than 10, join it to ‘:0’, so we end up with ‘:02’. Simples.

The ‘07’ was easier to deal with. IF the above minutes had gone over 60, we would need to add ‘1’ to this number. IF that number was greater than 23, we’d change it to ‘00’.

All the split variables were then joined together and ended up with a more intelligent %STIME.

AlarmSnooze

This is a simple menu task that will pop up on the screen. Pressing one of the two choices will perform the associated tasks. The text you wish to display is in the label field. One performs the task AlarmSnoozeTime which handles the ‘snooze’ and the other performs AlarmReset, which is run when the alarm is turned off. EDIT - Forgot to mention, that if neither button is pressed after 2 minutes, it defaults to 'snooze'.

AlarmSnoozeTime

This firstly ‘shuts-up’ the speech or stops the music. Cancels the notifications and then patiently waits for 10 minutes (or your chosen snooze length) before kicking off the initial Alarm task again.

AlarmReset

Again, this silences and kills notifications before resetting and clearing variables, the most important of which is %ALARMCOUNT to 1, ready for next time it’s to be used. It turns your keyguard back on and stops. EDIT - VariableClear is added to this task by default in V2

AlarmUPSMaths

There is an inbuilt variable %UPS which is the time in seconds since you booted the device (uptime). In the AlarmInfo task, this information is used (amongst many other things!), but having it quote thousands of seconds was just too ugly and really pretty uninformative unless you are a maths genius and even then, first thing in the morning? So, I wanted to change this into hours and minutes. Following the task, you’ll see it starts by dividing %UPS by 3600 to convert it to hours. The result for example of 3.5 does not of course mean 3 hours and 50 minutes; wouldn’t that be easy..? No, the 0.5 = half = 30 minutes. So, by splitting the variable %UPS (which we transferred the created variable %UPMA originally for good house keeping) at the ‘.’ we can deal with the numbers behind the decimal places and convert them to minutes. If it was so simple to be 0.5, then multiplying that number by 60 would give us 30; wouldn’t that be simple..? In the event that it’s actually 0.521331232132131 we need to do something about the getting rid of the 30.121200234423823 (eg) – we do this by again splitting the variable and keeping only what was before decimal point (the whole minutes). Finally we are left with two created variables %UPHR and %UPMIN which are used in the AlarmInfo task for all but a second and therefore was a complete waste of my life – But hey, someone, somewhere, someday will read this when trying to do the same and hit the thanks meter!

AlarmInfo

The first of the information pulling tasks we will run. It grabs the text from the chosen URL in action #1 using an HTTP GET and then starts to extract what it needs – which in this case, is today’s weather forecast. If you’d like to see what information it initially collects and then follow how it’s split, add a file weather.txt under the ‘output file’ field which will store it on your storage card. The task then goes on to speak the weather to you, along with just about everything else that I could find in the Tasker variables for it to tell you! Annoying? Yeah, but that girl’s voice seriously gives me the horn… You? No? Oh...

AlarmMQoTD

Yes, what better to wake up to than a motivational quote!? I’m starting to realise that this profile is really going to make a difference in some of your lives... Ok, so another HTTP GET, followed by a lot of splitting to leave us just the Author and quote itself. This is spoken to you again shortly after by my girlfriend, erm, I mean the speech engine you use...

AlarmDayHoro

How could you possibly consider starting the day without knowing exactly what is going to happen to you by hearing your horoscope!? I know I couldn’t... Again, an HTTP GET, a lot of splitting and that’s what you’re left with.

AlarmNewsHeadlines

This task reads out the recipe of the day for you! Or alternatively, the news headlines as the title would suggest. HTTP GET, splitting, more splitting and job done.

AlarmAPOTD

Alarms are so visual aren’t they? How about some soothing wallpaper from NASA’s astronomy picture of the day – you can admire it whilst you press snooze... Another HTTP GET, but this time we are searching for the image source only and once we’ve dissected it, another HTTP GET grabs the image and Tasker updates your wallpaper with it.

AlarmNPOTD

Same as above, but just NASA’s picture of the day. WHOOP!

AlarmNGPOTD

Same again, but this time National Geographic. %WHOOP2!

AlarmNakedHotGirlOfTheDay

You wish... but if the thanks meter increases sufficiently, I’ll consider it for the next release ;)

VariableClear

The above tasks import a lot of text from the HTTP GET commands. Splitting them increases the amount yet further. This task is not currently instructed to run within any of the other tasks, so either run it manually (open it and press test) or add a ‘perform task’ action into AlarmReset, so it sweeps up for you.

Note: This task is HUGE. Currently (and unfortunately) you cannot join all of the split data together and clear it in one action. I’ve been reliably informed that it will be in the next Tasker update (although that comes a little too late for the 1.5hrs it took me to enter it all manually!) Have you hit the thanks meter yet? Do it again... EDIT - Added to the AlarmReset task as standard in V2

AlarmHTTPCheck (added in V2)

Should part of a triggering task fail, Tasker is currently set up to cease further actions. Having an alarm based on the reliability of your data connectivity is never a good plan, so I had to resolve how to confirm if the HTTPGET had failed and consequently, so had the alarm. There is a built in variable %HTTPR which is the response code, but unfortunately it's not so simple to 'variable check' this in the next action - if the HTTPGET failed, then it would not go to the next action... This needs to be changed within Tasker, but in the mean time the solution was to trigger a separate task.

AlarmHTTPCheck is triggered before the HTTPGET and runs with a lower priority than the calling task to ensure the HTTPGET action is not delayed. It waits 3 seconds, before checking %HTTPR is either a value of 200 or 400 denoting success. The task will cease if this is the case. If it isn't, it will increase the value of %ALARMCOUNT to 5 (+1 will be added in the task Alarm) so all further HTTPGET alarm calls are skipped and only the alarm music is triggered. The disadvantage of this is having less snoozes, but if you are not woken up to your expected informative speech tasks, I'm sure even your sleepy self will realise something is amiss. Sorted?

Credits

Unknown for weather
Unknown for APOD Wallpaper
Daweav for original wiki alarm with snooze
UncleMike for AM/PM variable splits
 
Last edited:

brandall

Senior Member
May 16, 2008
2,679
5,219
Birmingham
Customisation

Time – Changed by clicking the profile

Alarm Sound – Changed in the task Alarm, action #11

Star Sign – Change the text gem-in-eye to whatever you want the speech to try and say in action #9 of AlarmDayHoro. Change your star sign in the HTTP GET action #1 in the URL. You will also need to change the sign=# in the splitter as it turns out that each horoscope has a different number too. I'll put a list up of them all shortly, but in the mean time you'll have to look at the URL in a browser and spot your number please - Credit torsrex

Weather – go to this link and type your location in the search box. Click on it and note the code/extension of your local weather station in the URL. Change this in the HTTP GET server:port field – mine is 03534. If you live in the US, you need to add in different information after auto/ical – the blog post #4 here gives you an example

Female – Feel free to rewrite the speech entries so they are flattering to a girl. Or alternatively, call me... and I’ll talk dirty to you, robot-style.

Snooze interval – Change the wait time in AlarmSnoozeTime to the snooze interval you wish. Change the value in AlarmSnoozeMaths, action #3 to display the correct 'snoozing-to-time'.

Pop-up Notifications - You can add your own background by clicking 'tools' in AlarmSnooze.

Change Log

Code:
[B][U]V2[/U][/B]

Added task [B]AlarmHTTPCheck [/B]to ensure alarm didn't fail if a connection or connecting task failed.
Added task [B]VariableClear [/B]to [B]AlarmReset [/B]as standard
Changed collision handling in [B]AlarmSnooze[/B]
Changed task priorities to ensure [B]AlarmSnooze [/B]has a minimal delay at most
Changed task priorities to ensure [B]AlarmSnoozemaths [/B]always completes prior to use in the notification.

[B][U]V3[/U][/B]

* Stupid spelling mistakes in [B]AlarmNGPOTD [/B]& [B]AlarmAPOTD [/B]fixed
* Added day of the week as a context and removed from task [B]Alarm[/B]

Bug/Issue Report

Keyguard/Lockscreen - The keyguard action set off (#3) in the task Alarm has been left in. You’ll need to add Keyguard, set on to action #7 in AlarmReset. Please let me know how your device handles this and what lock you use. I’ll see if I can put something in as standard.

Slow device/internet connection – I’m not sure how your device will handle the multiple HPPT GET actions and if consequently, this will delay other actions such as the %STIME maths.

No/failed data connectionSOLVED in V2

Yahoo News Headlines - Appear to have started adding 'non text' to their headlines since testing... damn.

Development/Requests

NHGoTD currently at request level 1!

If you have a better RSS feed for the above or any requests, please do let me know.
If you adapt this to use your own RSS topics, please do share to save others with the headache of %HTTPD splitting
.

FAQ

Q) I like parts of this alarm, but not all of it. How do I change it just to suit me?
A) Instructions are written for you here

Q) I'm using your data sync profiles, can I combine these to start and stop the data connection before and after this task?
A) Absolutely, you can activate the data connection and then use any of the variables such as %WIFIOC or %WIFIORS to turn it off again, or leave it as it was. You could even make it that you only use this alarm when you are at home IF %WIFIHOME = 2 (reading %WIFIPREF).

Q) Why do you always transfer the %HTTPD data straight into another created variable?
A) Within the tasks, %HTTPD is populated with various different data. Transferring the data out of it as quick as possible prevents it being overwritten by a following HTTPGET task. We don't have to apply wait actions this way or confirm that one %HTTPD task has completed before another is allowed to start.

Q) I have many other Tasker questions, can I post them here??
A) To avoid clutter, probably best to use this official Google group

Q) Where can I learn more about Tasker?
A) The manual and Profiles and step-throughs on the Tasker wiki and you’ll be up to speed in no time.


Installation Instructions

In menu options/profile data 'Import One Task':

AlarmAPOTD.tsk.xml
AlarmDayHoro.tsk.xml
AlarmInfo.tsk.xml
AlarmMQoTD.tsk.xml
AlarmNewsHeadlines.tsk.xml
AlarmNGPOTD.tsk.xml
AlarmNPOTD.tsk.xml
AlarmReset.tsk.xml
AlarmSnooze.tsk.xml
AlarmSnoozeMaths.tsk.xml
AlarmSnoozeTime.tsk.xml
AlarmUPSMaths.tsk.xml
VariableClear
AlarmHTTPCheck


In menu options/profile data 'Import One Profile':

AlarmClock

No need to install V2 first, go straight for V3!

The thanks meter lets me know I'm appreciated! :eek:
 
Last edited:

brandall

Senior Member
May 16, 2008
2,679
5,219
Birmingham
V2 Up

Change Log

V2

* Added task AlarmHTTPCheck to ensure alarm didn't fail if a connection or connecting task failed.
* Added task VariableClear to AlarmReset as standard
* Changed collision handling in AlarmSnooze
* Changed task priorities to ensure AlarmSnooze has a minimal delay at most
* Changed task priorities to ensure AlarmSnoozemaths always completes prior to use in the notification.

V3

* Added day of the week as a context and removed from task Alarm
* Corrected spelling mistakes in NGPOTD & APOTD
 
Last edited:

thermopyl

New member
Sep 11, 2007
2
0
random snooze?

would it be possible in Tasker to add a random snooze duration, say between 2 and 10 minutes?
That will keep you on your toes! :)
 

brandall

Senior Member
May 16, 2008
2,679
5,219
Birmingham
would it be possible in Tasker to add a random snooze duration, say between 2 and 10 minutes?
That will keep you on your toes! :)

It would indeed! In answer to your question - yes! There is a variable randomize option which could be used in AlarmSnoozeMaths and then the same number in AlarmSnoozetime...

Tasker allows you to add variables so you could easily say %TIME + %RANDOMTIMEBETWEEN2AND10 = next alarm!

If it helps you get up in the morning, let us know and I'll put it in as standard! :D
 

thehrushi

Senior Member
Sep 27, 2010
177
13
Pune
I wish there was a stripped down version of this. I want the AlarmInfo task (which I can see has weather info and the usual text to say), but don't want horoscope, news or anything else (that wallpaper change thingy etc).
What do I do?
 

brandall

Senior Member
May 16, 2008
2,679
5,219
Birmingham
I wish there was a stripped down version of this. I want the AlarmInfo task (which I can see has weather info and the usual text to say), but don't want horoscope, news or anything else (that wallpaper change thingy etc).
What do I do?

Should be quite easy - I'll post instructions for you later :)

EDIT - The instructions are here in post #11 for you.
 
Last edited:

brandall

Senior Member
May 16, 2008
2,679
5,219
Birmingham
I only want to use parts of this alarm, how do I strip??

The basics of the functions of the alarm are in the task Alarm. Opening it, you'll see that in action #3 it has a 'goto' request IF the %ALARMCOUNT (the amount of times it has already activated) is over 10.

Firsly, whatever changes you make, you'll need to make sure that 'goto' always points to the Variable Set %ALARMCOUNT to 1 (currently action #14), which is the reset function before the alarm switches off.

I set this up so all of the information grabbing tasks are separate. Therefore all you need to do is delete the actions that request them in the form of a 'perform task'.

You'll see in the task Alarm that action numbers 5,6,7,8 call for the following tasks to go off and get their information:

AlarmInfo
AlarmMQoTD
AlarmDayHoro
AlarmNewsHeadlines


You can delete the ones you don't wish to have from Alarm, but don't forget to check the 'goto' is still pointing to Variable Set %ALARMCOUNT to 1!

There are no further 'goto' actions to be concerned with in the above and below information tasks.

The first 3 tasks above, kick off the wallpaper tasks in their actions:

AlarmAPOTD (action #4 in AlarmInfo)
AlarmNGPOTD (action #12 in AlarmMQoTD)
AlarmNPOTD (action number #9 in AlarmDayHoro)

The action number varies due to the differing number of Variable Splits required when extracting the data from the HTTPGET.

You are free to delete the perform task actions should you no require the wallpaper changes.

You are free to edit the perform task actions to a different task (wallpaper) if you only want to use a particular one.

That's it! Easily changed to suit your own taste. Any questions, no matter how silly they feel, please do not hesitate to ask (Tasker makes us all feel a bit dumb at first! :eek: ).
 
  • Like
Reactions: DHave

brandall

Senior Member
May 16, 2008
2,679
5,219
Birmingham
Feedback?

There have been a few downloads of this, but no feedback?

Should I assume that everything is working absolutely fine?!?!? Hope so!
 

A$h x

Senior Member
Feb 9, 2011
237
41
London
I have a question for you:

Are there any pre-made scripts to perform all these tasks you describe, or do we HAVE to manually input them ourselves?
 

brandall

Senior Member
May 16, 2008
2,679
5,219
Birmingham
I have a question for you:

Are there any pre-made scripts to perform all these tasks you describe, or do we HAVE to manually input them ourselves?

The profile and tasks download is in post #3. Import them into Tasker and they are ready to go, everything is set up for you.

In post #1 you'll see that you need to do the basics such as creating folders on the SD card and choosing your alarm sound.

It's a 3 minute job before you can run this for the first time. The amount of changes after that is up to you!

EDIT - ps. There are hundreds of other ready to go Tasker profiles kicking around the net.
 
  • Like
Reactions: CaptainFodder

torsrex

Senior Member
Dec 12, 2010
407
86
WOW, just found out that you had created yet another profile! (Too much tapatalk without signatures) :p. Gonna try this out tomorrow, will report back here with my experiences. ;)
 

torsrex

Senior Member
Dec 12, 2010
407
86
Haha, love the new "alarm clock" (more like high-tech alarm clock monster).
A few bugs to report:
When it tries to pull the weather I get an Unkonw Host message (although the link open's fine in the browser).
The horoscop won't pull itself (I get no error messages, but the "girl" tells me the variable %HOROD instead of my horoscope).
I have sat the snooze time for 2 minutes, but the popup shows 7:03 (which could not be right because my alarm goes off at 7:00).
The rest of the alarm-clock is working fine(love the picture changing thingy)!
Feature request:
Read the first ten topics of the email.
 
Last edited:

brandall

Senior Member
May 16, 2008
2,679
5,219
Birmingham
Haha, love the new "alarm clock" (more like high-tech alarm clock monster).
A few bugs to report:
When it tries to pull the weather I get an Unkonw Host message (although the link open's fine in the browser).
The horoscop won't pull itself (I get no error messages, but the "girl" tells me the variable %HOROD instead of my horoscope).
I have sat the snooze time for 2 minutes, but the popup shows 7:03 (which could not be right because my alarm goes off at 7:00).
The rest of the alarm-clock is working fine(love the picture changing thingy)!
Feature request:
Read the first ten topics of the email.

Doh! I thought it was working great...

Hmmm... Are you sure you've set the weather up correctly - under the 'mime type' are you pulling HTML instead? Does it work on the weather for my location? Add an output file of weather.txt and see if you get a file created.

For %HOROD, do the same and set an output file horo.txt. It may be that the splitters I've used don't match your star sign - again, did it work with the standard settings.

If the splitters are wrong and you need help changing them, paste the file contents in #code# tags and I'll take a look..

The alarm time must match the number in alarmsnoozemaths too - otherwise you'll end up with two different numbers... Where they the same?

I'm working on calendar entries and email - but Tasker only currently reads K9 email and the calendar entries are coded... need to decode them... Effort!

Keep an eye on your thanks meter ;)
 
  • Like
Reactions: CaptainFodder

Top Liked Posts

  • There are no posts matching your filters.
  • 37
    Customisation

    Time – Changed by clicking the profile

    Alarm Sound – Changed in the task Alarm, action #11

    Star Sign – Change the text gem-in-eye to whatever you want the speech to try and say in action #9 of AlarmDayHoro. Change your star sign in the HTTP GET action #1 in the URL. You will also need to change the sign=# in the splitter as it turns out that each horoscope has a different number too. I'll put a list up of them all shortly, but in the mean time you'll have to look at the URL in a browser and spot your number please - Credit torsrex

    Weather – go to this link and type your location in the search box. Click on it and note the code/extension of your local weather station in the URL. Change this in the HTTP GET server:port field – mine is 03534. If you live in the US, you need to add in different information after auto/ical – the blog post #4 here gives you an example

    Female – Feel free to rewrite the speech entries so they are flattering to a girl. Or alternatively, call me... and I’ll talk dirty to you, robot-style.

    Snooze interval – Change the wait time in AlarmSnoozeTime to the snooze interval you wish. Change the value in AlarmSnoozeMaths, action #3 to display the correct 'snoozing-to-time'.

    Pop-up Notifications - You can add your own background by clicking 'tools' in AlarmSnooze.

    Change Log

    Code:
    [B][U]V2[/U][/B]
    
    Added task [B]AlarmHTTPCheck [/B]to ensure alarm didn't fail if a connection or connecting task failed.
    Added task [B]VariableClear [/B]to [B]AlarmReset [/B]as standard
    Changed collision handling in [B]AlarmSnooze[/B]
    Changed task priorities to ensure [B]AlarmSnooze [/B]has a minimal delay at most
    Changed task priorities to ensure [B]AlarmSnoozemaths [/B]always completes prior to use in the notification.
    
    [B][U]V3[/U][/B]
    
    * Stupid spelling mistakes in [B]AlarmNGPOTD [/B]& [B]AlarmAPOTD [/B]fixed
    * Added day of the week as a context and removed from task [B]Alarm[/B]

    Bug/Issue Report

    Keyguard/Lockscreen - The keyguard action set off (#3) in the task Alarm has been left in. You’ll need to add Keyguard, set on to action #7 in AlarmReset. Please let me know how your device handles this and what lock you use. I’ll see if I can put something in as standard.

    Slow device/internet connection – I’m not sure how your device will handle the multiple HPPT GET actions and if consequently, this will delay other actions such as the %STIME maths.

    No/failed data connectionSOLVED in V2

    Yahoo News Headlines - Appear to have started adding 'non text' to their headlines since testing... damn.

    Development/Requests

    NHGoTD currently at request level 1!

    If you have a better RSS feed for the above or any requests, please do let me know.
    If you adapt this to use your own RSS topics, please do share to save others with the headache of %HTTPD splitting
    .

    FAQ

    Q) I like parts of this alarm, but not all of it. How do I change it just to suit me?
    A) Instructions are written for you here

    Q) I'm using your data sync profiles, can I combine these to start and stop the data connection before and after this task?
    A) Absolutely, you can activate the data connection and then use any of the variables such as %WIFIOC or %WIFIORS to turn it off again, or leave it as it was. You could even make it that you only use this alarm when you are at home IF %WIFIHOME = 2 (reading %WIFIPREF).

    Q) Why do you always transfer the %HTTPD data straight into another created variable?
    A) Within the tasks, %HTTPD is populated with various different data. Transferring the data out of it as quick as possible prevents it being overwritten by a following HTTPGET task. We don't have to apply wait actions this way or confirm that one %HTTPD task has completed before another is allowed to start.

    Q) I have many other Tasker questions, can I post them here??
    A) To avoid clutter, probably best to use this official Google group

    Q) Where can I learn more about Tasker?
    A) The manual and Profiles and step-throughs on the Tasker wiki and you’ll be up to speed in no time.


    Installation Instructions

    In menu options/profile data 'Import One Task':

    AlarmAPOTD.tsk.xml
    AlarmDayHoro.tsk.xml
    AlarmInfo.tsk.xml
    AlarmMQoTD.tsk.xml
    AlarmNewsHeadlines.tsk.xml
    AlarmNGPOTD.tsk.xml
    AlarmNPOTD.tsk.xml
    AlarmReset.tsk.xml
    AlarmSnooze.tsk.xml
    AlarmSnoozeMaths.tsk.xml
    AlarmSnoozeTime.tsk.xml
    AlarmUPSMaths.tsk.xml
    VariableClear
    AlarmHTTPCheck


    In menu options/profile data 'Import One Profile':

    AlarmClock

    No need to install V2 first, go straight for V3!

    The thanks meter lets me know I'm appreciated! :eek:
    29
    [TUT] Tasker | The Ultimate (over-informative & annoying) Alarm Clock V3|With Snooze!

    I had a look at the alarm clock on the Tasker wiki and decided to update it with screen actions for snooze. When I was done, I felt that something was missing... so I added a couple of things, then a few more and then a few more….

    First install

    Download the .zip file below.

    In menu options/profile data 'Import One Task':

    AlarmAPOTD.tsk.xml
    AlarmDayHoro.tsk.xml
    AlarmInfo.tsk.xml
    AlarmMQoTD.tsk.xml
    AlarmNewsHeadlines.tsk.xml
    AlarmNGPOTD.tsk.xml
    AlarmNPOTD.tsk.xml
    AlarmReset.tsk.xml
    AlarmSnooze.tsk.xml
    AlarmSnoozeMaths.tsk.xml
    AlarmSnoozeTime.tsk.xml
    AlarmUPSMaths.tsk.xml
    VariableClear
    AlarmHTTPCheck
    (added in V2)

    In menu options/profile data 'Import One Profile':

    AlarmClock

    In a file explorer, navigate to /sdcard/Tasker and within this folder, create the following three folders:

    APOTD
    NPOTD
    NGPOTD


    In Tasker, click ‘Tasks’ and select AlarmReset. Click on ‘Test’ within the task to set up the initial variables.

    Select the task Alarm. Edit action #11 and choose the alarm sound you wish.

    Turn your screen lock off and adjust your screen-time-out to 5 minutes (just for testing).

    Make sure you have an active wifi (or mobile data, but profile is data intensive) connection.

    Click on the time in the profile AlarmClock and press now, add one minute to each time, click done, click apply… and off we go...

    Hit 'snooze' when each speech action has finished.

    New to Tasker? Download the free trial here
    27
    Disclaimer

    Should this alarm fail, not wake you up, you lose your job, followed by your house and wife, please note that compensation claims will only be payable by cheque and may take up to 400 years to process <- You know what I’m sayin ;)

    Theory

    Q) Do you honestly think I’m ever going to use this? You seriously need to get out more.
    A) Well maybe? I do!

    I did give some thought to what I’d like to wake up to every morning, but unfortunately Tasker can’t perform that… :eek: So, I decided to go a little OTT and make this alarm useful for plenty of Tasker Tips and Tricks.

    I separated out all of the tasks so you can easily see what I’ve done. They are then available for you to use or amalgamate into other profiles you have or wish to create. How nice am I…? Let’s take a look at them:

    Alarm

    This task is first to kick off and controls the flow of what Tasker is going to do. It starts by performing the task AlarmSnoozeMaths (we’ll look at this below) and then encounters its first IF check on the created variable %ALARMCOUNT. Every time you snooze the alarm clock it increases %ALARMCOUNT by 1. When the count is greater than 10, the alarm will stop activating.

    As the task continues, it encounters more IF statements for %ALARMCOUNT and performs the action if the IF is true. This way, I was able to create different alarms for different ‘snooze times’. There are four custom speaking alarms and after that, it just plays your selected alarm ringtone.

    AlarmSnoozeMaths

    This task calculates what the time will be (to display on the screen) when you snooze for 10 minutes. %TIME + 0.10 would have been just so easy wouldn’t it..? But unfortunately when the time is 07:52, telling you your alarm was going to go off at 07:62 was just too untidy. Following the task through, you’ll see how I’ve split the variable %TIME by the ‘.’ and therefore had two variables ‘07’ and ‘52’. From there I add 10 to ‘52’ getting ‘62’. I say that IF it’s greater than 60, minus 60 from it; leaving ‘2’. I then say IF that number is less than 10, join it to ‘:0’, so we end up with ‘:02’. Simples.

    The ‘07’ was easier to deal with. IF the above minutes had gone over 60, we would need to add ‘1’ to this number. IF that number was greater than 23, we’d change it to ‘00’.

    All the split variables were then joined together and ended up with a more intelligent %STIME.

    AlarmSnooze

    This is a simple menu task that will pop up on the screen. Pressing one of the two choices will perform the associated tasks. The text you wish to display is in the label field. One performs the task AlarmSnoozeTime which handles the ‘snooze’ and the other performs AlarmReset, which is run when the alarm is turned off. EDIT - Forgot to mention, that if neither button is pressed after 2 minutes, it defaults to 'snooze'.

    AlarmSnoozeTime

    This firstly ‘shuts-up’ the speech or stops the music. Cancels the notifications and then patiently waits for 10 minutes (or your chosen snooze length) before kicking off the initial Alarm task again.

    AlarmReset

    Again, this silences and kills notifications before resetting and clearing variables, the most important of which is %ALARMCOUNT to 1, ready for next time it’s to be used. It turns your keyguard back on and stops. EDIT - VariableClear is added to this task by default in V2

    AlarmUPSMaths

    There is an inbuilt variable %UPS which is the time in seconds since you booted the device (uptime). In the AlarmInfo task, this information is used (amongst many other things!), but having it quote thousands of seconds was just too ugly and really pretty uninformative unless you are a maths genius and even then, first thing in the morning? So, I wanted to change this into hours and minutes. Following the task, you’ll see it starts by dividing %UPS by 3600 to convert it to hours. The result for example of 3.5 does not of course mean 3 hours and 50 minutes; wouldn’t that be easy..? No, the 0.5 = half = 30 minutes. So, by splitting the variable %UPS (which we transferred the created variable %UPMA originally for good house keeping) at the ‘.’ we can deal with the numbers behind the decimal places and convert them to minutes. If it was so simple to be 0.5, then multiplying that number by 60 would give us 30; wouldn’t that be simple..? In the event that it’s actually 0.521331232132131 we need to do something about the getting rid of the 30.121200234423823 (eg) – we do this by again splitting the variable and keeping only what was before decimal point (the whole minutes). Finally we are left with two created variables %UPHR and %UPMIN which are used in the AlarmInfo task for all but a second and therefore was a complete waste of my life – But hey, someone, somewhere, someday will read this when trying to do the same and hit the thanks meter!

    AlarmInfo

    The first of the information pulling tasks we will run. It grabs the text from the chosen URL in action #1 using an HTTP GET and then starts to extract what it needs – which in this case, is today’s weather forecast. If you’d like to see what information it initially collects and then follow how it’s split, add a file weather.txt under the ‘output file’ field which will store it on your storage card. The task then goes on to speak the weather to you, along with just about everything else that I could find in the Tasker variables for it to tell you! Annoying? Yeah, but that girl’s voice seriously gives me the horn… You? No? Oh...

    AlarmMQoTD

    Yes, what better to wake up to than a motivational quote!? I’m starting to realise that this profile is really going to make a difference in some of your lives... Ok, so another HTTP GET, followed by a lot of splitting to leave us just the Author and quote itself. This is spoken to you again shortly after by my girlfriend, erm, I mean the speech engine you use...

    AlarmDayHoro

    How could you possibly consider starting the day without knowing exactly what is going to happen to you by hearing your horoscope!? I know I couldn’t... Again, an HTTP GET, a lot of splitting and that’s what you’re left with.

    AlarmNewsHeadlines

    This task reads out the recipe of the day for you! Or alternatively, the news headlines as the title would suggest. HTTP GET, splitting, more splitting and job done.

    AlarmAPOTD

    Alarms are so visual aren’t they? How about some soothing wallpaper from NASA’s astronomy picture of the day – you can admire it whilst you press snooze... Another HTTP GET, but this time we are searching for the image source only and once we’ve dissected it, another HTTP GET grabs the image and Tasker updates your wallpaper with it.

    AlarmNPOTD

    Same as above, but just NASA’s picture of the day. WHOOP!

    AlarmNGPOTD

    Same again, but this time National Geographic. %WHOOP2!

    AlarmNakedHotGirlOfTheDay

    You wish... but if the thanks meter increases sufficiently, I’ll consider it for the next release ;)

    VariableClear

    The above tasks import a lot of text from the HTTP GET commands. Splitting them increases the amount yet further. This task is not currently instructed to run within any of the other tasks, so either run it manually (open it and press test) or add a ‘perform task’ action into AlarmReset, so it sweeps up for you.

    Note: This task is HUGE. Currently (and unfortunately) you cannot join all of the split data together and clear it in one action. I’ve been reliably informed that it will be in the next Tasker update (although that comes a little too late for the 1.5hrs it took me to enter it all manually!) Have you hit the thanks meter yet? Do it again... EDIT - Added to the AlarmReset task as standard in V2

    AlarmHTTPCheck (added in V2)

    Should part of a triggering task fail, Tasker is currently set up to cease further actions. Having an alarm based on the reliability of your data connectivity is never a good plan, so I had to resolve how to confirm if the HTTPGET had failed and consequently, so had the alarm. There is a built in variable %HTTPR which is the response code, but unfortunately it's not so simple to 'variable check' this in the next action - if the HTTPGET failed, then it would not go to the next action... This needs to be changed within Tasker, but in the mean time the solution was to trigger a separate task.

    AlarmHTTPCheck is triggered before the HTTPGET and runs with a lower priority than the calling task to ensure the HTTPGET action is not delayed. It waits 3 seconds, before checking %HTTPR is either a value of 200 or 400 denoting success. The task will cease if this is the case. If it isn't, it will increase the value of %ALARMCOUNT to 5 (+1 will be added in the task Alarm) so all further HTTPGET alarm calls are skipped and only the alarm music is triggered. The disadvantage of this is having less snoozes, but if you are not woken up to your expected informative speech tasks, I'm sure even your sleepy self will realise something is amiss. Sorted?

    Credits

    Unknown for weather
    Unknown for APOD Wallpaper
    Daweav for original wiki alarm with snooze
    UncleMike for AM/PM variable splits
    4
    V2 Up

    Change Log

    V2

    * Added task AlarmHTTPCheck to ensure alarm didn't fail if a connection or connecting task failed.
    * Added task VariableClear to AlarmReset as standard
    * Changed collision handling in AlarmSnooze
    * Changed task priorities to ensure AlarmSnooze has a minimal delay at most
    * Changed task priorities to ensure AlarmSnoozemaths always completes prior to use in the notification.

    V3

    * Added day of the week as a context and removed from task Alarm
    * Corrected spelling mistakes in NGPOTD & APOTD
    2
    Okay, I am having some issues with this...maybe someone can help me.
    I have a Nexus S CDMA running ICS and Tasker 1.2.1
    1. The voice almost never finishes the whole text - this is evident in System Information, Horoscope, News, and more than likely the Motivational Quote (today is a short one).
    2. I went through and changed News so that it would not say the 'non-text' stuff. (This only says the headlines and not the story)
    3. I changed the Horoscope feed - when I tested this it did not give a horoscope - looks like the feed has moved.
    4. I did create a DHOTD (it does not run with the alarm and only works when tested - this takes the place of NGOTD. I did not do this to share unless OP wants it, I only did this since I was editing the rest of the stuff, figured I would try. The OP did a great job in creating tasks).
    5. The media file is in #9 on mine, not #11.
    6. Not all variables were cleared, so I went and changed that.
    7. I think there was some issue with the pictured feeds, so I changed those (not 100% sure that I changed all of them, but I changed some)
    8. Also changed weather so it didn't speak 'non-text'

    Since nobody else has posted for a while, am I the only one having issues? Is it my phone? I did test it the first time without changing anything.

    Also, if the person who was trying to strip down the Alarm and removed the MQ, Horo, APOTD, NGPOTD, NPOTD is still around, you need to edit the AlarmInfo task and remove the call to APOTD as that could be the reason it is stopping. Also, click on whatever task you are wanting to check (I would start with AlarmInfo) and Test. When it comes up with the box to snooze or clear, hit the back button. Now, go to the Variable tab and look at the WEATHERD variables and that should help you to figure out why Weather is not working - same for News.

    I do not want to overtake this thread, just trying to get some help and offer some as well.