Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,728,117 Members 47,232 Now Online
XDA Developers Android and Mobile Development Forum

[TUT] The Ultimate Noob/Beginners Guide to Tasker

Tip us?
 
TomTcom
Old
(Last edited by TomTcom; 26th December 2013 at 08:22 PM.)
#4521  
TomTcom's Avatar
Recognized Contributor
Thanks Meter 457
Posts: 1,047
Join Date: Mar 2011
Tutorial Tri-Color LED Notifications

Quick guide for a tri-color notification. This guide will show you how to make a notification LED flash green, red, and blue real fast as opposed to just one color.

Working better now, last issue to resolve is how to reset the LED for charging back to the correct state after the LED scripts and Tasker tasks are run.

Please note this is for a Samsung Galaxy S3. I now have a Nexus 5 and the LED works differently so you may have to research on what works for your phone in terms of notification triggering. Root will be required.

1. Make a file on your sdcard (name it whatever you want) called ledscript.sh.
2. Copy this into the file and save it:
#!/bin/bash
while (true);
do
echo 1 > /sys/devices/virtual/sec/led/led_pattern
sleep 0.1
echo 5 > /sys/devices/virtual/sec/led/led_pattern
sleep 0.1
echo 6 > /sys/devices/virtual/sec/led/led_pattern
sleep 0.1
echo 0 > /sys/devices/virtual/sec/led/led_pattern
done
3. Create a profile for any notification you want to have the tri-color LED.
4. Now create a task that runs a shell script.
For Comand type this: . /sdcard/ledscript.sh (Please don't forget the period and space before the slash)
Also check Use Root.
5. Create another profile that will trigger a task to kill the script.
***Please note, I don't have service on this phone so I tested this with "Display On" > then run the script, then "Display Off" > kill the script. You may have to experiment.
6. Now create a task again that runs a shell script.
For Command type this: killall sh
Also check Use Root.
7. From your Profiles tab, tap your profile that is set up to kill the script.
8. Long press on the associated task and select New Task.
9. Make another shell script task with this command: echo 0 > /sys/devices/virtual/sec/led/led_pattern
Also check Use Root.

So to sum it up, when I turn off my display, I get the flashing lights. When I turn the display on the script gets killed and then a second task sets the LED state back to 0 which is OFF. I had to make it two tasks because the killing of the script and resetting back to 0 was not working in a singular task.

***Another thing I'm still working on is if you are charging and then the LED is set back to 0, I haven't figured out what triggers the charging LED. So you would have to unplug/replug to get it to show your charging LED.

For the script, you can play with setting sleep values. I believe sleep value is in seconds so 0.1 seconds to whatever value you want.

Also, colors can be manipulated but you may need to experiment and find out what values control which colors and so on.

I credit the discovery of the commands to this XDA post. After some additional research there are other XDA posts that pretty much reference a very similar method of what we are doing here so I guess more people were interested in it as well.

http://forum.xda-developers.com/show....php?t=1989664

Have fun!

PS - if you have a Nexus 5 and can figure out something similar please help me out! I know there are trigger events in /sys/class/leds/{color} but haven't yet figured out how to pass the values with the echo command. Still working on it.
 
taisto
Old
(Last edited by taisto; 26th December 2013 at 07:06 PM.) Reason: typo
#4522  
Junior Member
Thanks Meter 7
Posts: 23
Join Date: Jan 2011
Location: Turku
Quote:
Originally Posted by TomTcom View Post
Quick guide for a tri-color notification. This guide will show you how to make a notification LED flash green, red, and blue real fast as opposed to just one color.

Sorry guys, just realized the killall sh won't reset the LED back to normal state withou an action like plugging power back in or restarting the phone. I'll keep working on it. We need to pass a 0 value after killing the script but I run into an error. Sorry about that but if anyone has better or more elegant ideas let me know.

Please note this is for a Samsung Galaxy S3. I now have a Nexus 5 and the LED works differently so you may have to research on what works for your phone in terms of notification triggering. Root will be required.

1. Make a file on your sdcard (name it whatever you want) called ledscript.sh.
2. Copy this into the file and save it:
#!/bin/bash
while (true);
do
echo 1 > /sys/devices/virtual/sec/led/led_pattern
sleep 0.1
echo 5 > /sys/devices/virtual/sec/led/led_pattern
sleep 0.1
echo 6 > /sys/devices/virtual/sec/led/led_pattern
sleep 0.1
echo 0 > /sys/devices/virtual/sec/led/led_pattern
done
3. Create a profile for any notification you want to have the tri-color LED.
4. Now create a task that runs a shell script.
For Comand type this: . /sdcard/ledscript.sh (Please don't forget the period and space before the slash)
Also check Use Root.
5. Create another profile that will trigger a task to kill the script.
***Please note, I don't have service on this phone so I tested this with "Display On" > then run the script, then "Display Off" > kill the script. You may have to experiment.
6. Now create a task again that runs a shell script.
For Command type this: killall sh
Also check Use Root.

So to sum it up, when I turn off my display, I get the flashing ligths. When I turn the display on the script gets killed so the LED returns to normal state.

It's possible that if you are charging your phone and the LED script gets killed on Blue that your charging color could be blue. All you need to do is unplug/replug and it will go back to normal. If your script doesn't get killed for some reason, you will have to reboot the phone to get it to stop flashing.

For the script, you can play with setting sleep values. I believe sleep value is in seconds so 0.1 seconds to whatever value you want.

Also, colors can be manipulated but you may need to experiment and find out what values control which colors and so on.

I credit the discovery of the commands to this XDA post.
http://forum.xda-developers.com/show....php?t=1989664

Have fun!

PS - if you have a Nexus 5 and can figure out something similar please help me out! I know there are trigger events in /sys/class/leds/{color} but haven't yet figured out how to pass the values with the echo command. Still working on it.
How is this done in Mediatek(MT6589) based devices. Anyone knows ?

Help appreciated !
 
MobiMikes
Old
#4523  
MobiMikes's Avatar
Senior Member
Thanks Meter 50
Posts: 158
Join Date: Aug 2012
Quote:
Originally Posted by Iceman248 View Post
Was there ever a solution to this? What I want to do is create a notify with sound action that basically reminds me to pack a box into my trunk that has various parts in it that I only want in my trunk when I go on jobs. Well, I cannot remember to do this very well, so I need a regular reminder one hour before start time of basically every calendar event that I have. I have everything programmed except I don't know how to tell it to send this an hour before event beginning. Any ideas? Thanks.
I found the easiest way to do this was by using the brilliant "Calengoo" app which has tasker support.

Sent from my speak and spell.
 
PhilipTD
Old
#4524  
PhilipTD's Avatar
Senior Member
Thanks Meter 361
Posts: 1,712
Join Date: Dec 2010
Location: NYC
The Input Type task fails to type quote marks. Anyone know a workaround? Thanks

Sent from my Nexus 5

ONEPLUS ONE STOCK (ROOTING NOW)
NEXUS 5 D820 STOCK KK444 FK XPOSED TWRP

 
 
nyx528
Old
#4525  
nyx528's Avatar
Senior Member
Thanks Meter 43
Posts: 177
Join Date: Dec 2009
Location: Bloomington, MN
Quote:
Originally Posted by Iceman248 View Post
Was there ever a solution to this? What I want to do is create a notify with sound action that basically reminds me to pack a box into my trunk that has various parts in it that I only want in my trunk when I go on jobs. Well, I cannot remember to do this very well, so I need a regular reminder one hour before start time of basically every calendar event that I have. I have everything programmed except I don't know how to tell it to send this an hour before event beginning. Any ideas? Thanks.
Try Locale Calendar Plugin
https://play.google.com/store/apps/d...r.localePlugin

~ from my Moto X
"Because I'm Batphone"
 
bew78
Old
#4526  
Junior Member
Thanks Meter 1
Posts: 9
Join Date: Nov 2013
Hello, I'm trying to do a task that show me the list of installed apps, I choose one, then create a notification for this app. If I tap on the notification, the app launch...

I don't really know how to use Intent to perform this, I hope you can help me !

Thanks
Bew

Sorry for my English, I'm french...
 
danlocke123
Old
#4527  
Member
Thanks Meter 5
Posts: 59
Join Date: Jul 2010
Hi there,

Can someone guide me as how to set this up: I want to set a profile for when I am at College- I will worry about what I want the profile to do.

My college timetable is completely irregular, i.e. every day I am in for different hours. How can I set up a universal profile that will run between a specific time on each day, e.g on Monday I need it active between 8.30-1.30, on Tuesday 2.00-4.30 etc.

Can someone help?

Thanks,

Dan
 
nyx528
Old
(Last edited by nyx528; 27th December 2013 at 03:32 PM.)
#4528  
nyx528's Avatar
Senior Member
Thanks Meter 43
Posts: 177
Join Date: Dec 2009
Location: Bloomington, MN
Quote:
Originally Posted by danlocke123 View Post
Hi there,

Can someone guide me as how to set this up: I want to set a profile for when I am at College- I will worry about what I want the profile to do.

My college timetable is completely irregular, i.e. every day I am in for different hours. How can I set up a universal profile that will run between a specific time on each day, e.g on Monday I need it active between 8.30-1.30, on Tuesday 2.00-4.30 etc.

Can someone help?

Thanks,

Dan
There are a couple of ways you could go about this.
You can use calendar events or times.
The calendar one would require events for your classes to either be named something specific or with certain word or phrase in the description. This also only requires one profile if all the events are going to set the same task.

The other method is to use times and days for the actions and then set your task. Since many profiles are needed for this one, it would be best to have it in it's own tab.

EDIT:
I thought of a third one. You could use auto-location plugin to create a geofence around your school & you wouldn't need to worry about times or events.

~ from my Moto X
"Because I'm Batphone"
The Following User Says Thank You to nyx528 For This Useful Post: [ Click to Expand ]
 
danlocke123
Old
(Last edited by danlocke123; 27th December 2013 at 04:00 PM.)
#4529  
Member
Thanks Meter 5
Posts: 59
Join Date: Jul 2010
Quote:
Originally Posted by nyx528 View Post
There are a couple of ways you could go about this.
You can use calendar events or times.
The calendar one would require events for your classes to either be named something specific or with certain word or phrase in the description. This also only requires one profile if all the events are going to set the same task.

The other method is to use times and days for the actions and then set your task. Since many profiles are needed for this one, it would be best to have it in it's own tab.

EDIT:
I thought of a third one. You could use auto-location plugin to create a geofence around your school & you wouldn't need to worry about times or events.

~ from my Moto X
"Because I'm Batphone"
Ok the calendar method definitely sounds like the most sensible option. I've added recurring events to my google calendar, including all the times I'm in college.

How do I link these events in the calendar to a new profile in Tasker?

Thanks

EDIT: FYI each event is simply called 'College'

EDIT (again): Never mind, I've successfully linked it to the event

---------- Post added at 04:22 PM ---------- Previous post was at 03:42 PM ----------

Quote:
Originally Posted by nyx528 View Post
There are a couple of ways you could go about this.
You can use calendar events or times.
The calendar one would require events for your classes to either be named something specific or with certain word or phrase in the description. This also only requires one profile if all the events are going to set the same task.

The other method is to use times and days for the actions and then set your task. Since many profiles are needed for this one, it would be best to have it in it's own tab.

EDIT:
I thought of a third one. You could use auto-location plugin to create a geofence around your school & you wouldn't need to worry about times or events.

~ from my Moto X
"Because I'm Batphone"
How much battery will using a location-based solution use? I'm using an n5 btw
 
nyx528
Old
#4530  
nyx528's Avatar
Senior Member
Thanks Meter 43
Posts: 177
Join Date: Dec 2009
Location: Bloomington, MN
Quote:
Originally Posted by danlocke123 View Post
Ok the calendar method definitely sounds like the most sensible option. I've added recurring events to my google calendar, including all the times I'm in college.

How do I link these events in the calendar to a new profile in Tasker?

Thanks

EDIT: FYI each event is simply called 'College'

EDIT (again): Never mind, I've successfully linked it to the event

---------- Post added at 04:22 PM ---------- Previous post was at 03:42 PM ----------



How much battery will using a location-based solution use? I'm using an n5 btw
If you use the Auto-location plugin with geofences it uses very little battery.

~ from my Moto X
"Because I'm Batphone"

Tags
beginners, guide, noobs, tasker
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes