Controlling all the EVO's LEDs (in Tasker) - EVO 4G Android Development

So, I found this thread http://forum.xda-developers.com/showthread.php?t=752377&highlight=wimax+led that discusses how to control the EVO's Wimax LED, and I've found another thread that explained how to use Tasker to trigger the Capacitive buttons (http://forum.xda-developers.com/showpost.php?p=8554277&postcount=12).
Using this information, I was able to set:
Missed text: Blinking turquoise
Missed Call: Solid Red
Missed Calendar Event: Solid Yellow
Which got me to thinking what else can I control this way? Here is the list of values I found for controlling all the EVO's LEDs (thanks to the posters of the above threads for the starting info):
First here are all the values that I was able to confirm.
Wimax LED
Current "brightness" modes it supports:
0 = OFF
1 = Two quick turquoise flashes
2 = One quick turquoise flash
3 = One slow turquoise flash
4 = One slow turquoise flash then one slow red flash
5 = One slow yellow flash
129 = Solid red on
130 = Solid turquoise on
131 = Solid yellow on
Location: /sys/class/leds/wimax/brightness
Amber LED
Current "brightness" modes it supports:
0 = OFF
1 = ON
Location: /sys/class/leds/amber/brightness
Current "Blink" modes it supports:
0 = Solid
1 = Fast Blink
Location: /sys/class/leds/amber/blink
Green LED
Current "brightness" modes it supports:
0 = OFF
1 = ON
Location: /sys/class/leds/green/brightness
Current "Blink" modes it supports:
0 = Solid
1 = Fast Blink
Location: /sys/class/leds/green/blink
(note you can have amber on with blinking green and vice-versa).
Flashlight
Current "brightness" modes it supports:
0 = OFF
1 = Top LED
2 = Bottom LED
3 = Both LEDs
125 = Low Power
126 = Mid Power 1
127 = Mid Power 2 (same as 3)
128 = High Power
129 = High Power Single Flash
Location: /sys/class/leds/flashlight/brightness
Screen
Current "brightness" modes it supports:
0 - 255 brightness levels
Location: /sys/class/leds/lcd-backlight/brightness
Capacitive Buttons
0 = OFF
1 = ON
Location: /sys/class/leds/button-backlight/brightness
If you have "Tasker" installed and have root access, install "Locale Execute Plugin" from the Market.
In Tasker, create your event, and select "Plugin" as the Task, then choose the "Execute" plugin.
Enter the following command in the textbox (substituting the value and device you want to trigger)
@! echo 255 > sys/devices/platform/leds-gpio/leds/button-backlight/brightness
Important: You must "Test" the task once or twice and wait for the Superuser permissions to trigger, otherwise the task will not execute. You will need to do this for each task you create using this plugin.
One thing to note, using the commands above trigger a single event. If the system triggers an event that uses the LED you are using (e.g. charging the device) it will override your setting. However, you can also override the system trigger (trigger after charger is plugged in).
Setting this up correctly in Tasker, will allow you to do cool things like automatically turning off all LEDs when you start a Video, set your own alerts or trigger the flash if someone picks up your phone (to scare them), etc.
Feel free to add your own suggestions, or add anything I missed.

wow nice post!

Great job at defining the controls.
I found this post useful to me in turning on and off the button leds with one tap. - lol ( self promotion - since they are related )
http://forum.xda-developers.com/showthread.php?t=816128

Very nice and informative work, but for $16+ (Tasker $6.26, Locale $9.99 (required for the plug-in, according to info in the Market)) I guess I'll stand over this one.

arcadia2uk said:
Very nice and informative work, but for $16+ (Tasker $6.26, Locale $9.99 (required for the plug-in)) I guess I'll stand over this one.
Click to expand...
Click to collapse
You do not need to buy Locale to run these commands. You only need the Locale Execute Plugin, which is free in the Market. Most, but not all, Locale plugins are compatible with Tasker.
Also, you can download a beta copy of Tasker to try out for free. Go to this address and download the Market version:
http://tasker.dinglisch.net/beta
I believe you can use it for 7 days before it asks for the order validation.
Oh and great post.
Sent from my PC36100 using XDA

and if you buy Tasker from the developer's site directly, you save a little more.
Tasker is incredible. Pent (the developer) built a similar app for the old Palm OS that I couldn't live without.
If you take the time to really learn how to use it, it becomes indispensable. Unfortunately, I have not really had that time yet, so I've just been dabbling.
Combing it with the "execute" plugin, gives you some amazing power.

arcadia2uk said:
Very nice and informative work, but for $16+ (Tasker $6.26, Locale $9.99 (required for the plug-in)) I guess I'll stand over this one.
Click to expand...
Click to collapse
the locale plug-in is free and tasker can use it.. thus you dont need locale.. tasker is amazing..
when i test the blinking ones, they dont seem to stop blinking... seriously, there is not an exit task for received text message and the wimax led wont stop blinking

you have to send another trigger set to 0.
What I did at first was had the screen on trigger reset the LED, but I noticed a slight delay on my device.
Instead I set the new trigger to a "New Window" Now, anything I tap on the device will disable the LED. It's been working great.
FYI - for the Flash trigger I mentioned, I set the screen brightness to a change from 0-4 and if I place my phone face down on my desk - then if anyone picks it up it will trigger the flash. Now all I need is a camera sound file .

is this right? because i can't get the amber light to stay on and the green light to flash..
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

I get an FC if I try two commands in the same window. Just create two Execute Tasks.
Also, keep in mind that the system uses the left LED
flashing green - notification alert
flashing red - overheat
So, you may lose control of these if something else comes up.

sw99 said:
I get an FC if I try two commands in the same window. Just create to Execute Tasks.
Also, keep in mind that the system uses the left LED
flashing green - notification alert
flashing red - overheat
So, you may lose control of these if something else comes up.
Click to expand...
Click to collapse
I also get a fc..
i tried to set the event "missed call" to make the wimax led stay red, but the left led would just flash green, not sure what i did wrong
Here are my steps..
create new profile and select "missed call" as event
set priority to highest and long press and select any caller
add task, select plugin, select execute and write this in the text box
hit test til i see allow super user, hit allow, hit test till the led comes on (red), hit ok
create another profile to reset the led to off.. select event, system (or ui; dont remember), new window
add task, select plugin, select execute, and write this in the text box
hit test til i hit allow for superuser, then hit test till the led goes off, press ok, then hit done
these are the two profiles..
now I call myself from another phone, let it ring and only the left led flashes green, once i have missed the call..

sw99 said:
Important: You must "Test" the task once or twice and wait for the Superuser permissions to trigger, otherwise the task will not execute. You will need to do this for each task you create using this plugin.
One thing to note, using the commands above trigger a single event. If the system triggers an event that uses the LED you are using (e.g. charging the device) it will override your setting. However, you can also override the system trigger (trigger after charger is plugged in).
Setting this up correctly in Tasker, will allow you to do cool things like automatically turning off all LEDs when you start a Video, set your own alerts or trigger the flash if someone picks up your phone (to scare them), etc.
Feel free to add your own suggestions, or add anything I missed.
Click to expand...
Click to collapse
Anyway you may be able to post your profile settings so one can see how you setup Tasker to work as you did? I'm having some trouble on figuring out what events to trigger the button to flash and what to trigger to turn off the flashing. Thanks man Great work btw though!

Igzekyativ said:
I also get a fc..
i tried to set the event "missed call" to make the wimax led stay red, but the left led would just flash green, not sure what i did wrong
now I call myself from another phone, let it ring and only the left led flashes green, once i have missed the call..
Click to expand...
Click to collapse
I believe you have to set it to State- Missed Call, not Event- Missed Call. It's confusing, but Tasker treats Events and States differently. Events are single points in time, whereas States are ongoing (so you can have exit tasks). Here's my Profile, just import it and it should work.

Wow this is awesome! Great post, now my day will consist of messing with the phone!!!

Mine works fine as an event, but I couldn't get it to work as a state - the notification bar showed the state, but nothing triggered.
In any case, here are my profiles for messages, calls and calendar events.
Also, I left the "Caller" field empty and left priority at Normal.

antiphon said:
I believe you have to set it to State- Missed Call, not Event- Missed Call. It's confusing, but Tasker treats Events and States differently. Events are single points in time, whereas States are ongoing (so you can have exit tasks). Here's my Profile, just import it and it should work.
Click to expand...
Click to collapse
Where on the SD do you put the .xml to import it... I hit import a profile and I get a box that says "File Select" with a cancel button, but nowhere/way to select a file..

/tasker/profiles

sw99 said:
/tasker/profiles
Click to expand...
Click to collapse
thank you.

I'm having a hell of a time getting the capacitive leds to flash with a new sms... would one of you tasker pro's create a profile to flash the capactive leds when I have a new text?
That would be very cool of you.
Thanks.

they don't flash. you can only turn them on and off. I would not suggest trying to flash them using a loop in tasker - using software to flash the lights rather than hardware will be a much larger battery drain
Also, I don't know about you, but I cannot tell if they are lit unless I am in a fairly dark area.

Related

[APP] Tasker: Share your setup

