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

Problem using "If" in task

Hi,

I'm trying to make a profile that runs on week days, and in this profile I'm trying to create a task that Silences my phone when I enter my classes and that returns it to the normal state when I'm on lunch break or when I'm out. My problem comes when i try to make such task i difine the task to run for example when %TIME > 08.30 and %TIME < 12.00. When I'm in the tasks menu and it's 09:00AM it shows a green bar indicating that the condition is met, even so, the task doesn't activate. What am I doing wrong?
And before you sugest I make a profile based on time to do this, I'm trying to use a single task to adapt my hole schedule instead of flooding my profile windows with profiles of classes.
 
Add a time based condition to your profile, even if that means having to clone your profile for numerous time periods.
It will make everything simple and easy to maintain.
 
I drive mine from my schedule. If I have a meeting scheduled I silence the phone (most of it) unless there is the word "Sound" in the Description of the event.

You could do that and just have a repeating meetings.

... Thom
 
Add a time based condition to your profile, even if that means having to clone your profile for numerous time periods.
It will make everything simple and easy to maintain.

That is what i've had before, but i want to be able to activate tasks withou been dependent on the hour defined by the profile. My goal is to define a day and then be able to activate tasks based on the time of said day, and I want to do this wiithout have to flood the profiles menu with profiles that are meant to work for half an hour. I know that what I want to do must be possible otherwise the field if wouln't be there and there wouldn't be a variable time for me to use what I'm missing is how to make the task activate once the Condition is verified.

I drive mine from my schedule. If I have a meeting scheduled I silence the phone (most of it) unless there is the word "Sound" in the Description of the event.

You could do that and just have a repeating meetings.

... Thom

Thanks, I've used the calendar entry to activate silence mode in my classes. Now I would only like to know how to activate the task the way I described above.
 
I admit to being a little confused. You keep saying "activate the task".

In the one I suggested I use a Profile to monitor the calendar to do what you are asking about.

If the question is how to deal with time calculations in a task ... try this ...

Test
A1: If [ %TIME > 08.29 & %TIME < 12.01 ]
A2: Popup [ Title: Text:%TIME Background Image: Layout:tlaPopup096 Timeout (Seconds):5 Show Over Keyguard:On ]
A3: End If

Notice that it is greater than and less than and not greater than or equal to and less than or equal to.

The Profile to drive it from the Calendar is ...

