[Android] Share your Tasker recipes

I set up a profile that turns on bluetooth, brightness, always-on, etc that I use when I dock in the car. When i undock it, bluetooth goes off, screen goes back to autobrightness, etc. Very simple, but very effective & useful! I found the default car dock to be inflexible, and Custom Car Home didn’t always handle the bluetooth correctly. Now I am covered :)

Here’s a request, Rajah, if its possible… Any way to always default to the front camera when turning on the camera app? I hate always having to jump into the menus to switch it.

Anyone know if there is a more elegant way to check if there is an active phone call rather than creating a variable based on the incoming call state?

I am really looking for a way to check if there is an active call before disconnecting bluetooth when I get out of my car, but I am currently only checking if there is an active incoming call.

I’m not sure, but I’ll check. Thing is, your camera pref is an internal setting for the camera app. I don’t think Tasker can control settings within specific apps.

There’s a Phone -> Phone Offhook Event. I think that might be what you’re looking for.

Well, as an event is momentary it isn’t exactly what I wanted.

Though if I use it to set a variable, and then clear it with Phone Idle then it seems to work. I am mildly concerned that things other than hanging up the phone can trigger Phone Idle but I guess we will see.

I’ve made a number of improvements to my “DND Profile” lately and re-wrote a lot of it so I figured I’d post the new recipes. Here’s a brief rundown of some of the new features:

[ul]
[li] Responds to texts as well as calls[/li][li] Only sends a message to each person once, no matter how many times they call/text[/li][li] Modified so that it’s easier to have different outgoing messages[/li][li] Added an orientation-based trigger for easy enabling[/li][/ul]

The changes required me to break out the script into multiple tasks and profiles, so I’ll start with the “responder” profiles and work my way backwards.

[code=reply to incoming calls]
event - phone ringing
1 If %DNDTOG =1
2 End Call
3 Send SMS (number %CNUM, Message below, Store In Messaging App, If %INC_RA !~ %CNAME)
4 Variable Set (%INC_RA to %CNAME, Append, If %INC_RA !~ %CNAME)
5 End If
[/quote]

In order to make sure each caller/texter only gets on response message, I have a variable called INC_RA, which is an array (get it?) of incoming callers. When a new call comes in, you check to see if %CNAME (the address book name of the caller) is already in the array. If it isn’t, then you send them the SMS and add their name to the array. If they are in the array, nothing happens.

The message has also been tweaked to make it easier to have different custom messages by way of two variables. My message is set up as thus: “Sorry I missed your call, but %DND_WHY and unable to pick up. I’ll call you back %DND_WHEN. Thanks.”

This bit is fairly easy to decipher. My trigger widget now has two new variables to set, which I use in the outgoing message. This way, I can have several trigger widgets on my desktop for various things (“I’m in a meeting” or “I’m asleep” etc)


So now that we have our responders set, it’s time to set up the task that will turn DND Mode on and off. This one isn’t very different from the original one, except for the addition of a line or two.

This is a basic toggle if/then. If the toggle is on, turn it off. If it’s off, turn it on. When turning it on, I set a Notify LED to let you know. I find this is better than the popup message I used to have, because so long as you don’t clear the notification, you’ll have a constant reminder that you’re in DND mode. And if you pull down the notification bar, you’ll have a reminder of what specific DND type you’re set to.

NOTE: The LED doesn’t work on all phones because some will only turn on the LED notify if the screen is off. I still keep it here for the few phones that allow LEDs on displays that are awake.


Now it’s time for the widget that’ll call the toggle. Go to your desktop and add a Task widget. Once you get to the screen, click “New” and name your task. This is important because the task name is how the widget will be labeled on your desktop. If you leave it blank, the widget will have a blank name.

The “One Time” checkbox lets you write the task without saving it to Tasker. On the plus side, this keeps your list of tasks relatively clean – handy if you plan on having a number of different widgets. The down side, however, is that once you save your task, there’s no way to come back later and edit it. The choice is yours to make. Me, I have them all as One Time tasks, since they’re pretty basic and I don’t wanna clutter up my task list.

And that’s it. All you’re really doing is setting your message variables and then calling the toggle task (by name, so make sure it’s the same as how you named your toggle task), which is why I don’t bother saving the task. Don’t forget to give it a descriptive icon, since you can’t change it after the fact.