Read about what Tasker is here or at the Lifehacker article. Download on Android Market or direct purchase from dev.
I'm pretty sure the possibilities are endless with this app, so please share what you've done with it here. Here's one of mine (more will follow):
Car Mode
This setup will use a toggle widget to:
Turn off Wi-Fi
Turn on GPS
Send an SMS that is triggered off a missed call event that lets the caller know you're in the car and can't talk
You can easily launch an app (for instance Navigation), I just haven't shown that here
Step #1 Create a new task called "ToggleTask" that looks like this (this is the task the Widget you create will call):
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Step #2 Create a new task called "Driving" that looks like this:
Step #3 Create a new task called "Stop Driving" that looks like this:
Step #4 Create a new task called "CarSMS" that looks like this:
Step #5 Create 3 profiles like the bottom 3 seen here:
Final Step Add the widget to your home screen, select "ToggleTask" and click "Add Widget". Note: initially the Widget label will say ToggleTask. If this bothers use rename ToggleTask to StartDriving everywhere it occurs
Now, when you get in the car, click the widget. When you get to your destination, click it again.
To launch an app, simply edit the "Driving" task to do so.
i was not even aware of this app, it looks AWESOME! I'm very interested in seeing how other people are using this application
using this would it be possible to create a shortcut directly to the alarm settings? I still haven't figured out how to do that on froyo since the option dissappeared in bettercut.
AMAZING!
Just downloaded.
bender2115 said:
using this would it be possible to create a shortcut directly to the alarm settings? I still haven't figured out how to do that on froyo since the option dissappeared in bettercut.
Click to expand...
Click to collapse
I'm not seeing that, but if I understand your question, you can add the Analog Clock widget to the screen and clicking that will take you into the alarm settings
thanks, but I don't really want a widget, I just want a shortcut.
Looks like timerrific and locale had a baby that kicked its parents ass.
saw something about this earlier on twitter a few days back while i was at work, this thread made me actually try it. just need to play around with it more when its not 5am. only thing i dislike thus far is the app handles media itself instead of passing the "play" and such on to the default music app. need to figure out how to get "play" and "stop" to pass to the music app from the "data" field and i'll be happy
I can't seem to get the SMS functionality to work. Everything works perfectly in the OP's example except send SMS. I'm wondering if there is something in settings that needs tweeked?
psylink said:
saw something about this earlier on twitter a few days back while i was at work, this thread made me actually try it. just need to play around with it more when its not 5am. only thing i dislike thus far is the app handles media itself instead of passing the "play" and such on to the default music app. need to figure out how to get "play" and "stop" to pass to the music app from the "data" field and i'll be happy
Click to expand...
Click to collapse
Have you tried using Media->Android media->Toggle Pause?
I imagine you could use Headphone Plugged:App->Music,Toggle Pause to ensure it worked every time. Or you could assign a variable if you wanted it to be more sophisticated. Here's a quick example:
Not Music=Variable Set %MUSIC, 0
Headset Plugged=Load App:Music(If Music = 0)
Headset Plugged=Go Home(If Music = 0)
Headset Plugged=Variable Set %MUSIC, 1
Headset Plugged EXIT=Android Media Pause
Variable Set %MUSIC, 1=Android Media Toggle
Works like a charm on my droid.
ya, so my alarm now says "wake the frack up you lazy bastard" on work days if i sleep past a certain time. 15min before i *have* to be out the door, phone says "isnt it time to leave for work" then turns gps on. when i leave and plug in the heaphone jack music starts (stops when unplugged), turns wifi off when 30M from home, arrive at work stops music, turns phone on silent. gps turns off until i leave work, and then it sends a SMS to my gf i'm on the way home when so far from work. dev will be getting some monies on my payday
now i wont have to play with the phone so much while driving
thanks for the toggle pause, didnt even notice all that last night and that did the trick
I've been using Tasker since the early betas for months now.
The three things that I always run:
WORK (Location 1km around Work)
- Turn Wifi Off
SLEEP (Hours 22:00-07:00)
- Turn AutoSync Off (this stops emails, but allows calls and SMS during the night)
LOW BATTERY (Battery 0-20%)
- Turn off AutoBrightness
- Set Brightness to 10%
- Set Screen Timeout to 30s
- Turn AutoSync Off
artesea said:
I've been using Tasker since the early betas for months now.
The three things that I always run:
WORK (Location 1km around Work)
- Turn Wifi Off
SLEEP (Hours 22:00-07:00)
- Turn AutoSync Off (this stops emails, but allows calls and SMS during the night)
LOW BATTERY (Battery 0-20%)
- Turn off AutoBrightness
- Set Brightness to 10%
- Set Screen Timeout to 30s
- Turn AutoSync Off
Click to expand...
Click to collapse
Hey I was wondering if you could let me know how you setup your variables. i'm not understanding how to do this. I was trying to setup sleep profile to turn off auto sync and i don't know what to put for variables %Time-?????????
Previously with Timeriffic (which is fantastic, btw) if I wanted a night profile, I had to guess about what times I would be going to bed. Since I use the desktop dock, Tasker allows me to setup a new event based upon docking my phone, so I've been using this for the "Docked" event:
Enter Task (go to bed):
Turn Wifi Off
Lower Ring volume
Lower Notification volume
Turn off vibrate
Exit Task (when I wake up and pull the phone off the dock:
Load App: Weather Bug Elite (to check the forecast)
artesea said:
LOW BATTERY (Battery 0-20%)
- Turn off AutoBrightness
- Set Brightness to 10%
- Set Screen Timeout to 30s
- Turn AutoSync Off
Click to expand...
Click to collapse
I think I'm gonna implement this one too..
mrmarshall428 said:
Hey I was wondering if you could let me know how you setup your variables. i'm not understanding how to do this. I was trying to setup sleep profile to turn off auto sync and i don't know what to put for variables %Time-?????????
Click to expand...
Click to collapse
Tasker can be tricky to get used to, but once mastered has amazing power.
To create my Sleep profile here are the step:
Press New, you will get a "First Context" popup, select "Time".
Here you should have From and To ticked. Make sure that From is when you want Sync Off (22:00) and To when it comes back on (07:00). Press Done.
This will now take you to a Task Edit screen.
You don't need to press New, but doing so allows you to name this bit.
Press the "+" button, in the "Select Action Category" select Net, and then Auto-Sync.
Here leave it as "Set: Off" and press Done
Press the Done button along the bottom.
You will now be back in the main Tasker screen. If you want to rename "From 22:00 to 07:00" tap on it, and select Name and give it something like "Sleep".
Press Apply and you are ready to go.
xManMythLegend said:
Looks like timerrific and locale had a baby that kicked its parents ass.
Click to expand...
Click to collapse
Tasker says to Momma Timmerific and Daddy Locale: "who's your daddy now BIOTCH??!!"
The_Adjudicator said:
I can't seem to get the SMS functionality to work. Everything works perfectly in the OP's example except send SMS. I'm wondering if there is something in settings that needs tweeked?
Click to expand...
Click to collapse
Here's what I did, this might help you.
Let's create a task that send a SMS to the number "466453", which is GOOGLE 411. I have this set daily to check the weather for me.
From your Tasker home screen, create New.
Select First Context : Time.
Select your From time. Make sure it has a checkmark, and un-check To. Click Done.
I have mine set for 10:00am.
Press the + icon (bottom left corner).
Select Action Category : Phone.
Select Phone Action : Send SMS.
Fill in the contact number (466453) and the message (weather xxxxx), where xxxxx is your local zipcode.
Tap Done.
Tap Done again.
----- ----- ----- ----- -----
You can test it by changing the Time to a few minutes ahead. Then edit it after you confirm it works.
I have several of these. One for the weather that repeats every 6 hours, another to check my bank balances, and one that texts my wife, "I Love You"
crachel said:
Enter Task (go to bed):
Turn Wifi Off
Lower Ring volume
Lower Notification volume
Turn off vibrate
Exit Task (when I wake up and pull the phone off the dock:
Load App: Weather Bug Elite (to check the forecast)
Click to expand...
Click to collapse
Would both of these "Enter" and "exit" be as one task??
I see tasks created.....what i'm wondering is.
Do we create a task to revert the phone to a previous state??
Mikey1022 said:
I see tasks created.....what i'm wondering is.
Do we create a task to revert the phone to a previous state??
Click to expand...
Click to collapse
No, Tasker will automatically revert back. For instance, when I lower phone & notification volume and disable vibrate on a phone "Docked" event, Tasker automatically reverts back when I un-dock the phone. I don't have to tell it to put the volume back up and turn on vibrate.
When you click a task in the Profile view, you will get an option to "Add Exit Task", that would be used for doing something unique all together (like launching an app).. you don't have to use it to revert state
Edit:http://tasker.dinglisch.net/userguide/userguide_settings.html
I'm using it to enable wifi on places where I know there's wifi and some power management stuff.. the usual.
There is one task I'm working on that's kinda awesome, but I can't get it to function properly. When I wake up, Tasker polls weatheronline.com for the current weather and the forecast for the day, and reads it out to me. The trouble is in the fact that I can't get it to read me the conditions for the day, it reads me the url for the conditions icon instead.
Attached is the xml of the task, maybe somebody smarter can get it to work?
(note: You'll have to register at worldweatheronline.com for a free key and paste it in the HTTP get action)

[TUT] The Ultimate Noob/Beginners Guide to Tasker

My motivation for writing this thread is seeing the sometimes negative feedback on the Market about Tasker and the lack of simple beginner documentation to get users up and running.
I’m a massive fan of the application as you may already know, but once I too was thrown in the deep end as a noob, being pointed only to the technical documentation and the rather lacking and out-of-date step-throughs on the Tasker Wiki. There was too much head-scratching involved and it’s unsurprising that some users will give up before they’ve even started.
The dev of Tasker will hold his hands up to this, but he also has a very, very large list of things to do, that more seasoned Tasker users would like him to focus on, rather than spending his time writing a much needed how-to-guide
So, over the coming months I will gradually add to this thread with basic and useful profiles and explain them in as much detail as I possibly can in the hope that you will pick up on Tasker tips and tricks, which then may give you a step in the right direction to using this application to its full potential.
If you are already a regular Tasker user, please do get involved and volunteer to share and explain a profile that will help the beginners; as you once were. Collectively, it won’t take us long to demonstrate the basic building blocks that all profiles are built from. Your Tasker community needs you!
Let’s get started then!
New to Tasker? Download a free trial here
-----------------------------------------------------------------------
-----------------------------------------------------------------------
Index
The Concept of Building a Tasker Profile - by strictlyrude27
Finding Your Way Around Tasker by neo1691
Using Tasker for your SMS Notification Management by brandall
Creating Useful Variables | SPLITS | SETS | FLASH | LISTS | CLEARING & MORE! by brandall
Using Tasker with the Minimalistic Text Plugin by brandall
Variable Split Demonstration by strictlyrude27
Your First Speaking Clock by Sokudoningyou
Using Tasker for Media Control by Deejaylobo
Basic Linux/Shell Commands to Create a Technical Battery Widget by brandall
Advanced Flow Control and IF concepts by strictlyrude27
BIG thanks to all those that have contributed so far. Please don't forget to use the thanks meter on their individual posts, it'll keep more helpful tutorials coming
Using Tasker for your SMS Notification Management
What you will learn
Basic pattern matching
IF actions
Profile Aim
Play individual notification sounds for chosen contacts.
Simple Preparation
The included icons in Tasker are pretty basic. Head to this link on the Wiki and download the ones of your choice, unzipping them into the folder sdcard/Tasker/.icn. The BlueOrbHD are my personal favourite…
Make sure you have your notification sounds saved in a folder sdcard/Notifications. If you are short of notification sounds, check out this link for a download. Place them in the notifications folder on the sdcard.
Profile and Task Explanation
As we are going to get Tasker handle our notification sounds, we need to disable them being handled by Android. From the home screen, select menu/settings/Sound/Notification ringtone and select ‘Silent’. If you didn’t do this, the standard notification sound would play as well as the tone we are to set up in Tasker.
In Tasker, select ‘New’ and then ‘Event’. Under ‘UI’ will be the option of ‘Notification’, select that. Leave the ‘Priority’ as normal and do not select an ‘Owner Application’. Under the ‘Title’ field, type ‘*Voicemail*’ and select done. You may then get a pop-up requesting that Tasker be given permission for ‘Accessibility’ – tick the box as we want to give Tasker permission to do everything automatically!
To clarify, we need Tasker to recognise that a new voicemail has been received and play a notification sound. There is currently no specific option for ‘Voicemail Received’ built-in to Tasker, so we are simply going to look for the word ‘Voicemail’ appearing in the notification bar and the profile will be triggered from there. The ‘*’ you put at the beginning and end is a ‘wild-card’ function, so that if for example the notification reads ‘You have a new Voicemail to listen to’ the text before and after the word ‘Voicemail’ will not prevent the context from triggering. Without the ‘*’ ONLY the word ‘Voicemail’ on its own will trigger the profile.
Once you’ve selected done, you will be prompted to select an existing Task from the list or select ‘New Task’ from the top. Select ‘New Task’ and name it ‘VoicemailSound’. Once inside the task, click on the icon button and select a suitable one, then click on the + button, select ‘Tasker’ and then ‘Stop’ and then ‘Done’. Click ‘Done’ again inside the Task and then click ‘Apply’ in the main Tasker screen which will close Tasker.
Q) Why did you just exit out of Tasker?
A) All too often you can make a mistake when creating a profile/task or something can happen that doesn’t apply the changes you’ve made. Applying out of Tasker in this way will ensure that no matter what happens, your created context, task name and icon are saved. You only have to accidently hit ‘cancel’ out of a task that you’ve spent 30 minutes creating to see that NOTHING remains of it, including the triggering context! It's good practice to this as standard every time!
Load up Tasker again and select the ‘Tasks’ button. From the list select the previously created ‘VoicemailSound’. Click on the + and select ‘Media’. Select ‘Music Play’ and hit the magnifying glass. Navigate to the ‘Notifications folder’ you have (or have created in your preparation) and select the tone you want. Ignore ‘Start’, ‘Loop’ and ‘IF’ and select ‘Done’.
Back in the Task screen, you’ll have a ‘Stop’ action and then the ‘Music Play’ action. If you left the task like this, it would simply stop! So, click and hold on ‘Music Play’ and once it’s given a short vibrate, drag it above ‘Stop’ so it’s in position 1. Click on ‘Done’.
There you have it! Tasker will now play your selected notification sound when you have a new voicemail!
Q) But hold on… (<-- I’ve decided that is going to be my tagline), what happens if I’ve set my device to silent? Will it still play the sound?
A) YES. Tasker is God on your device and will ignore and override almost all inbuilt settings due to the permissions you give it.
So, we need to deal with that.
From the main Tasker screen, click on ‘Tasks’ and select ‘New Task’. Name it ‘TEST TEST TEST’, add in the ‘Stop’ action and give it an icon as detailed above and save all the way out of Tasker to make sure it is always there.
Go back in, select the task and click +, select ‘’Alert’ and ‘Flash’. In the ‘Text’ field, type %SILENT (it must be in capitals) and select ‘Done’. Drag it above the ‘Stop’ action and press the ‘Test’ button to run the task. A pop-up will appear on the screen saying either ‘off’, ‘on’ or ‘vibrate’. If you want, you can change your device to vibrate and confirm the inbuilt variable %SILENT registers the change by pressing ‘Test’ once again.
Exit out of TEST TEST TEST (you’ll be using that task again a lot when creating your own profiles!) and head back into VoicemailSound. Click and hold on the ‘Stop’ action in position number 2 and drag it back up to position 1. Click on it so it opens and tick the ‘IF’ check box. When an IF statement is present in any action, this action will ONLY run if the IF statement is ‘true’. IF it isn’t true, Tasker will ignore the action and continue on to the next one.
Click on the label icon which will bring up a list of Tasker’s inbuilt variables (and any you have already created that are presently populated) and scroll down to click on ‘Silent Mode’. %SILENT will be populated in the first box. Next to it, click on the ‘~’ icon. This is the ‘condition’ of which you are comparing to %SILENT. As we are looking for the text of ‘on’, we need to select ‘Matches’ and then manually type ‘on’ (in lower case!) in the end box. Select done and you’ll be returned to the task screen showing that the ‘Stop’ action now has an IF action showing in it.
To recap, as the task currently stands, it will start on the context of a notification appearing in the notification bar with the word ‘Voicemail’ somewhere in it. It will then trigger the task VoicemailSound which will first check to see if the device is in silent mode. IF it is, it will simply stop. IF it isn’t, it will carry on to action number 2 and play the notification sound! Sorted!
Q) But hold on… What if the device is set to vibrate only? Will it still play the sound?
A) A good question! YES, it will… We need to deal with that next.
You probably wish to have a vibrate alert when you receive a voicemail anyway, so let’s assume you do for now and continue. Go back into VoicemailSound and click on +, select ‘Alert’ and ‘Vibrate Pattern’. Click on the question mark at the top and read the notes about this action, which will explain how it works with a wait time and a vibrate time in milliseconds so you can personalise it to your hearts content. To keep it simple for now, enter ‘200,200,200,200’ in the ‘Pattern’ field, which will equate to two short vibrates with a small pause between them.
Select ‘Done’ and back in the task you will now have Stop, Music play and Vibrate pattern in that order. Let us ponder for a moment. First we need to make sure that the device is not on silent. That is done in action 1 and it will stop IF it is – sorted. Next we need to make sure that the device isn’t only set to vibrate, BUT, whether it is or not, the ‘Vibrate Pattern’ we’ve just created is good to go! So, drag it to position number 2! All we have left to do now is STOP the ‘Music Play’ action IF the phone is in vibrate only mode… Did the bold clues help you!? I hope so… There are actually a number of ways we could do this. We could tick the IF statement in the ‘Music Play’ action and set it so %SILENT ‘does not Match’ ‘vibrate’, but let’s keep it simple and just add another ‘Stop’ action before music play, with the IF statement ticked and %SILENT ‘matches’ ‘vibrate’ (in lower case). Did you add that in ok and drag it to the right position? Good.. (Sorry if I sound patronising, just trying to leave no stone unturned).
Ok, so there you have it, Tasker is going to consider if the phone is set to silent before it vibrates and consider if it’s set to only vibrate before it plays the notification sound. For good measure, I always add in another ‘Stop’ action at the end of every task I create. Sometimes you’ll have testing actions such as ‘variable flash’ below this stop that you can drag up (to use) and back down (below the stop) when you need to.
Let’s hurry on to the personalised SMS sounds!
In the main Tasker screen, select ‘New’ and then ‘Event’. Under ‘Phone’ will be the option of ‘Received Text’, select that.
Under ‘Type’ leave it as ‘Any’ so it includes SMS and MMS. Click the magnifying glass next to the ‘Sender’ field and select ‘A Single Contact’. Scroll down, select the mobile number of the contact you wish to have a personalised notification for.
But hold on…. Before you select ‘Done’ to continue, click on the magnifying glass again and select another contact. After you have selected it, you’ll notice that the two contact names are now listed and separated by a ‘/’ with no spaces. This is your first introduction to pattern matching and lets Tasker know that the profile should be activated by the receipt of a text from either of these contacts. Once we’ve done the basics of this profile, you’ll need to go back and add in every contact you want to have a personalised tone for.
After you’ve clicked ‘Done’, select ‘New Task’ and name it ‘TXT-Custom’. As suggested above, select a suitable icon, add in the quick stop action and save out before returning to the task again.
Learning from the voicemail task above, we know that we need to consider the states of vibrate and silent, so add those in first. A ‘Stop’ in action #1 IF %SILENT matches on and a universal vibrate pattern in postion #2. Action #3 will be another stop action IF %SILENT matches vibrate and now it’s time to start creating our individual SMS sounds. Click on + and select Music Play. Using the magnifying glass, select the SMS tone you want for a certain contact. Check the IF button and click on the label icon. Scroll down the variables until you see ‘Text From’. Clicking on it, you’ll see that the first box is now populated with the inbuilt variable %SMSRN (which stands for SMS received name). Select matches and then manually type in the name of the contact you wish this tone to apply to. You of course have to make sure it exactly matches the format it appeared in when you originally selected the contact using the magnifying glass in the triggering context. Select ‘Done’. Repeat this process (creating a new action every time) for each individual contact you wish to have a personalised SMS sound for. It would be a good idea to save out of the task and out of Tasker every few minutes to ensure that if you do accidently press ‘cancel’ or your phone freezes, your hard work won’t be lost!
Make sure that every personalised entry you create, the contact name appears in the original triggering profile separated by a ‘/’. Sorted!
Q) But hold on… What happens if I get a text from a contact that isn’t listed? Android has been told to be silent, so will no sound play at all for them?
A) YES! Well spotted, we need another profile to account for receiving a text from anyone not in the personalised list.
Create another new profile with a context of a new text message received (new/event/phone/received text). This time, leave all the fields blank and click done. Select a new task and name it SMS-Default giving it an icon and a stop action for good practice. Return back into the task and add in the actions as you’ve done before.
#1) Stop IF %SILENT matches on
#2) Vibrate pattern
#3) Stop IF %SILENT matches vibrate
#4) Music Play (which will be your standard notification for all normal text messages).
Sorted!
Q) But hold on… What’s to stop that notification sound playing if I get a text message from a contact that has a custom sound? Will Tasker not try and play both?
A) YES! Good thinking… We need to set up an ‘exclude list’!
The quickest way to do this is to wait until you’ve finished your custom notification task. Once that’s complete, the context will have all of the contacts listed and separated by a ‘/’ (in the triggering profile). Click on the field and copy the contents to use in a moment.
In the custom SMS task, we’ve already set a vibrate pattern and a custom tone, so we therefore need to STOP Tasker from doing either of these in the default task. Simply add in another STOP task in action #2 (so it’s before vibrate) and tick the IF checkbox. Using the variable %SMSRN matches, paste in the ‘/’ separated names of the contacts and select done!
And now you really are done… Tasker is intelligently managing your personalised SMS notifications, always considering your system sound settings.
Extras
Q) But hold on… I always want to have a vibrate and notification sound if my wife texts. It might be something important…
A) That’s not a problem.
Assuming you’ve set up a custom notification for her in the task TXT-Custom, you can simply drag her individual Music Play action to position #1, so the phone’s state of silent or vibrate won’t be considered. If you want the device to vibrate too, simply add another vibrate pattern action to position #1 or #2 (as long as it’s above the first stop action) and make sure it has an IF statement so it will only vibrate IF %SMSRN matches your wife’s contact.
I hope that helped folks!? If it did, the thanks meter is the only way I'll know!
Creating Useful Variables | SPLITS | SETS | FLASH | LISTS | CLEARING & MORE!
What you will learn
Variable Splits
Variable Sets
Variable List
Variable Clear (Good housekeeping)
Flash Variables
Writing to a text file
Exit Tasks
The Meaning of Life
Overview
When creating your own profiles and tasks, there will be conditions that you will use over and over again. Checking that the device isn’t on silent before playing any notifications would be a good example. Another may be location based, such that you want your device automatically on silent IF you are at work.
Profile Aim
I will walk you through how to set up your own most commonly used variables so you can see how they are created and ways in which you can use them.
Simple Preparation
Make yourself a cup of tea.
Profile and Task Explanation
Let’s start out with a very basic context of ‘being on the phone’. This will prove useful to you in many future profiles such as ones that toggle your data connection. For example, if you have a battery saving profile that is triggered when your battery level drops below 25% and its first action is to switch the phone from 3g preferred to 2g only, you really don’t want this talking place if you are on the phone at the time – it will cut you off! There is no built in variable to use within an IF statement for ‘phone in use’, but there is a context we can use, so let’s create a variable using that.
From the main Tasker screen, select ‘New’ and ‘Event’. Select ‘Phone’ and ‘Phone Offhook’. Press the ‘?’ at the top of the screen to read a description of when this context will apply – For all intents and purposes; it’s when you are on the phone.
Leave the priority as normal and select ‘Done’. The Task Selection list will be displayed, select ‘New Task’ from the top, name it ‘InCall’, give it a relevant icon, add a STOP entry (+, Tasker, Stop) and select ‘Done’ and ‘apply’ out of Tasker to ensure that your work so far is saved if anything goes wrong.
Go back into Tasker and select ‘Tasks’ and from the list select your created task ‘InCall’. Now, in the future it may be that you wish Tasker to perform some actions when you are on the phone, but for now, all we are interested in is creating a variable we can use when the condition of ‘being on the phone’ is true!
Click the + and select ‘Variable’ and ‘Variable Set’. In the name field we want to call it something memorable, so let’s go for %INCALL (always must be capitals). So, we know this task we are creating will be triggered when a phone call is taking place, so in the ‘To’ field put the number ‘2’. Select ‘Done’ which will return you to the task screen. Click on + and select ‘Alert’, ‘Flash’ and in the ‘Text’ field type %INCALL. Press ‘Done’.
In the task, press and hold the original ‘Stop’ action you created and drag it down to position number 3. Your task should then be:
#1 Variable Set (with the description showing)
#2 Flash (with %INCALL showing)
#3 Stop
Press the ‘Test’ button which will simulate the task being triggered (you are on the phone) and on the screen should appear the number ‘2’. Every time you now are on the phone, Tasker will set the variable you have just created %INCALL to a value of 2.
Let’s imagine in another task you are creating, you’ve just selected an action to change the phone to 2g only. This would result in the radio turning off briefly and would end a call if you were on one. In that circumstance, you would use the variable we’ve just created to only switch to 2g IF %INCALL ‘does not = 2’. This way, if you were on the phone and %INCALL = 2, Tasker would skip that action. Sorted?
Q) But hold on… %INCALL has been set to 2 when I just pressed ‘Test’, will it automatically change from 2 when I finish the call?
A) Good question! NO! We need to do this ourselves…
From the main screen, click on ‘New’ and select ‘Event’. Click on ‘Phone’ and select ‘Phone Idle’ (read the ? if you want an explanation). Leave the ‘Priority’ as normal and select ‘Done’. Select ‘New Task’ when the selection list is displayed, name it CallEnd, select the same icon as InCall (to keep things tidy), add your Stop action and save out of Tasker to preserve what you’ve done.
Going back into the task CallEnd, we know we need to change the value of the variable we created %INCALL to something else other than ‘2’. Select +, Variable, Variable Set. In the name field put %INCALL and in the ‘To’ field put the number ‘1’. Press Done. As you did above, add in an Alert, Flash, %INCALL action and make sure the actions are in the same order as we did in the task InCall. Press the ‘Test’ button and you’ll see the number 1 flash up on the screen.
We now have the variable %INCALL to use whenever we need to consider the phone’s state and is ready to use in any IF statement to ensure an action will only take place IF %INCALL = 1 (I’m not on the phone). Sorted!
Q) But hold on… Why did you use the values 1 and 2? Why not 1 and 0 or another option?
A) I always avoid using zero when applying a value to a variable. The simple reason is that when you start creating more complex tasks, you may well wish to add %COMPLEX-TASK to %VERY-COMPLEX-TASK. Adding ‘zero’ to something will not make a change and therefore I always give my created variables a value of 1 or above.
There are other options such as setting %INCALL to 1 when we are in a call and then ‘Variable Clearing’ it when the call is ended. This would result in %INCALL having no value applied to it when no phone call was taking place. Tasker has the option to check for this in an IF statement – you can say IF %INCALL ‘is not set’. Conversely, there is an option to ask IF %INCALL ‘is set’. I prefer to always use a value; the reason being that a variable that hasn’t populated correctly will also contain nothing. At any point I can ‘Variable Flash’ any of my created variables and see that it has a value and know therefore it is working (it may be the wrong value of course – but at least you’ll know!).
Ok, let’s move on. Drag the ‘Flash’ actions below the ‘Stop’ action, as there’s no need for them to appear on the screen every time the phone is used and save back to the main screen. Let’s move on to something that works on the same basis, but is a little more complicated.
You may have read about using cell towers to trigger location based profiles, such as automatically sending your wife a text when you leave the locality of the office, IF the %TIME is greater than 5pm - but there are other ways you can let Tasker know where you are or aren’t.
The obvious choice would be the SSID (wireless name) of the wireless router you are connected to. We can easily set up our own variables so that %IM-AT-HOME is set to a value of 2 when Tasker becomes connected to the SSID of your home wireless BELKIN23456 (for example). The same can be done for other locations such as work. When it’s no longer connected, it sets %IM-AT-WORK back to 1.
Having such variables are useful within IF statements of other tasks. If you have a battery preserving profile that is set to turn off WiFi after a certain period, you may not want it to do this when you are near your charger at home. So, having an IF statement within the action of ‘set wireless off’ IF %IM-AT-HOME ‘does not = 2’ would stop the disconnection.
These variables are also useful for triggering other profiles, such as your work or home profile. My device is currently set up to sync every 30 minutes (using Tasker) and therefore within 30 minutes, Tasker will know if I am at home/work/parents/gym etc etc and can apply any specific actions/profiles accordingly.
Let’s say I’m at the gym. I always listen to music on my device when I’m there, so I don’t want any notifications coming through the headset and interrupting the playback or deafening me! I therefore want Tasker to put the phone to vibrate only. This is very easily done.
The triggering context will be Tasker spotting the variable %ATGYM (we will create shortly) has been set to a value of 2. Let’s set that up - Click on New and select Event. Select variable and variable set. In the Variable field, type %ATGYM and enter the value as 2. Click done and select New Task, naming it GymProfile, select an icon and add in a quick Stop action before saving and returning.
Back in the task GymProfile, click on + and select Audio and Silent Mode. Select vibrate and press Done. Drag the action up to position #1 and select Done. Job done!
Q) But hold on… When did it realise I was in the gym and change %ATGYM to = 2?
A) It didn’t! We need to create that profile now.
Now, this is where it’s going to start getting a little bit tricky, but I will explain it as simply as I can (apologies if I patronise). Unfortunately, the current version of Tasker does not have %SSID as an inbuilt variable. We therefore have to get this from somewhere else.
Create a new task and call it SSID, choose your icon and add a quick stop action in before exiting to preserve. Back in the task, we need to have a look at the data held inside another variable that contains the SSID. This variable is %WIFII (which stands for WiFi Information (I assume!)). You’ll need to be connected to a wireless network to be able to follow along with the next steps. If you’re not or can’t be right now, again I’ll try and explain the best I can.
There are a few ways to view the data stored in a variable. We used variable flash above, but as the name suggests, this doesn’t stay on the screen for long enough to study. We are going to write the data to a basic text file on the root of the SDcard. In the task SSID, press +, File, Write File. In the ‘File’ field, type SSID.txt and in the ‘Text’ field type %WIFII. Do not tick the ‘Append’ checkbox. Press done and drag this write file action into position #1 above the stop. Press Test. You’ll notice when you press ‘Test’ a button will appear that says ‘Kill All’. This will appear and disappear very quickly in a small task such as this, but if it remains, it may suggest you have done something wrong and the task has gone into a loop or is trying to resolve itself. The other alternative is that another profile/task is running, so don’t be too eager to press Kill until you’ve checked!
Assuming that worked without issue, in a file explorer navigate to the root of your storage card and locate the file we created SSID.txt. You have just learnt that if you try and write to a file that doesn’t already exist, Tasker will create it. The ‘Append’ tick box in the write file action gives you the option to overwrite the file if unticked, or add more data to the bottom of the existing file if it is ticked (appended). Open up the text file and you should see something like this:
>>>CONNECTION<<<
BELKIN45678
Mac: 00:1b(the remainder of your Mac address)
IP: 192(the remainder of your IP address)
Sig: 8
Spd: 54Mbps
Congratulations, you’ve just written your first data file using Tasker! In future, you can easily pull any data/RSS feed from the Internet under the option +, Net, HTTP GET using the ‘Output File’ field at the bottom.
Let’s carry on – So, we have the above data, but we only want the SSID out of it, which in this example is ‘BELKIN45678’. As usual, there is more than one way of doing this, but I want to show you variable splits, so that is how we shall proceed.
Back in the task SSID, we want to ‘split’ apart the data above that is held in %WIFII. It’s good practice to transfer this data to your own created variable to start with, for a few reasons that I won’t go into now! Let’s do that – hit +, variable and variable set. In the ‘Name’ field type %SSIDD which will standard for 'SSID data'. In the ‘To’ field, type %WIFII and press done. Drag this to position #1 and whilst you’re at it, drag the Write File action below the stop as we don’t need that again. What we’ve just told Tasker to do, is transfer any data that is held in %WIFII to %SSIDD. ‘Flashing %SSIDD would show you this if you wanted.
We have to decide where to ‘split’ the data in order to just leave us with the SSID we are after. When doing variable splits, it’s important to put as much information in the ‘split’ field as possible as this is how Tasker will dissect the data. For example, if we asked Tasker to split the data at the letter ‘S’ it will do so and create a number of split variables for each time it encounters the letter ‘S’ and create them in order in %SSIDD1, %SSIDD2, %SSIDD3 and so on and so forth for the number of times it encounters and splits at the letter ‘S’.
Looking at the example above, you would end up with a split at ‘Sig: 8’ which would populate one of the created variables (%SSIDD23 for example) as ‘ig: 8’ as after the ‘8’ it will encounter another ‘S’ at the start of ‘Spd’. So, let’s see where we want to split the data. Before the SSID, we have >>>CONNECTION<<< so, we’ll use that! Now we have to look at where we want the split to stop – after the SSID it lists the Mac address, so we’ll stop the split at ‘Mac:’. Let’s do it…
In the task SSID, hit +, Variable, Variable Split. First it asks for the name of the variable we want to dissect, so type %SSIDD (we transferred the data from %WIFII remember?). In the ‘Splitter field’ type ‘<<<’, leave the ‘Delete Base’ box unchecked and press done. Drag this action to position #2 under the original variable set. To see what the first split is going to do to %SSIDD, insert a +,variable, variable list action into position #3 (above stop). A variable list action will show on the screen ALL of the current user created variables that are populated. Your task should look like this:
#1 Variable Set %SSIDD to %WIFII
#2 Variable Split %SSIDD - Splitter <<<.
#3 Variable List
#4 Stop
Press Test.
For a short while on the screen the list of variables will show you that we now have %SSIDD’parts’.
NOTE: If the screen has just flashed up a load of variables that you have created in the past and not ‘cleared’ and you can’t see any %SSIDD# entries, you’ll need to clear these. You can either do this manually but using individual ‘variable clear’ actions and typing the names of all of the variables you see, or you can leave the ‘Name’ field blank in the variable clear action and it will clear ALL of your created variables. Be warned; If some of your existing profiles trigger from %A-VARIABLE ‘is not set’ then they will start!
The original %SSIDD remains and as we won’t need the full data set again, go into the variable split action and tick ‘Delete Base’ and press Test again. Doing that ‘cleared’ %SSIDD and you should see now that %SSIDD2 starts at your SSID with more data on the end and %SSIDD1 is the data before the split of ‘<<<’. Let’s insert a variable clear action for %SSIDD1 in position #3 (before we list) as we don’t need this. Pressing test again you’ll see that all that remains is %SSIDD2. As discussed above, let’s split that at ‘Mac:’ where our SSID ends. Insert that variable split into position #4, ticking ‘delete base’ as we won’t need the original. Your task should now look like this:
#1 Variable Set %SSIDD to %WIFII
#2 Variable Split %SSIDD - Splitter <<<. (with delete base ticked)
#3 Variable Clear - %SSIDD1
#4 Variable Split %SSIDD2 – Splitter Mac:
#5 Variable List
#6 Stop
Press Test.
Listed on the screen I hope you’ll see that %SSIDD21 now shows nothing but your SSID!? Job done! We’ll continue on to use that again in a moment, but first we need to do some housekeeping and clear up our mess to make sure there are no ‘variable parts’ that have been left - these can build up over time. Pressing test again, you’ll see that a variable %SSIDD22 was created – insert a variable clear action in position #5 to take care of that – Tidy files, tidy mind… The last thing to tidy up would be the fact that our SSID is stored in the variable %SSIDD21 – that’s hardly memorable is it…? So let’s transfer it to %SSID by doing a variable set ‘Name’ %SSID to %SSIDD21 and that only leaves us to variable clear %SSIDD21 as it’s no longer needed.
Your final task should look like this:
#1 Variable Set %SSIDD to %WIFII
#2 Variable Split %SSIDD - Splitter <<<. (with delete base ticked)
#3 Variable Clear - %SSIDD1
#4 Variable Split %SSIDD2 – Splitter Mac: (with delete base ticked)
#5 Variable Set %SSID to %SSIDD21
#6 Variable Clear %SSIDD21
#7 Stop
#8 Variable List
Action #8 below Stop, will never be ‘actioned’ but I tend to always leave such things there for testing purposes, so if ever something goes wrong, or you need to adapt a profile, your ‘testing actions’ are still there waiting to be dragged up and back into ‘action’!
So, let’s recap. By running the task SSID, we will extract the current SSID we are connected to. We can use this SSID to trigger location profiles.
Q) But hold on… What triggers this task? It’s great that it can get the SSID I’m connected to, but when does it start?
A) Well spotted! We need a context to trigger this.
In the main screen, click on New and State. Select WiFi Connected and leave all of the fields blank.
Q) But hold on… There’s a field there for SSID! Why did we just do all of the above if we can just stick in that box!? Do you actually know what you’re talking about?!
A) Well, that’s a little bit rude, but yes, honest, I do.
Admittedly, there are many different ways to get a desired result when setting up profiles and tasks in Tasker. The above was good (hopefully) for educational purposes, but the main reason that what we’ve done is useful, is because the extracted SSID (%SSID) can now be used in any IF statement in any action. Just because this particular context can identify an individual SSID, doesn’t mean that you can reference it elsewhere in Tasker… As a further example, the same can be said for mobile data – as a triggering context, there are 2g, 3g, 4g etc ‘connected to’ tick boxes, but no such specific conditions when looking at the inbuilt variables. I hope that made sense?
Where were we? Oh yes, so we’ve left all of the fields blank in the Wifi Connected context. Select done and select New Task naming it WIFIOC, which will stand for WiFi is on AND connected. To clarify again, this context triggers when WiFi is CONNECTED to a network – NOT when WiFi is ‘just’ switched on…
In the task we want to set variables depending on SSID. From the context above, we know that when this task triggers, WiFi must be connected to a preferred network – but which one? To complete this task, you’ll need the SSIDs of all of your preferred networks. With WiFi switched on, these will be detailed in the Android settings menu/settings/Wireless & networkds/Wi-Fi settings. We are going to use an IF statement for each one of these; the number depending on how many preferred networks you regularly connect to, or more importantly, which of these you may wish to trigger a profile….
We are going to create memorable variable names for each place such as %WIFIHOME, %WIFIWORK, where you connect to a wireless network. So, let’s assume you are connected to your home wireless which has the SSID of BELKIN45678. Select +, select variable and variable set ‘Name’ %WIFIHOME to ‘2’ and then tick the IF box – and using our created variable above %SSID ‘matches’ BELKIN45678 and select done. There! Tasker will now know that you are at home when %WIFIHOME is set to a value of 2! Sorted!
You need to repeat this individual action for every preferred SSID you want to use:
#1 Variable Set %WIFIHOME to 2 IF %SSID ‘matches’ XXXXXX
#2 Variable Set %WIFIWORK to 2 IF %SSID ‘matches’ XXXXXX
#3 Variable Set %WIFIGYM to 2 IF %SSID ‘matches’ XXXXXX
#4 Variable Set %WIFIBLAR-BLAR-BLAR to 2 IF %SSID ‘matches’ XXXXXX
Etc, etc…
In action #2 above you’ll see that %WIFIGYM has been set to 2 and this will trigger the profile we ran through way back when at the beginning… Although I think I called it %ATGYM back then, but hey, you know what I mean!
Q) But hold on…
A) Jesus, what now?
Q) This task was triggered by WiFi being connected but it doesn’t check the SSID, so how does it know which one to set to 2 IF it hasn’t checked?
A) Well spotted… Before Tasker can start deciding which %WIFI-BLAR it sets to a value of 2, it needs to extract the SSID (%SSID) from %WIFII – that was done in the task we created ‘SSID’
So, we need that to run before we ask Tasker to check IF the SSID matches any of our locations. As usual, there are a number of ways to do this. We could tag the above actions onto the end of the task SSID and get rid of WIFIOC completely, or alternatively, we could just run the task first…
In the task WIFIOC, select +, Tasker, Perform Task. Click on the magnifying glass and select the task SSID. Drag the slider along to increase the priority to a very important 9. Select done and drag this action up to position #1. This now means that every time WiFi is on and connected it will run the task WIFIOC which will immediately kick off the task SSID in action #1. Action #2 uses an IF statement involving the results from the task SSID and therefore it’s essential that it has run first prior to action #2. Giving it a priority 9 as we did, tells Tasker it is more important to run that task than continue with the current one, which will be set to 5 as standard (we haven’t changed it).
Now, I hold my hands up here and tell you that I don’t honestly know if this means that Tasker waits for SSID to finish before continuing with action #2 in WIFIOC. Just to be sure, let’s add something else into action #2. Select +,Tasker, Wait and drag the slider (or use the +) to 5 seconds. Drag this action up to position #2 directly after the perform task (SSID) action. However Tasker exactly handles the higher priority task, 5 seconds is more than enough for it to have extracted the SSID it is currently connected to and be ready to compare it to all of the IF statements from action #3 downwards!
WOW, I really have written loads… I hope you are still with me!? Let’s recap: The context triggers by WiFi being on and connected. That runs the task WIFIOC to determine your location by the SSID which is discovered in action #1 when we tell it to run the task SSID. Assuming that we are in the gym at the time, it’ll change %WIFIGYM to a value of 2 and the profile you set up which looks for this profile (sorry, I think I called the variable %ATGYM originally, but it’s easily changed!) being set to a value of 2, will trigger the task GymProfile!
Q) But hold on… this has set my device to silent, but what happens when I leave the gym? Will Tasker know and turn the ringer volume back on?
A) Nope! We need to deal with that…
When you set up a triggering context, you normally choose between an ‘event’ or a ‘state’. Generally speaking, an event trigger can be described as something that takes place in an instance; such as a ‘received text’. Although the text may remain unread and in the inbox, the instance of receiving it has passed and therefore so has the ‘event’. A ‘state’ may be different in that it continues to be active – a good example would be when the battery is ‘less than’ 25%. This is still the case at 24,23,22% etc etc and so the ‘state’ remains true. In this type of context, we can (usually) add something called an Exit Task, which is purposely triggered when the ‘state’ is no longer active.
I explain the above, as this is applicable to the trigger we used of WiFi being on and connected. The profile will remain active in Tasker until the WiFi is no longer connected to a preferred network (not OFF, just NOT CONNECTED remember?) and this is perfect for us to use, as if we are no longer connected to the gym wireless… we must have left the gym! See where I’m going with this?
In the main Tasker screen, click the visible task WIFIOC. This should bring up a menu list, one option of which will be to ‘add exit’. Select it and give the new task a name WIFINOC and icon etc as usual. The purpose of this task is to set any of the above %WIFIBLAR location variables back to 1 as we are no longer connected to ANY preferred network, so therefore cannot be in any of those locations (obviously yes, the connection could have gone down, but apart from that). So, add in all of the necessary variable set actions changing %WIFIGYM, %WIFIHOME etc etc to a value of 1. Job done.
Q) But hold on… Isn’t my device still on silent from the gym profile?
A) YES! But this guide is getting way too long, so I’ll wrap it up here by pointing you in the right direction.
When you leave the imaginary gym, let’s assume you want your phone to be in a ‘normal’ state, volume high, silly ringtone, brightness up, mobile data on etc etc – You need to create this ‘Normal’ task/profile yourself and have it triggered (Tasker/Perform Task) at the end of the above Exit Task. That normal profile will then take over whenever you are ‘between places’.
Finally, don’t forget you could perform the ‘normal’ task only IF certain conditions were true, like the day of the week or the time. Below that perform task you could have another one that tries to perform a weekend profile for example? If the conditions weren’t true for performing the ‘normal’ action then Tasker will ignore it and go to the next one….These changes in profiles from normal to gym to work etc will end up becoming more entwined as you increase the number of your profiles/tasks and the conditions that apply to them. They all should have a 1 for off and 2 for on and end up triggering a relevant other when their conditions no longer apply...
I fear I’m waffling…. and have somewhat gone around the houses, as you would normally start creating a masterpiece with a triggering context and go from there, but hey, my busy typing fingers decided differently...
Hope this has helped you? Any questions, please feel free to post and if you are feeling super knowledgable now, take a look at the Data and Sync tutorial in my signature which this is loosely based upon…
The thanks meter is the only way I know this was useful to you!
Using Tasker with Minimalistic Text
What you will Learn
How to pass variables to Minimalistic Text!
Overview
The user fl4r3 posted and asked for a tutorial on how to use Minimalistic Text (MT) with Tasker. You’ll be pleased to know that as confusing as it may seem, it’s actually very straight forward and therefore this tutorial shouldn’t be very long (yeah right!).
I love minimalist themes and am therefore a big fan of the application that is very simplistic (as you’d hope) and allows you to display highly configurable text on your home screen, with very little battery drain = %PERFECT (Yes, that was a Tasker joke.. %lol?).
Simple Preparation
Download and install Minimalistic Text free from the market. If you like it, consider the donate version.
Make yourself a cup of tea.
Profile and Task Explanation
In the main Tasker screen, select Tasks, add new, name it MTRefresh. Give it a suitable icon, add in a +, Tasker, STOP action and save out of Tasker for good practice.
Here we go then - my personal MT setup is to have a single, stand-alone task that deals with passing any data from Tasker that I wish. What I mean by this is that I don’t have a context set up to run the task MTRefresh every 2 minutes for example. Not only would this cause battery drain, it’s unnecessary when the screen is off for example.
Q) But hold on… How does it refresh then?
A) Relax… I’m just about to explain…
I’m not going to (initially) recommend that you set up a context in isolation to do this. We’ll look to refresh the widget from your existing profiles first, in order to use no additional resource.
Depending on the variety of profiles in your Tasker collection, you may already have a ‘Device Boot’ context to run profiles such as SDCache or CPUDeviceBoot. Failing that, a Display On context perhaps? When looking to have your MT widget refresh, my suggestion would be to slot a ‘Perform Task’ action into these existing triggers – as many of them as you see fit.
If you don’t have a profile that triggers regularly such as the above, then use the one that does most frequently for the purposes of this tutorial.
In the chosen task, select +, Tasker, Perform Task and click on the magnifying glass. Scroll down until you find your MTRefresh task. Change the priority to ‘1’ (the lowest - as there is no necessity for this to run prior to any other task/action) and select ‘done’. In the task screen, drag the Perform Task action above any ‘STOP’ or ‘GOTO’ action (in the existing task you’ve chosen) that may cause it to be ‘skipped’ or not to start at all.
[If you don’t yet have any suitable profiles that trigger regularly, then select New, Time and select the times that you would like the widget to start manually refreshing in the morning and end at night. Tick the ‘repeat’ box which will be how often between these times the profile activates and your MT Widget is refreshed]
Open the task MTRefresh and click the +, Plugin, Minimalistic Text variable. Press Edit in the configuration screen and you will be presented with two boxes. The top box, labelled ‘Variable name’ is the name by you will reference the Tasker variable in the MT widget. This doesn’t have to start with a ‘%’ or be the same as the variable you are passing the data from. The bottom box is the variable you wish to pass. So, in the top box type BLAR and in the bottom box type %UPS, which is ‘up time in seconds’ (which is the time since you last rebooted). This value will of course always be increasing, so we can easily see that it is working correctly. Make sure this action is dragged above the stop action in the task before saving.
Go to your home screen, hold down and select widgets. Select Minimalistic Text. Select 1x1. In the widget preference screen, scroll down and select ‘predefined layout’. Select Custom.. The Custom layout option is no longer greyed out, so select that. You’ll be presented with the example of the time in text. Hold down on the first example box (Hour text (12h)) until it vibrates and then drag it down to the rubbish bin that appeared. Do the same with the other two boxes. Click the green + symbol. Press Misc. Hold down on Locale variable and drag it up to the box you previously cleared. Once it’s in the box, click on it once to bring up options below it. In the variable name field, type BLAR (assuming this is actually what you named it above). Press the back button to exit to the MT preference screen. At the bottom there is a very thin line saying ‘Preview (tap to toggle)' – click this and you’ll probably see a box with [LOCTV] in it. Alternatively, you may actually see the value of %UPS, but I’d imagine we need to ‘refresh’ the MTRefresh task first.
Press ok to exit out of MT and on your home screen, where you expected the widget to be, you may well see nothing at all… Don’t panic! Go into Tasker and open the task MTRefresh – press ‘test’. Go back to your home screen and hopefully you will see that the value of %UPS is now displayed!
Job done…!
Q) But hold on... Is that really it? I'm not even bored and confused like I normally am...
A) F*ck you
I won’t go into how to make the text look cool as there’s a dedicated MT wiki and XDA thread for that.
You can of course use any of your own created variables and pass them to MT. You are not restricted to the inbuilt Tasker variables only.
There is a good thread here by akoe that describes how to pass your unread SMS count.
A list of inbuilt variables you can use can be found here
If anyone is struggling to pass certain data to MT or if you have any questions, feel free to post and ask!
The thanks meter lets me know this wasn't sh*t and a complete waste of my life
Basic Linux/shell commands to create an informative battery widget
What you will learn
Some basic Linux/shell commands via a Terminal Emulator
Profile Aim
Extract battery data using Linux/shell commands via the terminal and pass to Tasker to create an impressive battery widget.
Simple Preparation
Download and install Android Terminal Emulator [by Jack Palevich] free from the Market
Make yourself a cup of tea.
Overview
For noobs, or even some seasoned Android/Tasker users, venturing into the world of Linux/shell/ADB is a leap that just seems a little too daunting and probably remains on the todo list.
If reading the above has already made you reach for a spare set of underwear and you’ve suddenly got an urge to watch the TV instead, under the assumption that this will cause you major brain-ache, then think again! What I will show you is actually very simple and I hope will leave you feeling suitably impressed with yourself.
As always, I will explain everything in as much detail as I can, bordering on patronising (apologies) in the hope that I leave no one confused…
Let’s get started!
Profile and Task Explanation
By using the Terminal we are able to access some hidden gems that many applications (some you possibly have already paid for) use to inform us of our system information. We are going to focus on a simple battery widget for now, although I’m sure what you learn will open a door to accessing much more information from your device, that will see you creating all sorts of informative widgets for your personal use – please share them!
Open the terminal application and type:
Code:
su
This simple command has set your ‘user id’ to superuser. This is no more complex that logging into your pc at home under the name of someone who has administrator privileges.
We are going to run commands under superuser because much of the data has restricted access unless you have certain permissions.
Next type:
Code:
dumpsys battery
Much to your surprise (perhaps) you’ll see a similar output to this:
Code:
Current Battery Service state:
AC powered: false
USB powered: true
status: 2
health: 2
present: true
level: 23
scale: 100
voltage:3864
temperature: 204
technology: Li-ion
Unfortunately, not all outputs are quite as user-friendly as this, but this one is great to work with and as you can see, supplies us with plenty of information for our battery widget.
Now, we could immediately export all of this information to a text file and then get Tasker to read that text file using the ‘read line’ action to populate the data into variables. But let’s have a look at a very simple command that can make life easier before we send to Tasker.
Looking at the ‘level: 23’ line, it maybe that you only want to make a widget showing the battery data – so let’s just get that.
Using the ‘grep’ command, we can easily narrow down the output with little effort. Try this command in the terminal:
Code:
dumpsys battery | grep level
The ‘|’ is known as a ‘pipe’ and in simple terms says ‘do this before you give me the output’. In the example above, grep has only supplied us with the lines that contain the word ‘level’.
Try the same for ‘temperature’:
Code:
dumpsys battery | grep temperature
Easy hey…
So, let’s say that you’ve completed your battery level widget, but you hate the text ‘level:’ that appears before your battery percentage. To get rid of this, think of every output you get as appearing in an excel spreadsheet – each ‘word’ or ‘data section’ appears in its own column and you can easily select the individual columns you want to view.
Try this:
Code:
dumpsys battery | grep level | awk '{print $0}'
So, that didn’t change anything did it… You still got the full output – that’s because $0 means ‘everything’. Now try this:
Code:
dumpsys battery | grep level | awk '{print $1}'
Now try this:
Code:
dumpsys battery | grep level | awk '{print $2}'
Now try this:
Code:
dumpsys battery | grep level | awk '{print $1,$2}'
You’ve just learnt how to output all or some of the data you require.
TIP: If you’re having to retype the commands every time in the terminal, install a keyboard that has directional arrows on it (I use smart keyboard). Pushing ‘up’ on the arrows displays the last command you typed and then you can scroll across with the left arrow to edit just the parts you want, before pressing enter to execute. Simple.
Now you know how to extract just the data you want with the commands grep and awk, let’s assume that you’ve decided what text you want in front of the battery level and would like this to display in the output.
Try this:
Code:
dumpsys battery | grep level | awk '{print “CURRENT BATTERY LEVEL”$2}'
You’ll see that any text you put between the “ ” will output the exact text you’ve written. However, did you notice that there was no gap between the text and the battery level? Simply insert a comma to segment the output:
Code:
dumpsys battery | grep level | awk '{print “CURRENT BATTERY LEVEL”[B],[/B]$2}'
Right, so now you know how to extract just the data you want for your widget, let’s transfer it to Tasker. Using a command above, we’ll send just the battery percentage over and nothing else. Type this:
Code:
dumpsys battery | grep level | awk '{print $2}'
Now type this:
Code:
dumpsys battery | grep level | awk '{print $2}' > /mnt/sdcard/batterywidget.txt
Navigate to the root of your storage card and confirm that a text file containing just the current percentage of your battery has been created.
Next, let’s get just the temperature:
Code:
dumpsys battery | grep temperature | awk '{print $2}' >> /mnt/sdcard/batterywidget.txt
Navigate back to the same file and you’ll see this information has been appended underneath the percentage. The reason that this data was entered below the previous data (appended) was because of the double ‘>>’ used above. A single ‘>’ means ‘send the output to this file’. It will overwrite anything the file currently contains. A double ‘>>’ means ‘append the data to this file’.
Before we head over to Tasker to deal with the data, let’s do one more command. The health of my battery is currently showing as 2. That number means pretty much nothing to anyone – it could be 2/1,000,000. If we know that 1 = super, 2 is very good; 3 is good, 4 is poor and 5 is sh*t, then let’s translate that data first by using a very simple IF command.
Starting with:
Code:
dumpsys battery | grep health
Followed by:
Code:
dumpsys battery | grep health | awk '{print $2}'
Followed by:
Code:
dumpsys battery | grep health | awk '{if ( $2 == 1 ) print “Super”}'
If you got no output, try one of these:
Code:
dumpsys battery | grep health | awk '{if ( $2 == 2 ) print “Very Good”}'
dumpsys battery | grep health | awk '{if ( $2 == 3 ) print “Good”}'
dumpsys battery | grep health | awk '{if ( $2 == 4 ) print “Poor”}'
dumpsys battery | grep health | awk '{if ( $2 == 5 ) print “Sh*t”}'
I’m hoping you got an output and can see how the IF condition is selecting the correct output. We don’t want to use five different commands to get our answer though, so let’s join them together:
Code:
dumpsys battery | grep health | awk '{if ( $2 == 1 ) print "Super"; if ( $2 == 2 ) print "Very Good"; if ( $2 == 3 ) print "Good"; if ( $2 == 4 ) print "Poor"; if ( $2 == 5 ) print "Sh*te" }'
I very much hope that you are still with me at this point and suitably impressed with yourself!? The above code could be simplified using just ‘awk’ and no ‘grep’ or ‘cut’ or ‘sed’, but the format should enable you to see exactly what is going on and how you are getting the output you are! So we’ll stick with that…
Ok then, let’s take this puppy over to Tasker. Click on the task icon and select ‘New Task’. Name it ‘ShellBat’ and then select the + to add the first action. Select Misc and then Run Shell and in the command field enter:
Code:
dumpsys battery | grep level | awk '{print $2}' > /mnt/sdcard/batterywidget.txt
Tick the ‘use root’ box, choose a suitable icon (by pressing the icon button) and then press the green tick to save. Then press it again to save the task and again to exit Tasker. This makes sure the task is correctly saved in case your device crashes – if you don’t save all of the way out of Tasker, you progress could be lost.
Go back into Tasker and select the task ShellBat and press the play icon. Approve the superuser request (if prompted) and then open up a file explorer and check that the file sdcard/batterywidget.txt has populated with your current battery level correctly.
It has? Result! Next we need to get the battery health text in there too and to do that we need to add another run shell action in position 2 in the shellbat task. So, press + in the task, select Misc, run shell, tick use root and enter the following in the command field:
Note – If you are not viewing this tutorial on your phone and copying and pasting the commands over, at the end of this post I’ve included a text file with the commands in that you can drag to your sdcard and then copy and paste the contents from there – pressed the thanks button yet??
Code:
dumpsys battery | grep health | awk '{if ( $2 == 1 ) print "Super"; if ( $2 == 2 ) print "Very Good"; if ( $2 == 3 ) print "Good"; if ( $2 == 4 ) print "Poor"; if ( $2 == 5 ) print "Sh*te" }’ >> /mnt/sdcard/batterywidget.text
In the above command you’ll remember that we’ve used ‘>>’ which will append the battery health underneath the current battery level.
Press the play button in the task and then navigate back to the text file to make sure it has populated correctly! It did? Whoop! Having that data safely in the text file, we now need to get it into Tasker. We do this using the read line action. In the task, select the + button, followed by file, followed by read line. Hit the magnifying glass and select batterywidget.txt. In the line field put the number 1 and in the var field type %BWLEVEL and press the tick to save. Press + again selecting another read line action, this time put 2 in the line field and name the var %BWHEALTH. Finally, we want to be able to check that everything is populating correctly without viewing variables and text files – so let’s flash the variable results on the screen. Press the + again and select, Alert, Flash and in the text field type %BWLEVEL %BWHEALTH. Tick the long button and then the tick to save. Press play in the task and hopefully see the contents of the two variables flash up on the screen!
I won’t talk you through making the widget itself – there’s a Minimalist Text tutorial above that talks you through how to get the variable information into a widget. You could also use the Zoom Widgets application that’s made by the dev of Tasker to knock something up too.
As far as how to update the information goes, you could run the task from a ‘display on’ context, so the data is refreshed every time you turn your phone on. Other options are to set a 5 minute interval between updates (when the display is on) or you could have the widget perform the task when clicked to manually refresh the data.
Other ideas would be to variable set %BWLEVEL to %BWLEVELR if it is less than 20. If that variable exists, then the widget would use a red text to display the battery level or %BWLEVELG (for green) if it is > 80.
Anyway, the point of this tutorial was to show you how to extract and pass the data using terminal commands and I very much hope I’ve shown you some handy basics.
Please post your screenshots if you make anything good!
As always, the thanks meter is the only way I’ll know to keep writing this stuff.
Have fun!
Credits: waydownsouth - For hours and hours of patient help
Great initiative! I am a total noob at using Tasker, and tutorials like this (with lots of explaining) is excactly what we need to learn it. Thanks
torsrex said:
Great initiative! I am a total noob at using Tasker, and tutorials like this (with lots of explaining) is excactly what we need to learn it. Thanks
Click to expand...
Click to collapse
Glad to hear it Be more coming when I find the time...
torsrex said:
Great initiative! I am a total noob at using Tasker, and tutorials like this (with lots of explaining) is excactly what we need to learn it. Thanks
Click to expand...
Click to collapse
I second that! Although I would like to request tutorials for using tasker with minimalistic text....I have never got this to work
fl4r3 said:
I second that! Although I would like to request tutorials for using tasker with minimalistic text....I have never got this to work
Click to expand...
Click to collapse
I'll put one together for you
Thanks for the tutorial. It's been very helpful. After your explanation of pattern matching I was able to make a profile to control my phone using Diary Events
ccadi said:
Thanks for the tutorial. It's been very helpful. After your explanation of pattern matching I was able to make a profile to control my phone using Diary Events
Click to expand...
Click to collapse
Pleased it's helped you to make a profile you wanted. That's what I wanted to achieve
I have a question regarding Tasker:
I have SGS 2 and have Pin Lock enabled.
I've created an Event where :
On display unlocked: KeyGuard: off --> Wait : 2Mins --> Keyguard On.
Its my version of Delay lock without Wait Until since i want the phone locked after two minutes regardless of usage pattern . Problem is when screen goes off before two minutes is reached, Even though KeyGuard is set to on, pressing Home button or unlock button bypasses the pin unlock and goes straight to Home Screen!
To fix it i tried by using : If %SCREEN matches Off --> System lock
but it didn't work.
Note that if the two minutes have elapsed and i unlock the phone myself whilst screen is on everything is ok, problem only occurs if the screen goes off before two minute wait is reached and that's when bypassing pin lock happens. How can i fix this?
thanks
ke3pup said:
:SNIP:
On display unlocked: KeyGuard: off --> Wait : 2Mins --> Keyguard On.
Problem is when screen goes off before two minutes is reached, Even though KeyGuard is set to on :SNIP:
Click to expand...
Click to collapse
You confused me there - if the screen goes off before the two minutes, then from what you explained above, you set the keyguard to 'off' and it will be until the 2 minutes has passed??
Have I misunderstood..?
Thanks a lot. Exactly what I needed. I somehow managed to make some simple profiles but I hope to become a tasker ninja soon.
Will try everything after my exams..
subscribed ..
[indroid 4.2]
neo1691 said:
Thanks a lot. Exactly what I needed. I somehow managed to make some simple profiles but I hope to become a tasker ninja soon. Will try everything after my exams... subscribed .. [indroid 4.2]
Click to expand...
Click to collapse
Ninja status awaits you
sawvellra26 said:
Wish this was around when I was just learning tasker. I spent countless hours learning this app...but having a useful thread as a resource is very nice. Thanks OP
Check out my newbie YouTube: http://youtube.com/androidhow
Click to expand...
Click to collapse
Pleasure Just checked out your sudoku video - brilliant! Didn't know it could do that... Wish it could do the same with cross-words!
Great great work!!! I cannot thank you enough brandall! Subscribed!
mi3x said:
Great great work!!! I cannot thank you enough brandall! Subscribed!
Click to expand...
Click to collapse
Pleasure
brandall said:
You confused me there - if the screen goes off before the two minutes, then from what you explained above, you set the keyguard to 'off' and it will be until the 2 minutes has passed??
Have I misunderstood..?
Click to expand...
Click to collapse
currently I have:
Code:
ON Display Unlock -> 1) Set KeyGuard : off
2) Wait : 2 minutes
3) Set KeyGaurd: on
So when the display is unlocked , the keyGuard is set to off, waits for two minutes and sets the keyGuard back to on.
This is fine if screen is ON when step 3 happens. but if screen has gone OFF when step 3 happens, it appears that KeyGuard remains off because when i press the Unlock or home Button I'm taken back to home screen bypassing the Pin unlock screen (or slide unlock screen for that matter).
How can i fix this?
ke3pup said:
currently I have:
Code:
ON Display Unlock -> 1) Set KeyGuard : off
2) Wait : 2 minutes
3) Set KeyGaurd: on
So when the display is unlocked , the keyGuard is set to off, waits for two minutes and sets the keyGuard back to on.
This is fine if screen is ON when step 3 happens. but if screen has gone OFF when step 3 happens, it appears that KeyGuard remains off because when i press the Unlock or home Button I'm taken back to home screen bypassing the Pin unlock screen (or slide unlock screen for that matter).
How can i fix this?
Click to expand...
Click to collapse
Ok! I'm with you now... There are issues with some lock screens and Tasker, so don't get your hopes up that we will be able to solve it; but let's try.
1) Add an 'Alert', 'vibrate pattern', pattern 200,200 - as action number 4
2) Set you wait time down to 30 seconds for testing so you don't have to twiddle your thumbs!
Switch your screen off before the 30 seconds and see if you feel the device vibrate at the 30 second point. At least we'll know then if the task is running fully.
Report back!
hi brandall,
it's very kind of you doing such thread.
i m new user on tasker, the best app on the market.
actualy i ve got 3 main profil which were inspied by wiki tasker (extended profiler widget) - minimalstic tex (i like) sms-mail-call with a peach text for each ones and a really simple profile -auto gps- on for some apps.
in a near, a project to built a alarm clock which your would drive me with your alarm clock and a auto sms sender when sms or call are received while i am on my bike... so no worry with responds... i plan to used some like %locspeed include into the sms and others stuff... one step by step
I hit the button tks