Profile: tlaMeet
State: Calendar Entry [ Title:* Location:* Description:!Sound/sound Available:Any Calendar:Google:YOURS@gmail.com/Google:Phone Calendar ]
Enter: tlaSoundOff
A1: Alarm Volume [ Level:0 Display:Off Sound:Off ]
A2: DTMF Volume [ Level:0 Display:Off Sound:Off ]
A3: In-Call Volume [ Level:7 Display:Off Sound:Off ]
A4: Media Volume [ Level:15 Display:Off Sound:Off ]
A5: Notification Volume [ Level:0 Display:Off Sound:Off ]
A6: Ringer Volume [ Level:0 Display:Off Sound:Off ]
A7: System Volume [ Level:0 Display:Off Sound:Off ]
A8: Silent Mode [ Mode:On ]
Exit: tlaSoundOn
A1: Alarm Volume [ Level:7 Display:Off Sound:Off ]
A2: DTMF Volume [ Level:0 Display:Off Sound:Off ]
A3: In-Call Volume [ Level:7 Display:Off Sound:Off ]
A4: Media Volume [ Level:15 Display:Off Sound:Off ]
A5: Notification Volume [ Level:7 Display:Off Sound:Off ]
A6: Ringer Volume [ Level:7 Display:Off Sound:Off ]
A7: Silent Mode [ Mode:Off ]
A8: System Volume [ Level:7 Display:Off Sound:Off


... Thom
 
I admit to being a little confused. You keep saying "activate the task".

In the one I suggested I use a Profile to monitor the calendar to do what you are asking about.

If the question is how to deal with time calculations in a task ... try this ...

Test
A1: If [ %TIME > 08.29 & %TIME < 12.01 ]
A2: Popup [ Title: Text:%TIME Background Image: Layout:tlaPopup096 Timeout (Seconds):5 Show Over Keyguard:On ]
A3: End If

Notice that it is greater than and less than and not greater than or equal to and less than or equal to.

The Profile to drive it from the Calendar is ...

Profile: tlaMeet
State: Calendar Entry [ Title:* Location:* Description:!Sound/sound Available:Any Calendar:Google:YOURS@gmail.com/Google:Phone Calendar ]
Enter: tlaSoundOff
A1: Alarm Volume [ Level:0 Display:Off Sound:Off ]
A2: DTMF Volume [ Level:0 Display:Off Sound:Off ]
A3: In-Call Volume [ Level:7 Display:Off Sound:Off ]
A4: Media Volume [ Level:15 Display:Off Sound:Off ]
A5: Notification Volume [ Level:0 Display:Off Sound:Off ]
A6: Ringer Volume [ Level:0 Display:Off Sound:Off ]
A7: System Volume [ Level:0 Display:Off Sound:Off ]
A8: Silent Mode [ Mode:On ]
Exit: tlaSoundOn
A1: Alarm Volume [ Level:7 Display:Off Sound:Off ]
A2: DTMF Volume [ Level:0 Display:Off Sound:Off ]
A3: In-Call Volume [ Level:7 Display:Off Sound:Off ]
A4: Media Volume [ Level:15 Display:Off Sound:Off ]
A5: Notification Volume [ Level:7 Display:Off Sound:Off ]
A6: Ringer Volume [ Level:7 Display:Off Sound:Off ]
A7: Silent Mode [ Mode:Off ]
A8: System Volume [ Level:7 Display:Off Sound:Off


... Thom

Looking at what you shown me here I realize that it must be a problem with my device because if i do this

A1: If [ %TIME > 08.29 & %TIME < 12.01 ]
A2: Popup [ Title: Text:%TIME Background Image: Layout:tlaPopup096 Timeout (Seconds):5 Show Over Keyguard:On ]
A3: End If

with the actual time nothings pops out, unless i click on the play button on the bottom left corner, then the popwindow appears.
 
That's what a Task does ... you have to manually invoke it.

If you want it to be invoked some other way then you make it a Profile and define the task(s) to invoke when some condition(s) is met. The calendar driven Profile is an example.

To me your objective was to automate it multiple times in the day and the calendar-driven approach does exactly that.

What is the "trigger" to make your project start and what is the "trigger" to make it stop?

... Thom
 
That's what a Task does ... you have to manually invoke it.

If you want it to be invoked some other way then you make it a Profile and define the task(s) to invoke when some condition(s) is met. The calendar driven Profile is an example.

To me your objective was to automate it multiple times in the day and the calendar-driven approach does exactly that.

What is the "trigger" to make your project start and what is the "trigger" to make it stop?

... Thom

So lets take this example, I make a profile that runs based on time and lets say i make the time gap from 00:01 to 23:59. If i define the task:
A1: If [ %TIME > 16.48 & %TIME < 16.52 ]
A2: Popup [ Title: Text:%TIME Background Image: Layout:tlaPopup096 Timeout (Seconds):5 Show Over Keyguard:On ]
A3: End If
if it is 16:50 the task should run itself no?
 
The profile needs a "trigger" to make it start. All you have said is to allow it to start at any time.

A trigger would be something like "Orientation Face Down".

... Thom
 
The profile needs a "trigger" to make it start. All you have said is to allow it to start at any time.

A trigger would be something like "Orientation Face Down".

... Thom

The trigger for the profile in this case is if the time is between 00:01 to 23:59. When it's 16.50 the profile is active. So the popup should appear at 16:50. Isn't my logic correct? Or the profile only runs the tasks the second it's activated? I though while the profile is active it would check conditions on the tasks periodically
 
How about ...

Profile: AAAAAA
Time: From 00:00 every 2m Till 23:59
Exit: Anon
A1: If [ %TIME > 12.59 & %TIME < 23.59 ]
A2: Popup [ Title: Text:%TIME Background Image: Layout:tlaPopup096 Timeout (Seconds):1 Show Over Keyguard:On ]
A3: End If

... Thom
 
No, in this case, at 0:01, the profile will become active, which will trigger the task.

The task will check the time, see that 0:01 is not between 16:48 and 16:52 and end there.

It will only run once until next time it is reactivated again, which is the day after at 0:01...

The way you want to go, you want to be able to run the task every minute.
Use a time based profile but untick From and To and tick Every. Then you can set it to run every minute.

How many different time periods during the day are you going to have?

Thom's suggestion about using the calendar is a good one, which I use to set my phone to Vibrate for each of my work meetings.

One of the main reasons that it's a good method is that Tasker would work around events while your method will be draining the battery by running a task 1440 times a day.


Edit: I didn't see page 2... :)
 
Back
Top Bottom