Finally, my “Sleepytime” profile. I came up with this last night because it seemed a much more elegant solution than pressing a desktop widget. When I turn in for the night, I simply turn my EVO face-down and the profile triggers. When I wake up in the morning, I turn it face up and it turns off. This one actually has three trigger events, though, not just the orientation flip.

And that’s it! The reason for the three triggers is because I want to make sure this only turns on when I’m actually going to sleep. Since I always charge my phone as I sleep, having a “Power (Any)” event is a good safeguard. By having the Time event, I ensure that DND mode turns off at 9:00, thus preventing me from accidentally missing important calls in the morning. And the orientation event is there so that if I for some reason want to still receive calls, I can just leave my phone face-up. Otherwise it’d turn on any time I plugged in my phone between midnight and 9am.

The Notify Vibrate is a handy way to verify that DND mode has turned on. Since you can’t really check the LCD (since it’s face-down), it gives three quick buzzes to let you know it’s on. Meanwhile the Notify title is still there so when you pick up the phone in the morning, you can see it disappear (thus confirming that it’s off). Easy peasy.


So that’s that. A slightly involved profile, I suppose, but operatively simple. I might at a future date add a little task that pops up a message reading “You received calls/texts from %INC_RA while you were DND.” but it’s hardly critical, especially as the outgoing messages are saved in my SMS reader anyway, so I can always just check there.

I’ve made a number of improvements to my “DND Profile” lately and re-wrote a lot of it so I figured I’d post the new recipes. Here’s a brief rundown of some of the new features:

[ul]
[li] Responds to texts as well as calls[/li][li] Only sends a message to each person once, no matter how many times they call/text[/li][li] Modified so that it’s easier to have different outgoing messages[/li][li] Added an orientation-based trigger for easy enabling[/li][/ul]

The changes required me to break out the script into multiple tasks and profiles, so I’ll start with the “responder” profiles and work my way backwards.


[b]event - phone ringing[/b]

1 If %DNDTOG =1
2 End Call
3 Send SMS (number %CNUM, Message below, Store In Messaging App, If %INC_RA !~ *%CNAME*)
4 Variable Set (%INC_RA to %CNAME, Append, If %INC_RA !~ *%CNAME*)
5 End If


[b] event - received sms[/b]

1 If %DNDTOG =1
2 Send SMS (number %SMSRF, Message below, Store In Messaging App, If %INC_RA !~ *%SMSRN*)
3 Variable Set (%INC_RA to %SMSRN, Append, If %INC_RA !~ *%SMSRN*)
4 End If

In order to make sure each caller/texter only gets on response message, I have a variable called INC_RA, which is an array (get it?) of incoming callers. When a new call comes in, you check to see if %CNAME (the address book name of the caller) is already in the array. If it isn’t, then you send them the SMS and add their name to the array. If they are in the array, nothing happens.

The message has also been tweaked to make it easier to have different custom messages by way of two variables. My message is set up as thus: “Sorry I missed your call, but %DND_WHY and unable to pick up. I’ll call you back %DND_WHEN. Thanks.”

This bit is fairly easy to decipher. My trigger widget now has two new variables to set, which I use in the outgoing message. This way, I can have several trigger widgets on my desktop for various things (“I’m in a meeting” or “I’m asleep” etc)


So now that we have our responders set, it’s time to set up the task that will turn DND Mode on and off. This one isn’t very different from the original one, except for the addition of a line or two.


[b]dnd toggle[/b]

 1 If %DNDTOG = 0
 2 Notify LED (Title DND On, Text DND - %DND_WHY, Color & Icon whatever you want)
 3 Silent Mode (Vibrate)
 4 Variable Clear (%INC_RA)
 5 Variable Set (%DNDTOG to 1)
 6 Goto Action (10)
 7 End If
 8 Variable Set (%DNDTOG to 0)
 9 Notify Cancel
10 Silent Mode (Off)

This is a basic toggle if/then. If the toggle is on, turn it off. If it’s off, turn it on. When turning it on, I set a Notify LED to let you know. I find this is better than the popup message I used to have, because so long as you don’t clear the notification, you’ll have a constant reminder that you’re in DND mode. And if you pull down the notification bar, you’ll have a reminder of what specific DND type you’re set to.

