some troubles with Time context variables

31 views
Skip to first unread message

Andrea Ghensi

unread,
Dec 29, 2014, 6:02:13 PM12/29/14
to tas...@googlegroups.com
Hi,
I'm trying to make my own alarm clock with tasker.
I set up a task in which I can set via variable query the time I want to wake up, the duration of the pre alarm (something like gentle alarm, but with sunrise light and mpd from my linux box :P ), the sleep duration and how much time before going to bed I want a notify (by the way, I also have problem with this: the second and the fouth variable query popup are completely black, or better: they show up but when the keyboard kicks in the popup turns to black).
At the end of the task I calculate two times in seconds: the time when I want the notification to pop up and the time the "gentle alarm" has to start.
Since I live in GMT+1, I used set variable %notifytime to (%alarmtime1 - 1 - %sleeptime1 - %notifitobedtime1)*3600 - (%alarmtime2 - %sleeptime2 - %notifitobedtime2)*60 and set variable %prealarm to (%alarmtime1 - 1 - %gentletime1)*3600 - (%alarmtime2 - %gentletime2)*60 .
Obviously variables with 1 and 2 are split by variable split (I entered them in hh.mm format).
The result are, for example a %notifytime of -9000 (10:30PM) and a %prealarm of 19800 (6:30AM).
Then I used those variables to create time contexts to start the relative tasks. I also added a day context to use the alarm only on working day (notify from sunday to thursday, prealarm from monday to friday).
The problem? tasker seems to completely ignore the profiles. The manual says that variable based time contexts ignore the date part if the variable is in unix time/time to epoch, so I think I'm doing things as they should.
What am I doing wrong?

Thanks for the attention!

Andrea Ghensi

unread,
Dec 30, 2014, 1:53:10 AM12/30/14
to tas...@googlegroups.com

Of course %Notifytime andò ℅Prealarm are global variables!
Also, every10 minutes I run another task, and it happens to be at the same time of the prealarm and notify. Could this be a problem?


--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/CVYX45urVRg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.

Andrea Ghensi

unread,
Feb 22, 2015, 2:06:41 PM2/22/15
to tas...@googlegroups.com
Anyone? What am I missing here?
here's my specs: tasker 4.6u3m on slimkat 4.4.4 on motorola moto g 4g lte.
(BTW I solved the black popups problem using a 500msec delay between popups as suggested by Robert Ryan in another thread.)

Rich D

unread,
Feb 22, 2015, 2:48:05 PM2/22/15
to Tasker Google Groups Post
 
Since I live in GMT+1, I used set variable %notifytime to (%alarmtime1 - 1 - %sleeptime1 - %notifitobedtime1)*3600 - (%alarmtime2 - %sleeptime2 - %notifitobedtime2)*60 and set variable %prealarm to (%alarmtime1 - 1 - %gentletime1)*3600 - (%alarmtime2 - %gentletime2)*60 .
Obviously variables with 1 and 2 are split by variable split (I entered them in hh.mm format).


The result are, for example a %notifytime of -9000 (10:30PM) and a %prealarm of 19800 (6:30AM).
Then I used those variables to create time contexts to start the relative tasks.
 

 

​Did not really follow the above math. however if you are setting the time context to -9000 and 19800 this is not correct.​ it needs to be in epoch time not just seconds. so if was currently 8:00 am feb 21 2015 and you want to set a time for 3 hrs in the future it would be %TIMES+(3*3600)  this would yield the equivalent of 11:00am feb 21 2015 then the time context just ignores the feb 21 2015 part.and sets the time context to 11:00 am

use with caution...

in the above example if you add 25 hrs to the above example (%TIMES+(25*3600) the time context will be set for 9:00 am of the current day. NOT 25 hrs into the future so not 9:00 am tomorrow.

*** the Time context can not span midnight***   It works in a 24 hr cycle... 


​The easiest way ​tot a a

Rich D

unread,
Feb 22, 2015, 2:50:33 PM2/22/15
to Tasker Google Groups Post


The easiest way to set a alarm in the future is to use a calendar event.  

Reply all
Reply to author
Forward
0 new messages