Tasker Profiles

What's your favorite Tasker profile?
Mine are
1. wifi auto off and on depending on which cell tower I'm connected to.
2.automatic screen shade depending on light sensor % bye bye screen filter.
3. media selection popup upon headphone plug in.
4.pocket mode phone screen off and vibrate on when phone put in to pocket headphone jack first.
Feel free to share ideas I just started using it my self and don't know much.
Here is a good read :
http://forum.xda-developers.com/showthread.php?t=1110775
Link to my tasker profiles: https://docs.google.com/folder/d/0B_iZBWQpaR0RLWM1SzItYVZPYWc/edit?usp=sharing
To import add profiles to sdcard/tasker/profiles
Then in tasker long press profiles tab and then import.
Sent from my SAMSUNG-SGH-I997 using xda app-developers app
Kind of hard to believe no one has any tasker profiles or ideas
Sent from my SAMSUNG-SGH-I997 using xda app-developers app
1. Silence notifications while I'm sleeping
2. Max volume & brightness when in car dock
3. Auto volume setting when plugging in headphones
It's always interesting to see what others are doing.
1. wifi auto off and on depending on which cell tower I'm connected to.
Click to expand...
Click to collapse
I have that, except, it only disconnects if %WIFI !~ connect*.... prevents dropouts due to intermittent tower signal when I’m connected.
Some other stuff I have:
Battery low warnings: vibrate/notify at 40%, audible/nofify at 30%, 20%, 10% (if silent is off).
Sync newsrob news reader at 3AM every morning (while I’m sleeping). Turns wifi on beforehand and off afterwards. This takes awhile... better to take care of it while I’m sleeping.
Turn on Display Rotation for Apps that needs it (my webbrowser, youtube, etc). On exit task Display rotation is turned off (saves battery to keep it off).
At 10:50AM every morning it pops up a message asking if I want to reboot. If I do not respond, nothing happens. I think it’s good to reboot every once in awhile for general principle and this is a time when I’m likely to have my phone on my desk at work, but not using it. Also reminds me it’s almost lunch time. Also if I tap the widget it sends another text and updates the value on the widget based on response.
At 11:00 AM every morning, it sends a text message to AT&T asking for my data usage for the month. Upon receipt of the message, it is parsed and the result is posted to a widget label on my home screen so I know how much I’ve used this month. Note that 11:00AM central time is a good check, other times of day the info you receive from AT&T may not be up to date.
When data is on I place a permanent notification to remind me that it is on. Notification goes away when data is turned off.
When screen goess off and not back on within a short period, I turn data off (to save data and battery) and turn display rotate off.
Battery % display widget in my dock – update every 5 minutes while screen is on. Color changes depending on level (green 75 – 100%, blue 50-75%, yellow 25-50%, red 0-25%. This also uses Zoom widgets (works nice with Tasker)
Screen Brightness level display in my dock. Tap to pull up menu to change brightness level and adjust mode between manual and auto (auto is also based on Tasker sensing light level). If brightness level is set above 40%, the displayed brightness number turns red and I get a perfmanent notification (so I don’t leave it on high). This also uses Zoom widgets.
Flaghlight widget. Tap to start flashlight. Then it asks me every 30 seconds if I want to leave flashlight on... if no response then it turns flashlight off (prevents forgetting and leaving it on).
Keyguard management. Turns on after a time delay whenever screen goes off away from home. Turns off keyguard whenever I enter key pattern (so I’m either at home in which case it’ll stay on after the first time I enter key pattern, or I’m on the road in which case it’ll turn back off when my screen goes off). Zoom widget has one letter H or A indicating whether my phone thinks I’m home or away (based on cell towers). Zoom widget has another letter H or A indicating how my keyguard is managed currently (home behavior or away behavior). Both letters change together, unless I tap the 2nd A while away to toggle it to H.. That indicates I have disabled keyguard on the road. A red permanent notification also appears. This is an original approach that I conceived/built although I drew ideas from the wiki
Profile which senses when I have a meeting on my calendar and automatically adjust my phone to “vibrate” mode so there will be no noises coming from my phone during meetings. By the way, I also forward all my incoming work emails to my Gmail account, which promptly stuffs them in a special folder. That way 1- I can quickly check incoming work emails from gmail 2 – all outlook meeting invites coming into my work email appear on my gmail calendar which is reflect in my phone calendar and triggers the profile. I actually don’t have a good working pre-meeting 10-minute reminder yet. Gmail’s doesn’t seem to work for me. Maybe I will do that in Tasker when I get a chance. This is a copy of someone else’s idea.
Every night before I go to sleep I press a button tell Tasker I’m going to sleep and in the morning when I get up I press another widget to tel Tasker I’m up. The sleep button sets Display Rotation off, sets wifi off, sets silent mode on, checks if I’m on charger and reminds me to put phone on charger. The awake button sets wifi on, sets silent mode off, syncs my google accounts (synker).
The wakeup task also sends a text message to google asking for weather in my hometown. Upon receipt of response, it populates a zoom widget on my homescreen with the weather/forecast. Also tapping that widget updates the forecast (via text). This is an original that I conceived/built.
For the weather widget and at&t data widget that both receive text messages... upon receipt of appropriate text message I use auto-shortcut to take me to the associated message. That way after I press a single back key, the incoming message notification is cleared. I could press back using built-in Tasker functions which would make it fully automatic, but that requires leaving USB debugging on, which makes me uneasy.
I have an “app” built in tasker that generates a transparent scene over everything else displaying battery level and temperature. Useful in the single situation that you are using navigation in the car and possibly charging.. keeping a close eye on battery level and temperature. This is an original that I conceived/built.
I also have a floating compass that floats over everything else. Useful with Navfree, whose display doesn’t give any clue which direction is north while navigating (the top of the map points in the direction you are traveling which may not be north). Requires SL4a and Python. This is an original that I conceived/built, with help from others on the Tasker google groups to figure out how to get the compass direction in Tasker
I have widgets to remember a parking space and launch Locus Pro to navigate back. Copied from somehwere.
I have profile to take/email photograph from front camera when someone enters the wrong unlock code. Copied from Android forums.
I have a profile to give a small tone whenever a call terminates. That is very helpful if you spend a lot of time on weak connections. You can keep talking after a call is dropped if you dont realize it. And knowing there will be a tone at end of call keeps you from asking "are you still there" during longer than normal pauses in the conversation. Copied from Android Forums. Very useful to me.
I have a widget that tells how many Tasker tasks are currently running. Tapping on it lists the tasks. Usually it doesn’t stay above zero for long. It allows me to recognize if a task has gone haywire. It complements nicely the display of active profiles which are listed in the pulldown notification. This is an original that I conceived/built.
electricpete1 said:
It's always interesting to see what others are doing.
I have that, except, it only disconnects if %WIFI !~ connect*.... prevents dropouts due to intermittent tower signal when I’m connected.
Some other stuff I have:
Battery low warnings: vibrate/notify at 40%, audible/nofify at 30%, 20%, 10% (if silent is off).
Sync newsrob news reader at 3AM every morning (while I’m sleeping). Turns wifi on beforehand and off afterwards. This takes awhile... better to take care of it while I’m sleeping.
Turn on Display Rotation for Apps that needs it (my webbrowser, youtube, etc). On exit task Display rotation is turned off (saves battery to keep it off).
At 10:50AM every morning it pops up a message asking if I want to reboot. If I do not respond, nothing happens. I think it’s good to reboot every once in awhile for general principle and this is a time when I’m likely to have my phone on my desk at work, but not using it. Also reminds me it’s almost lunch time. Also if I tap the widget it sends another text and updates the value on the widget based on response.
At 11:00 AM every morning, it sends a text message to AT&T asking for my data usage for the month. Upon receipt of the message, it is parsed and the result is posted to a widget label on my home screen so I know how much I’ve used this month. Note that 11:00AM central time is a good check, other times of day the info you receive from AT&T may not be up to date.
When data is on I place a permanent notification to remind me that it is on. Notification goes away when data is turned off.
When screen goess off and not back on within a short period, I turn data off (to save data and battery) and turn display rotate off.
Battery % display widget in my dock – update every 5 minutes while screen is on. Color changes depending on level (green 75 – 100%, blue 50-75%, yellow 25-50%, red 0-25%. This also uses Zoom widgets (works nice with Tasker)
Screen Brightness level display in my dock. Tap to pull up menu to change brightness level and adjust mode between manual and auto (auto is also based on Tasker sensing light level). If brightness level is set above 40%, the displayed brightness number turns red and I get a perfmanent notification (so I don’t leave it on high). This also uses Zoom widgets.
Flaghlight widget. Tap to start flashlight. Then it asks me every 30 seconds if I want to leave flashlight on... if no response then it turns flashlight off (prevents forgetting and leaving it on).
Keyguard management. Turns on after a time delay whenever screen goes off away from home. Turns off keyguard whenever I enter key pattern (so I’m either at home in which case it’ll stay on after the first time I enter key pattern, or I’m on the road in which case it’ll turn back off when my screen goes off). Zoom widget has one letter H or A indicating whether my phone thinks I’m home or away (based on cell towers). Zoom widget has another letter H or A indicating how my keyguard is managed currently (home behavior or away behavior). Both letters change together, unless I tap the 2nd A while away to toggle it to H.. That indicates I have disabled keyguard on the road. A red permanent notification also appears. This is an original approach that I conceived/built although I drew ideas from the wiki
Profile which senses when I have a meeting on my calendar and automatically adjust my phone to “vibrate” mode so there will be no noises coming from my phone during meetings. By the way, I also forward all my incoming work emails to my Gmail account, which promptly stuffs them in a special folder. That way 1- I can quickly check incoming work emails from gmail 2 – all outlook meeting invites coming into my work email appear on my gmail calendar which is reflect in my phone calendar and triggers the profile. I actually don’t have a good working pre-meeting 10-minute reminder yet. Gmail’s doesn’t seem to work for me. Maybe I will do that in Tasker when I get a chance. This is a copy of someone else’s idea.
Every night before I go to sleep I press a button tell Tasker I’m going to sleep and in the morning when I get up I press another widget to tel Tasker I’m up. The sleep button sets Display Rotation off, sets wifi off, sets silent mode on, checks if I’m on charger and reminds me to put phone on charger. The awake button sets wifi on, sets silent mode off, syncs my google accounts (synker).
The wakeup task also sends a text message to google asking for weather in my hometown. Upon receipt of response, it populates a zoom widget on my homescreen with the weather/forecast. Also tapping that widget updates the forecast (via text). This is an original that I conceived/built.
For the weather widget and at&t data widget that both receive text messages... upon receipt of appropriate text message I use auto-shortcut to take me to the associated message. That way after I press a single back key, the incoming message notification is cleared. I could press back using built-in Tasker functions which would make it fully automatic, but that requires leaving USB debugging on, which makes me uneasy.
I have an “app” built in tasker that generates a transparent scene over everything else displaying battery level and temperature. Useful in the single situation that you are using navigation in the car and possibly charging.. keeping a close eye on battery level and temperature. This is an original that I conceived/built.
I also have a floating compass that floats over everything else. Useful with Navfree, whose display doesn’t give any clue which direction is north while navigating (the top of the map points in the direction you are traveling which may not be north). Requires SL4a and Python. This is an original that I conceived/built, with help from others on the Tasker google groups to figure out how to get the compass direction in Tasker
I have widgets to remember a parking space and launch Locus Pro to navigate back. Copied from somehwere.
I have profile to take/email photograph from front camera when someone enters the wrong unlock code. Copied from Android forums.
I have a profile to give a small tone whenever a call terminates. That is very helpful if you spend a lot of time on weak connections. You can keep talking after a call is dropped if you dont realize it. And knowing there will be a tone at end of call keeps you from asking "are you still there" during longer than normal pauses in the conversation. Copied from Android Forums. Very useful to me.
I have a widget that tells how many Tasker tasks are currently running. Tapping on it lists the tasks. Usually it doesn’t stay above zero for long. It allows me to recognize if a task has gone haywire. It complements nicely the display of active profiles which are listed in the pulldown notification. This is an original that I conceived/built.
Click to expand...
Click to collapse
All I can say is wow
Would you mind exporting your profiles for download
Sent from my SGH-I997 using xda app-developers app
Thanks. Exporting can be a little tricky for a variety of reasons. We have choice of two formats: human-readible text (which can't import into tasker) and tasker-readable xml (which resembles gibberish to humans). And what I've described encompasses a large number of profiles, tasks, and scenes. Could export a project tab on a few if you'd like. Sometimes importing a project tab causes bizarre conflict of same-named scenes ... at least I've had that experience.
So, if you could identify one or two that you're interested in, I can work on exporting/presenting those.
Meantime, some stuff I've already organized (?) for presentation:
1 - A rambling youtube video. First five minutes is sort of beginners guide to tasker using screen-off / data off profile as example. Next 4 minutes is rambling wander through some of my profiles. Last minute for some reason I decided to show off my holo launcher dock widgets. I did not yet have my tasker/zoom-based widgets for battery% and screen brightness in place yet at the time I made that video.
http://www.youtube.com/watch?v=il5EAKkMgGI
2 - Floating battery monitor (% and temp) - intended to float over top of navigation program while navigating/charging
http://forum.xda-developers.com/showthread.php?t=1890710
By the way I have a new version of that, just haven't posted it there yet. Maybe a good job for someday.
Some general philsophy about Tasker fwiw: A lot of the things I do with tasker can be done with other programs/widgets. But I tend to think it's more efficient to minimize the number of programs in the category of widgets (which is continuously running process) and things that monitor for chage in state. They all use resources. Tasker uses resources as well but if we only use Tasker and Zoom for these types of things I think it's better. And sot of fun (that's probably the real reason). I'd have to say not more efficient in terms of time. For anyone considering buying Tasker I would mention it's not likely you're just going to grab a bunch of profiles and have them easily imported/running. There are often tweaks needed based on phone type and interaction among the various profiles.
Great video
Sent from my SGH-I997 using xda app-developers app
Notification/Ringer Volumes
I just recently picked up a Verizon S4, and I'm trying to figure out how to make tasker "link" my notification volume with my ringer volume, so they will both change using the rocker. Any help?
---------- Post added at 07:42 PM ---------- Previous post was at 07:30 PM ----------
Xxw0lfxX said:
I just recently picked up a Verizon S4, and I'm trying to figure out how to make tasker "link" my notification volume with my ringer volume, so they will both change using the rocker. Any help?
Click to expand...
Click to collapse
Sorry, I wrote this question in the wrong device thread. I didn't notice that when replying from my mobile browser
Sent from my Verizon Wireless Galaxy S4 using Tapatalk 4 beta.
1) I have created a profile that whenever i am sleeping phone goes in smart slient mode, if some vip numbers call my phone is back in ringer mode.
2) during some duration of the day my phone speaks the name of the caller instead of ringing. if not a known caller than it rings.
3) integrated it with LMT launcher and made a profile like double swipe up and all volumes are at max. double swipe down all are at minimum.
4) wave your phone and it takes a screenshot. ( you can change the context to any thing.)
5) if i missed a particular number 5 times in continuity than send him a custom message.
6) Phone says "missed call" at regular interval e.g 30 min
7) Phone says "battery full" when charged, battery low alert when below 20%.
8) Phone says "AC/USB Charging" when plugged in AC and USB respectively. and at removal is says AC|USB removed.
That sounds like a pretty neat setup you have there
Sent from my Verizon Wireless Galaxy S4 using Tapatalk 4 beta.
Inspirational quotes on home screen
I made a tasker profile to show inspirational quotes every hour on home screen.
For this I made a text file containing more than 100 quotes, each seperated by "/" for seperating and identifying an individual quote.
Then picking up any quote randomly and pushing it to "Minimalistic Text" tasker plugin.
For displaying on screen I used "Minimalistic Text".
Profile:
Profile: Insp Quotes
State: Battery Level [ From:20 To:100 ]
Time: From 06:35 Till 22:35
Enter: Insp Quotes // This is the task
Task: Insp Quotes
A1: Perform Task [ Name:Inspiration Stopff Priority:5 Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: ]
A2: Wait [ MS:0 Seconds:0 Minutes:0 Hours:1 Days:0 ]
A3: Goto [ Type:Action Number Number:1 Label: ]
Task: Inspiration
A1: Read File [ File:/sdcard/Download/insp.txt To Var:%Insptext ]
A2: Variable Split [ Name:%Insptext Splitter:/ Delete Baseff ]
A3: Variable Set [ Name:%Insprandom To:%Insptext(#) Do Mathsff Appendff ]
A4: Variable Randomize [ Name:%Insptextno Min:1 Max:%Insprandom ]
A5: Variable Set [ Name:%Inspsugg To:%Insptext(%Insptextno) Do Mathsff Appendff ]
A6: Minimalistic Text [ Configuration:insp = %Inspsugg Package:de.devmil.minimaltext Name:Minimalistic Text ]
I hope you will like the idea
Thanks
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
rahul70236 said:
1) I have created a profile that whenever i am sleeping phone goes in smart slient mode, if some vip numbers call my phone is back in ringer mode.
2) during some duration of the day my phone speaks the name of the caller instead of ringing. if not a known caller than it rings.
3) integrated it with LMT launcher and made a profile like double swipe up and all volumes are at max. double swipe down all are at minimum.
4) wave your phone and it takes a screenshot. ( you can change the context to any thing.)
5) if i missed a particular number 5 times in continuity than send him a custom message.
6) Phone says "missed call" at regular interval e.g 30 min
7) Phone says "battery full" when charged, battery low alert when below 20%.
8) Phone says "AC/USB Charging" when plugged in AC and USB respectively. and at removal is says AC|USB removed.
Click to expand...
Click to collapse
Hey,
Some of your profiles soun pretty awesome, is asking too much, for you to export them and share?
Thank you
need some help seeting up car profiles pls!
Hello, need some help setting up the following actions in Tasker. I use a tablet (Android 4.0.4) only for in car use and have some problems setting tasker profiles. It should be something like this:
For state power on (charging any) do the following tasks:
1. Disable keyguard
2. Issue a play command to the media app, only if music is not playing already (will come back why I need this latter on) - now I'm using Media Utilities plugin with Smart play (which should do that but it doesn't ... sometimes it sends the play even if the music is already playing, or will send the play command to the built-in media player instead to JetAudio which is the default set media player in android and in media utilities)
3. Turn GPS on, using now secure settings plugin - works great
4. Turn Bluetooth on - works
For State Power off (not charging any) do the following:
1. Turn keyguard on (enable)
2. Wait 12 seconds
3. IF keyguard on >>>
3.1 Stop media (using tasker built in media actions)
3.2 Disable GPS (secure settings plugin)
3.3 Disable bluetooth
3.4 System Lock
4 END IF
Everything works just great UNTIL ... I go in the car, turn the ignition ON ... the power ON profile starts than when I crank the engine, the car cuts the power to any accesories including car phone charger. The power off profile starts and waits 12 seconds before stoping music, gps, etc.
Than the car starts (before those 12 seconds run up) and the phone charger receives power, and the power on profile comes back. I have a higher priority for the power on profile so, the power off profile is aborted and the power on starts again ... but here the problems start: Either the music is stopped (because another play is issued from the power on profile, and the media app thinks it's pause even with smart play command from media utilities) or the default android player is started and the jet audio it's stopped because the play command is send to the build in media player app.
what I would like is
- a shure tested way for tasker to check if any media it's being played, and if it is, abort the play command (tried %MTRACK with flash but could not set it up to work, got the same problems as above)
- some other ideas how to hack, workaround, create a better flow in my profiles to avoid interruptions in those 10-15 seconds while the tablet's charger is cut off by the car, when the car;s engine starts up.
thank you

[Q] Setting up WhatsApp so I only get one sound notification per conversation?

Hello,
I was wondering if anyone knew if it's possible to make WhatsApp give me a sound notification only for the first message I recieve in a conversation, so that the rest are muted and I hear a sound only once. Because usually I recieve messages in bursts of five or so messages, and hearing the phone ring five times in 10 seconds is extremely annoying. I'd like to make it so that any time I get a message in a conversation, I'd hear the tone just once (for each conversation) and then nothing until I open up and read the messages. Thanks in advance.
+1 to this.
2 years and nobody ever found a solution. Are we the only ones annoyed by the constant beeping?
I also find it hard to believe why WhatsApp hasn't developed a feature like this in their app... Many people I talked to are also very annoyed by the smartphone vibrating and playing a notification sound 5 times in 20 seconds!
As a matter of fact, it surprises me that this post has so few replies.
WhatsApp could implement something as simple as: "Notify me only once in 5 minutes". I'm pretty sure it is very easy to implement.. Why don't they do this?
So yeah. Im late, but i think i did.
You guys know tasker app? Amazing thing.
So here we go.
First you need tasker app.
1. You'll create two variables in VAR tab, one if for counting the other one is to store the notification volume you're set in at all random moments that you can receive a text, you don't wanna restore your volume to a preset, if you put your phone on silece mode it needs to stay on silence mode after. So, i named mines "CountNot" and "ActualNotVol"
2. Creating a task, name it whatever you like.
Look for some engine symbol or options inside the task you need to configure the Collision Handling to "Abort New Task". So the code only run once until needed again.
The code goes:
>If: %CountNot EQ 0
>Variable Set: %CountNot to 1
>Variable Set: %ActualNotVol to (click on arrow and choose) %VOLN
>Wait: 3 seconds (For my notification sound complete, may vary)
>Notification Volume: Level 0 (Muting notification sounds)
>Wait: 1 Minute (The amount of time the notification will be muted, guessing the ****head will be done sending multiple text, may vary)
>Notification Volume: (click on arrow) %ActualNotVolume (Will restore the volume that it was before)
>Variable Set: %CountNot to 0 (So the task can be repeated next time)
Finish.
Go to profile, and create > Event> UI > Notification > Owner Application > WhatsApp
And select the task you just created.
Test it if possible.
I would appreciate a reply as feedback, hope it works for you too.
bebecofp said:
So yeah. Im late, but i think i did.
You guys know tasker app? Amazing thing.
So here we go.
First you need tasker app.
1. You'll create two variables in VAR tab, one if for counting the other one is to store the notification volume you're set in at all random moments that you can receive a text, you don't wanna restore your volume to a preset, if you put your phone on silece mode it needs to stay on silence mode after. So, i named mines "CountNot" and "ActualNotVol"
2. Creating a task, name it whatever you like.
Look for some engine symbol or options inside the task you need to configure the Collision Handling to "Abort New Task". So the code only run once until needed again.
The code goes:
>If: %CountNot EQ 0
>Variable Set: %CountNot to 1
>Variable Set: %ActualNotVol to (click on arrow and choose) %VOLN
>Wait: 3 seconds (For my notification sound complete, may vary)
>Notification Volume: Level 0 (Muting notification sounds)
>Wait: 1 Minute (The amount of time the notification will be muted, guessing the ****head will be done sending multiple text, may vary)
>Notification Volume: (click on arrow) %ActualNotVolume (Will restore the volume that it was before)
>Variable Set: %CountNot to 0 (So the task can be repeated next time)
Finish.
Go to profile, and create > Event> UI > Notification > Owner Application > WhatsApp
And select the task you just created.
Test it if possible.
I would appreciate a reply as feedback, hope it works for you too.
Click to expand...
Click to collapse
I think noobs like me need a video tutorial

Tasker Project to control Philips Hue bulbs using Ok Google commands (no root)

Tasker Project to control Philips Hue bulbs using Ok Google commands (no root)​
I've created a Tasker Project that works in conjuction with Ok Google and a few Tasker plugins to give you voice control over your Philips Hue lights, as well as some instructions for setting it up. Hope you enjoy! Apologies for the lack of links, I'm more a lurker than a poster.
(Not sure if this is the right forum for this, but mods please move it if not.)
For those who are starting from scratch wanting to do this, I'll give a short guide to how to get this up and running. If you are experienced, the gist of it is to install all the plugins, import the XML file, and configure AutoHue within the tasks.
Step 1: Prereqs
The first thing you'll need to do (after buying and setting up your Hue bulbs) is install the prerequisites:
Tasker:
($2.99)
play.google.com/store/apps/details?id=net.dinglisch.android.taskerm
AutoVoice:
play.google.com/store/apps/details?id=com.joaomgcd.autovoice
AutoVoice Pro Unlock:
($1.57, yes you need pro)
play.google.com/store/apps/details?id=com.joaomgcd.autovoice.unlock
AutoHue:
($1.29)
play.google.com/store/apps/details?id=com.cuberob.autohue
Philips Hue:
(not required, but you'll need it if you haven't already set up your bulbs. good for testing anyway):
play.google.com/store/apps/details?id=com.philips.lighting.hue
​
Step 2: Configure AutoVoice
You'll then need to make sure you have Ok Google enabled and allow AutoVoice to intercept commands. Lifehacker has a good article on how to do this which I used, so I'll just tell you to use steps 0 and 1 from that:
lifehacker.com/how-to-create-custom-voice-commands-with-tasker-and-aut-1282209195
I also recommend in the AutoVoice app, under Google Now Integration, to check the "Only Voice" box so if you type a search for anything it doesn't accidentally trigger a profile.
Keep in mind I'm running this on a stock, rooted Nexus 6 with always listening Google Now enabled. YMMV if you have other means to trigger the voice commands. You may want to set up some dummy tasks to test your voice triggering.
Step 3: Configure Tasker
At this point you can follow the Lifehacker guide to set up some profiles, but I've provided my Tasker Project via an XML file for your convenience.
XDA doesn't accept .xml files, so I changed it to .txt
Just rename it back to .xml (it's plaintext, so by all means inspect it). You should never blindly import a stranger's Tasker profiles.
Once you're satisfied, just download and import it into Tasker (there are guides out there for this).
Step 4: Configure Tasker Profiles for your Bulbs
One at a time open the "Set Lights", "Turn off the lights", "Mood Lighting", and "Movie Mode" actions and do the following for each of the "AutoHue" Actions in each task (There are 3 in "Set Lights", 1 in the rest):
==> Select the Action
==> Tap the pencil in the rop right
==> Tap the magnifying glass and search/pair with your Hue bridge
==> Tap the button under "Light" and select the bulbs you want to be controlled
==> Tap the Check Mark in the top right
(That step seems like a lot of work, but trust me when I say it pales in comparison to setting up all of these individually)
Step 5: Test!
Once you've completed that, open a few of the tasks and press the Play button in the bottom corner to make sure they are configured right (your lights should respond accordingly). Then once you know Tasker is working right, you can try using Ok Google to trigger it. If everything was configured properly, then you're all good to go!
List of available commands I have already set up with descriptions:
These can be disabled individually by either turning the Profile switch to Off or completely deleting the Profile and Task from Tasker.
==> "Turn on the lights"
- turns on all lights to maximum brightness​==> "Turn off the lights"
- turns off all lights​==> "Dim the lights"
- dims the lights to 20%​==> "Movie Mode"
- turns off all lights except one (mine's set for the one being in the kitchen; This needs to be set up like the "Set Lights" task above.)​==> "Set the Mood"
- dims the lights and sets them red (for when you've got "company"). This needs to be set up like the "Set Lights" task above.​==> "Wake Up"
- When phone alarm goes off, slowly increases the lights from off to full with blue hue to help you wake up, then waits 10 minutes and sets the color to white​==> Increase by % (increments of 10%; range: 10%-90%)
- e.g. "increase the lights 30%"​==> Decrease by % (increments of 10%; range: 10%-90%)
- e.g. "decrease the lights 30%"​==> Set to % (increments of 10%; range: 10%-100%)
- e.g. "set the lights to 30%"​
Note: I have it configured so setting the brightness also adjusts the warmth of the light, so a dimmer light is an oranger hue (easier on the eyes in the dark; similar to f.lux.) This can be disabled by changing references to the %Sat variable under the AutoHue actions in the "Set Lights" task to 0.
Things I'll probably add in soon:
Another variable for hue to add the ability to change the color of the lights with voice commands
Individual Room Lighting Control
A Few Notes:
Let me just say that I, personally, have not developed any of the tools required to make this happen, so if you liked what I've put together here throw your money at them, not me. (You'll need to in order to make it work, anyway.)
If you have the Xposed Module installed, you can also set up AutoVoice to work from Android Wear devices (pretty cool!)
This seems pretty cool actually. need to give this a shot. the more things i can combine with Hue the better!
been playing with hue and tasker since i got it. will check yours out!
Thanks Mate!
Well tried it the moment I read this thread. Worked great! Thanks for sharing.
"Okay Google, Turn on the lights"
:highfive:
Very nice! Thank you for that. I created my own commands, resembling the scenes I have set up. For this, you have to directly connect to your bridge, create a new user and read out the color settings of your lamps with your desired scene. Whoever wants to try it:
1. Find out you Hue bridge's IP.
2. Connect to it via Browser:
Code:
http://HUE_IP/debug/clip.html
3. In the URL field within the page, enter:
Code:
http://HUE_IP/api
4. For message body, enter:
Code:
{"devicetype":"test user","username":"newdeveloper"}
This will create a user named "newdeveloper". You can choose whatever name you like.
5. Push "POST". In "Command Response", you will see something like "Error: Link button not pressed." You'll have to press the button on your bridge, then hit "POST" again. It should say "success" now.
6. Now, enter the following in the URL field:
Code:
http://HUE_IP/api/newdeveloper
Afterwards, hit "GET". You will see a list of your lights, their state and some further information.
7. Now, with your phone, start a scene that you'd like to set via your voice. Afterwards, hit "GET" again. You'll see that the state of the corresponding lights changed (except you already set the scene before).
8. Now you've got something like this:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
And there are all the values you need!
9. Now go to Tasker. Hit the + Button, choose Event, then Plugin, Autovoice, Recognized.
10. Hit the Pencil next to "Configuration". Choose "Speak Filter", speak your desired command. Then hit the checkmark on the top.
11. Now select "New Task", enter a name if you like, then hit the checkmark. + Button, Plugin, Autohue, Pencil next to Configuration.
12. Now you can choose your Lights which you want to turn on and to be set. Under Command, select "Custom JSON String". In my case, it looks like this:
So, I tell the lamp to turn on ("on":true), and to set to the color I read out before ("xy":[0.5438,0.4048]).
You can also use the "bri", "hue" and "sat" variables if you like, but I prefer xy, its easier for me
EDIT: This only sets the color. You need the "bri" variable for brightness!
13. Test Command and profit! This was for a single light now. If you have different lights with different settings, just add another task for that event
I hope that this is helpful for some of.. hue
For the "wake up " setting, do I need to say "Ok Google Wake up" to enable it or does it run automatically and check for an alarm. I use the Gentle Alarm clock app if that matters.
I'm also wondering if you have anything for dimming the lights slowly? I put a hue bulb in my sons room and I'm trying to set something up for it dims slowly over 15-20mins while I read to him before he goes to bed, then turns off completely and also make sure it doesn't turn on AT all throughout the night by accident.
turokk said:
For the "wake up " setting, do I need to say "Ok Google Wake up" to enable it or does it run automatically and check for an alarm. I use the Gentle Alarm clock app if that matters.
Click to expand...
Click to collapse
It just runs automatically when an alarm is detected. I've only ever tested it with the default Google alarm, but it should theoretically work with any app, as long as that's what Tasker is detecting.
shadow321337 said:
It just runs automatically when an alarm is detected. I've only ever tested it with the default Google alarm, but it should theoretically work with any app, as long as that's what Tasker is detecting.
Click to expand...
Click to collapse
It worked perfectly with Gentle Alarm, so happy it worked.
Hey Shadow,
I have a question about the "wake up" task. Can you add more than one Variable Add? Right now it has the following after step 2 (Auto Hue)
3 Variable Add - Name %Brightness Value 5
4 Wait 485 msec
5 Goto ... etc
I'd like to do the following and tried it and it didn't work.
3 Variable Add - Name %Brightness Value 2
4 Wait 6 Minutes
5 Variable Add - Name %Brightness Value 6
6 Wait 4 minutes
7 Goto - Type Action Number Number 2
8 Wait - 10 minutes
The brightness doesn't seem to change at all form 2 to 6 value when I add an extra Variable Add. I then did a "Perform Action for step 5 and then it did a loop, where it went from Brightness 2 to Brightness 6.. but then the color was different and not blue.. so I assume the Perform Action is doing a specific call to another task with a different color.
At worst case I'll revert back to the original and just change the Variable Add brightness to 2 and leave it for 10mins then let the script run through.
turokk said:
Hey Shadow,
I have a question about the "wake up" task. Can you add more than one Variable Add? Right now it has the following after step 2 (Auto Hue)
3 Variable Add - Name %Brightness Value 5
4 Wait 485 msec
5 Goto ... etc
I'd like to do the following and tried it and it didn't work.
3 Variable Add - Name %Brightness Value 2
4 Wait 6 Minutes
5 Variable Add - Name %Brightness Value 6
6 Wait 4 minutes
7 Goto - Type Action Number Number 2
8 Wait - 10 minutes
The brightness doesn't seem to change at all form 2 to 6 value when I add an extra Variable Add. I then did a "Perform Action for step 5 and then it did a loop, where it went from Brightness 2 to Brightness 6.. but then the color was different and not blue.. so I assume the Perform Action is doing a specific call to another task with a different color.
At worst case I'll revert back to the original and just change the Variable Add brightness to 2 and leave it for 10mins then let the script run through.
Click to expand...
Click to collapse
Sorry about the late response. Real life is distracting sometimes.
What are you trying to achieve by adding an extra variable add? What you're doing should be logically making it change, but not to an extent that you'd see a practical change in lighting. If you're just looking to make it increase faster, you can increase the amount the Brightness variable is increased by, or shorten the time span between the loop iterations. Also keep in mind adding 2 or adding 6 to %Brightness isn't going to be increasing the value by that much. The value goes from 0 to 255, so adding 2 is only adding 0.78% to the total brightness level.
I try to import your profile it told me I can't because it's contain more then one profile. Any way around it. I'm new to tasker
cbetso said:
I try to import your profile it told me I can't because it's contain more then one profile. Any way around it. I'm new to tasker
Click to expand...
Click to collapse
Make sure Beginner Mode is disabled in Tasker, and then on the main screen hold-tap on the house icon in the lower left and select Import from there. It sounds like you're trying to import just a Profile, but this is a Project, which is a combination of Profiles, Tasks, and Variables.
shadow321337 said:
Make sure Beginner Mode is disabled in Tasker, and then on the main screen hold-tap on the house icon in the lower left and select Import from there. It sounds like you're trying to import just a Profile, but this is a Project, which is a combination of Profiles, Tasks, and Variables.
Click to expand...
Click to collapse
Thanks that work
I can't get it to dim or brighten
cbetso said:
I can't get it to dim or brighten
Click to expand...
Click to collapse
Does it work running the Tasker commands from within Tasker? Or does it just not work via voice?
It don't work with in tasker or by voice
cbetso said:
It don't work with in tasker or by voice
Click to expand...
Click to collapse
Make sure you follow the steps properly and remember that the commands are pre-set to be telling the lights what to do based on MY setup. Yours WILL vary and you'll have to change some things around to make it work perfectly for you. I've detailed how to do that in Step 4.
shadow321337 said:
Make sure you follow the steps properly and remember that the commands are pre-set to be telling the lights what to do based on MY setup. Yours WILL vary and you'll have to change some things around to make it work perfectly for you. I've detailed how to do that in Step 4.
Click to expand...
Click to collapse
I can't find "set lights" under profiles. It showed up for me once under "tasks" but then I messed stuff up so I deleted the project.
When I re-added it, nothing showed up under tasks.
Help? Thanks for your hard work! I can't wait to enjoy this.
EDIT: Fixed it! Was using the wrong voice commands
benblb said:
I can't find "set lights" under profiles. It showed up for me once under "tasks" but then I messed stuff up so I deleted the project.
When I re-added it, nothing showed up under tasks.
Help? Thanks for your hard work! I can't wait to enjoy this.
Click to expand...
Click to collapse
That's really strange. You deleted the entire project and re-imported it? I'm not sure if that's a bug with Tasker or something, but it should allow you to re-import everything. There are like 35 tasks in the project, "Set Lights" being one. It should be under tasks, not profiles. You might try renaming the xml file to see if it will re-import with a different name and get everything. Or try adding and removing it a few times with the different options of "Delete Contents" or "Keep Contents" and see if one of them works. Beyond that or completely resetting Tasker I'm not too sure how to get it back if re-importing doesn't get it.
shadow321337 said:
That's really strange. You deleted the entire project and re-imported it? I'm not sure if that's a bug with Tasker or something, but it should allow you to re-import everything. There are like 35 tasks in the project, "Set Lights" being one. It should be under tasks, not profiles. You might try renaming the xml file to see if it will re-import with a different name and get everything. Or try adding and removing it a few times with the different options of "Delete Contents" or "Keep Contents" and see if one of them works. Beyond that or completely resetting Tasker I'm not too sure how to get it back if re-importing doesn't get it.
Click to expand...
Click to collapse
I got around this by choosing a random profile like "turn on the lights" and expanding it. Then I pressed and held the task, and replaced it with "set lights". I activated the AutoHue parts, and then switched it back.
In addition, I was using incorrect voice commands. All better now!
Do you know how to disable to toast that pops up telling me that a possible command has been detected? It now shows up no matter what I search by voice.
Thanks for such a fast reply!

Categories

Resources