NOTE: The LED doesn’t work on all phones because some will only turn on the LED notify if the screen is off. I still keep it here for the few phones that allow LEDs on displays that are awake.


Now it’s time for the widget that’ll call the toggle. Go to your desktop and add a Task widget. Once you get to the screen, click “New” and name your task. This is important because the task name is how the widget will be labeled on your desktop. If you leave it blank, the widget will have a blank name.

The “One Time” checkbox lets you write the task without saving it to Tasker. On the plus side, this keeps your list of tasks relatively clean – handy if you plan on having a number of different widgets. The down side, however, is that once you save your task, there’s no way to come back later and edit it. The choice is yours to make. Me, I have them all as One Time tasks, since they’re pretty basic and I don’t wanna clutter up my task list.


1 Variable Set (%DND_WHY to "I'm in a meeting")
2 Variable Set (%DND_WHEN to "as soon as I'm able")
3 Perform Task ("dnd toggle," Stop off)

And that’s it. All you’re really doing is setting your message variables and then calling the toggle task (by name, so make sure it’s the same as how you named your toggle task), which is why I don’t bother saving the task. Don’t forget to give it a descriptive icon, since you can’t change it after the fact.


Finally, my “Sleepytime” profile. I came up with this last night because it seemed a much more elegant solution than pressing a desktop widget. When I turn in for the night, I simply turn my EVO face-down and the profile triggers. When I wake up in the morning, I turn it face up and it turns off. This one actually has three trigger events, though, not just the orientation flip.


[b]time - from 00:00 to 09:00; power - any; orientation - face down[/b]

1 Notify Vibrate (Title DND On, Text DND - %DND_WHY, Pattern 250,250,250,250,250)
2 Silent Mode (Vibrate)
3 Variable Set (%DNDTOG to 1)
4 Variable Clear (%INC_RA)
5 Variable Set (%DND_WHY to "I'm asleep")
6 Variable Set (%DND_WHEN to "when I wake up")

Unlike the toggle widgets, though, there's no button to press to turn this off. Instead, we set an Exit Task

1 Notify Cancel
2 Variable Set (%DNDTOG to 0)
3 Silent Mode (Off)

And that’s it! The reason for the three triggers is because I want to make sure this only turns on when I’m actually going to sleep. Since I always charge my phone as I sleep, having a “Power (Any)” event is a good safeguard. By having the Time event, I ensure that DND mode turns off at 9:00, thus preventing me from accidentally missing important calls in the morning. And the orientation event is there so that if I for some reason want to still receive calls, I can just leave my phone face-up. Otherwise it’d turn on any time I plugged in my phone between midnight and 9am.

The Notify Vibrate is a handy way to verify that DND mode has turned on. Since you can’t really check the LCD (since it’s face-down), it gives three quick buzzes to let you know it’s on. Meanwhile the Notify title is still there so when you pick up the phone in the morning, you can see it disappear (thus confirming that it’s off). Easy peasy.


So that’s that. A slightly involved profile, I suppose, but operatively simple. I might at a future date add a little task that pops up a message reading “You received calls/texts from %INC_RA while you were DND.” but it’s hardly critical, especially as the outgoing messages are saved in my SMS reader anyway, so I can always just check there.

Still new to tasker and am amazed at all the things it can do!
I’m trying to figure out how to set up an alarm that goes off, say, 2 hours BEFORE a scheduled appt in my Google Calendar. Is this even possible?
Thanks in advance for any tips!

Interesting question. I don’t know if there’s an easy way to do it, but I’m sure you could do it in a roundabout fashion by auto-polling your calendar, say, once a day, and saving the appointment times to variables and then setting up new alarms for the times minus two hours or something like that.

Though I’m inclined to ask why you don’t just set a 2 hour reminder time when adding items to your calendar?

Incidentally, for those that might be curious about the JuiceDefender-esque Tasker recipe:

After some general sluggishness, I uninstalled JD and started using the JD-esque Tasker recipe. The other night I decided to leave my phone unplugged when I went to sleep. In eight hours or so, it went from 94% to 50%.

After two separate instances of my battery running out on me, I decided to give JD another chance (hoping the memory leak had been fixed). Last night I left the phone unplugged again as I slept. In eight hours, it went from 97% to 84%.

I think I’m gonna stick to JD for now. So far I haven’t seen the same sluggishness I had in the past. Here’s hoping it holds up.

