• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Tasker Help

D

Deleted User

Guest
Does anyone have any experience with tasker, specifically in regards to making a talking clock to announce the hour. There are some profiles on tasker wiki, but the DL file won't download into tasker, says the URI cannot contain spaces...I attempted manual entry, but still cannot get it to work. I attempted another one I found on the site, that was fairly easy to enter, but cannot get it to talk in 12 hour format...

any ideas?
 
This may help:

Variable Set %MYTIME %TIME
Variable Split %MYTIME "."
Variable Set %MYAMPM "a m"
Variable Set %MYAMPM "p m" If %MYTIME1 > 11
Variable Subtract %MYTIME1 12 If %MYTIME1 > 12
Variable Add %MYTIME1 12 If %MYTIME1 = 0
Variable Set %MYTIME1 %MYTIME1 [Do Maths] (should eliminate any leading zeros)
Variable Set %MYTIME2 %MYTIME2 [Do Maths] (should eliminate any leading zeros)
Variable Set %MYTIME2 "o %MYTIME2" If %MYTIME2 < 10
Say %MYTIME1 %MYTIME2 %MYAMPM

Tested at 18:09 it said "six oh nine pee em"

NOTE: Edited from original post to address some overlooked issues.
 
  • Like
Reactions: jshugart
Upvote 0
Does anyone have any experience with tasker, specifically in regards to making a talking clock to announce the hour. There are some profiles on tasker wiki, but the DL file won't download into tasker, says the URI cannot contain spaces...I attempted manual entry, but still cannot get it to work. I attempted another one I found on the site, that was fairly easy to enter, but cannot get it to talk in 12 hour format...

any ideas?

I import profiles by first saving them to the SD card under Tasker/profiles. Then from the main screen select menu/profiles/import single profile. That will show you a list of profiles from which to select one.
 
Upvote 0
This may help:

Variable Set %MYTIME %TIME
Variable Split %MYTIME "."
Variable Set %MYAMPM "a m"
Variable Set %MYAMPM "p m" If %MYTIME1 > 11
Variable Subtract %MYTIME1 12 If %MYTIME1 > 12
Variable Add %MYTIME1 12 If %MYTIME1 = 0
Variable Set %MYTIME1 %MYTIME1 [Do Maths] (should eliminate any leading zeros)
Variable Set %MYTIME2 %MYTIME2 [Do Maths] (should eliminate any leading zeros)
Variable Set %MYTIME2 "o %MYTIME2" If %MYTIME2 < 10
Say %MYTIME1 %MYTIME2 %MYAMPM

Tested at 18:09 it said "six oh nine pee em"

NOTE: Edited from original post to address some overlooked issues.

Much thanks UncleMike, this helped me.

I added the bolded task below to make it so 6:00 pm would be read as "Six O Clock P M"

Variable Set %MYTIME %TIME
Variable Split %MYTIME "."
Variable Set %MYAMPM "a m"
Variable Set %MYAMPM "p m" If %MYTIME1 > 11
Variable Subtract %MYTIME1 12 If %MYTIME1 > 12
Variable Add %MYTIME1 12 If %MYTIME1 = 0
Variable Set %MYTIME1 %MYTIME1 [Do Maths] (should eliminate any leading zeros)
Variable Set %MYTIME2 %MYTIME2 [Do Maths] (should eliminate any leading zeros)
Variable Set %MYTIME2 "O Clock" If %MYTIME2 = 0
Variable Set %MYTIME2 "o %MYTIME2" If %MYTIME2 < 10
Say %MYTIME1 %MYTIME2 %MYAMPM
 
Upvote 0
This may help:

Variable Set %MYTIME %TIME
Variable Split %MYTIME "."
Variable Set %MYAMPM "a m"
Variable Set %MYAMPM "p m" If %MYTIME1 > 11
Variable Subtract %MYTIME1 12 If %MYTIME1 > 12
Variable Add %MYTIME1 12 If %MYTIME1 = 0
Variable Set %MYTIME1 %MYTIME1 [Do Maths] (should eliminate any leading zeros)
Variable Set %MYTIME2 %MYTIME2 [Do Maths] (should eliminate any leading zeros)
Variable Set %MYTIME2 "o %MYTIME2" If %MYTIME2 < 10
Say %MYTIME1 %MYTIME2 %MYAMPM

Tested at 18:09 it said "six oh nine pee em"

NOTE: Edited from original post to address some overlooked issues.


I have a profile that does not use DO MATHS and has no problem with its leading zeros, except for when I split the time variable, and add 2 hours. When I join the variables I get single digit hours when the time is <10:00. I have succeeded in writing the whole thing using DO MATHS but would like to learn how to utilize different logic.

I've followed your logic on removing zeros but do you have one for creating leading zeros?
 
Upvote 0
I have a profile that does not use DO MATHS and has no problem with its leading zeros, except for when I split the time variable, and add 2 hours. When I join the variables I get single digit hours when the time is <10:00. I have succeeded in writing the whole thing using DO MATHS but would like to learn how to utilize different logic.

I've followed your logic on removing zeros but do you have one for creating leading zeros?

I'm not quite sure what you're asking, but the only reason I eliminated the leading zeros was to get a preferred pronunciation by the Say action - so instead of saying "six zero nine pee em" it would say "six oh nine pee em".
 
Upvote 0
I'm not quite sure what you're asking, but the only reason I eliminated the leading zeros was to get a preferred pronunciation by the Say action - so instead of saying "six zero nine pee em" it would say "six oh nine pee em".

Basically, I'm looking for a snippet that will pad a single digit variable with a leading zero. I just want to do the reverse of what you've done to eliminate a leading zero.
 
Upvote 0
Basically, I'm looking for a snippet that will pad a single digit variable with a leading zero. I just want to do the reverse of what you've done to eliminate a leading zero.

As long as the values are integers you could do something like this:

Variable Set %VAR %VAR [Do Maths]
Variable Set %VAR 0%VAR [If %VAR < 10]

This should make sure the leading zeros are eliminated, then add them back in where needed to get two digits.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones