> I want Tasker to fire off two tasks, one task ten hours before the calendar entry, and the other task two hours before the calendar entry.
Did you try a search of this group. This has been asked and answered several times and one user took the time to post a working task to get calendar events from the future.
> I want Tasker to fire off two tasks, one task ten hours before the calendar entry, and the other task two hours before the calendar entry.Did you try a search of this group.
> Thank you. That's very helpful, and gives me a useful starting point to learn sqlite.
>
There is also a more complex approach just using tasker actions on here as well.
> I think it's a common use case, "do something X {hour|day} before the calendar event". The solution posted requires root and to play with sql, so it's not a solution for noob users. I really hope the entries on the Pent's TODO list about the calendar events are removed as soon as possible.
You can do this with tasker only actions. It has been discussed before but I will admit i just searched around for it and did not find a simple workaround posted. There would be no reason even a noob user could not get it working, (perhaps with a little help from the forum)
You need to use the action' App /Test app / calendar : title or description. Then make a loop that will test your calendar for future events in the smallest time frame you would have for a event, like every 5 min.
> You can do this with tasker only actions.
Finally found the post I was thinking about. This one includes pents suggestion and a working task.
https://groups.google.com/forum/m/#!topic/tasker/3Nq0wxGxAuo
> For easier, use a plugin like auto-calendar.
Why are some of his apps so hard to find? It does not show on a search in play store and is not mentioned on his main site?? Where did you find it?
> AutoCalendar is an alpha app so at least at the moment it's not really usable and in my case doesn't work because it works only with google calendar.
Glad you could find it. I tried again and still could not get to it. I even got my secrete decoder ring and became a 'Alpha member' I must still need the super secret handshake... :)
I think that for a very basic and common task a built-in function is better.
>
>
I agree that a built in function would be a great addition.
It is always good to post any type of approach that works, for others looking for the same thing. I cant speak for Pent but he seems to shy away from making a built in feature whose exact same results can already be achieved by existing tasker actions. I am not sure of this but it would seem he would have to do the exact same thing behind the scene as we have to do in front of it.
What would be great information to be added here if it is possible to detect when any of your calendars have been modified. This would take the guess work out of the prosses. ..
> this is what i am also looking for, getting calendar events before they happen within tasker, not via the calendar notification to run tasks. the best possible link requires the phone to be rooted. another method i saw runs a check fine but i am at a loss on how to attach that to a time that is adaptive for next calendar event.
It would best to post all relevant exported task and profile descriptions.
The easiest way is to convert the start time of the event to 'epoch time' %TIMES . Then subtract the amount of seconds you want a task to run from that. Then you can use the 'variable time ' context to fire the app. Be aware you can set the time context with a epoch time however it only uses the "time" portion not the date.
There are several posts on how to use %TIMES in the time context.
To post your profile or task here... Long press on the profile or task name / ( 3 dot menu with 4.0+ ) export / export "DESCRIPTION" to clipboard (not XML)
Any linked tasks will be exported with the profile they are linked to..
To be able to export, The beginner mode needs to be off and the profile needs to be named by you (Not the Tasker listed name. Tasker will list your profile with the context name if you have not given it one).
I cannot figure out how to convert the milliseconds to strip only keeping the time and using it in 24h format so tasker can use it.
Just multiply (time in ms * 1000)= time in seconds
You can use (time in seconds) directly in the variable time context.
I meant divide of course.... :/
> Just multiply (time in ms / 1000)= time in seconds
I used %beginO to get the event so converted it to seconds then subtracted 15min and 60min (wasn't sure if I'm in central time and this is being displayed as eastern time) then selected the time to a create a time condition.
> Your advice has been great! The only issue in having is that I created a variable %NextCalEvent from the %beginO calendar milliseconds but for some reason that is not the 1st event that starts. It's more like the middle event. While the %beganArr is displaying properly.
It is a bit hard to follow the java code but it looks like the begin time of the first event should be in %beginArr(1). Why are you using %beginO. ?
Task: CheckShift
Properties -> Collision Handling: Abort Existing Task
Actions:
Variables -> Variable Clear [ Name: %GOTOSLEEP ]
Variable Clear [ Name: %WAKEUP ]
Task -> For [ Variable: %mins / Items: 0:1440:60 ]
Variables -> Variable Set [Name: %testtime / To: %TIMES+(%mins*60) ]
App -> Test App [ Type: Calendar Calendar / Data: %testtime / Store Result In: %calnames ]
Task -> If [ %calnames1 Is Set ]
For [ Variable: %index / Items 1:%calnames ]
If [ %calnames(%index) ~ Google:Work ] // change calendar name to suit requirements
Test App [ Type: Calendar Title / Data: %testtime / Store Result In: %caltitles ]
Variable Set [ Name: %annualleave / To: 1 / If: %caltitles(%index) ~ Annual leave ]
If [ %annualleave Is Set ]
...
Hard to say without complete export but it looks like this..
For [ Variable: %index / Items 1:%calnames ]
Should be this
For [ Variable: %index / Items 1:%calnames(#) ]