VERY easy. Do a location based trigger based on the GPS. When you’re at your house, it turns off the cell radio and turns on wifi. Not sure how to automate when you leave your house, though. May need a widget for that.

Every profile can have an “Exit Task,” which is a task that runs when the profile trigger ends. In the case of a GPS-triggered event, that means that the exit task will kick in when you leave the defined GPS location. In other words, he could set up a task to launch when he enters the GPS home zone and then set up an exit task which will trigger as soon as he leaves it.

So I’m bored and wanna cook up some more recipes but I’m plumb out of ideas. As the other Android thread has been getting some activity lately, I figured I’d bump this for some of the new converts and see if they had any Tasker-related ideas/questions/etc.

If I plug my phone in, then it starts moving at over 5MPH, it assumes I’m driving and logs the start position. It keeps track of total time as well as time in motion. When the phone is unplugged, it then logs the last time it stopped moving. It creates a calendar entry showing the duration of the drive, as well as the final location. The comments include a Google map of the trip.

I also have it trigger alerts and calendar entries for incoming calls (simple).

I’m still working on the driving scripts. I’m starting to work on a weather icon.

What are you interested in?

I have nothing to add, except that Tasker got some love on Attack of the Show today. Made me proud.

Awesome stuff in this thread. I’m still new to Tasker, and I was wondering if someone could help out with a profile I want to create.

I live right on the edge of 3G/EDGE networks, so my phone is constantly jumping back and forth between the two, and if it happens while I’m using the Internet, I get a connection timeout. Since I have WiFi at home, I’ve already set up a profile that turns on WiFi and connects me to my network whenever it is in range. What I’d like to do now is have a profile to automatically switch to “2G only” either when 3G reception is bad or when I’m at home and in range of my WiFi network, switching back on exit of course. I know how to do the WiFi part (the WiFi Near state), but I can’t figure out how to set up the switch or how to tell it to recognize when reception is bad. Any ideas? I’m on the myTouch 4G, by the way.

rajah sulayman you seem pretty apt with Tasker.
What would be the possibilities of getting a thread started on actually training us newbies to Tasker in the proper use and ability of TASKER?

I am interested in a profile to control airplane mode so that if I am at work and the cell signal is bad for a certain amount of time that airplane mode turns on and at a preset time will turn off and check for so long for a goos cell signal and if found airplane mode stays off or if no good cell signal airplane mode goes back on. It will check again at the time preset.

good sig

go to work ( or other place)

bad sig ( for preset time 3 mins possibly)

airplane on ( 30 minutes possibly )

airplane off ( check signal again ( 3 mins again - needs to be settable)

Good signal -( airplane stays off til no signal again for 3 mins.)
or
Bad signal - ( checks for 3 min again then goes back to Airplane On for the 30 minute ( settable ) time period befor it turns back off and checks again

I actually looked into something similar a while back because I have spotty reception at my cube at work. At the time I couldn’t find any functions that actively monitored cell signal (since the app is geared more toward events and status checks as triggers, rather than consistent patterns), but I know he’s made a few changes since then so I can check again. I’ll let you know if I find anything.

Thank You for the response.
Anything that can be done to asist us in understanding the formatting of the profiles, contaxts and tasks would be greatly appreciated.

Just wish there was a step by step tutorial to understand Tasker more

There are actually a few guides on the Tasker website. That’s how I got started and then I just figured out the rest by way of the manual (which does a pretty good job of describing the commands). And don’t forget that inside Tasker itself, almost every window has an i icon that describes the commands and flags in the window.

Quick tour of Tasker
Sample Profiles
Walkthroughs and Guides

So glad to have found this thread, not enough interest in Tasker I fear due to the learning curve. I’ve got a recipe request for you, rajah sulayman, apologies if it’s too basic but I’ve just gotten the app (trial) and trying to figure out before purchasing if it can do this one thing which is my #1 desired feature.

I’d like a homescreen widget that can switch between 4 audio profiles [system sounds off for all, vibrate on for all notifications/ringer] - 1) ringer off, media volume 0% 2) ringer off, media volume ~30% 3) ringer ~50%, media volume ~30% 4) ringer ~80%, media volume ~70%. It’d be extra cool to have the widget icon or text change based on which setting was active. Think this is doable?