If you don't have a bluetooth speaker in your car capable of answering phone calls or texts, and if you drive a lot you'll find yourself needing a way to respond to important messages without distracting yourself too much. Thanks to Tasker, you can make it so that you are prompted to respond to calls/texts and read notifications.
Prerequisites
Root Access to automatically answer calls
Secure Settings plugin
AutoNotification or Notification Listener to grab the notification text
We'll be making three profiles as a part of our driving mode setup. First up, an incoming call profile.
{
"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"
}
Instructions
First profile you will make should be called "Driving Mode - Incoming Call"
Create an Event context, go to Phone --> Phone Ringing. Leave the caller field blank. Exit out, and create a new task. You can name it if you want, but it's not necessary.
Once inside the task, your first action will be to create a Say command. Go to Alert --> Say. For the text you want the TTS to say, type in something like
Code:
Incoming call from %CNAME would you like to answer?
I would recommend you uncheck "Respect Audio Focus" so Tasker notifying you of a call will take precedence over whatever other audio is playing from your phone.
Input --> Get Voice. Go to Label and make it "DECIDE". You will come back to this action with a Goto later.
Task --> If. Set it to if %VOICE ~ Yes. Basically, if you saw "yes" then you've chosen to answer the call.
Plugin --> Secure Settings. Root Settings --> Phone Options. Pick "Answer Call."
Audio --> Speakerphone. Set it to On.
Task --> Else If. Set it to if %VOICE ~ No. This is if you choose to not answer the call.
Plugin --> Secure Settings. Root Settings --> Phone Options. Pick "End Call."
OPTIONAL: Phone --> Send SMS. Number should be %CNUM. Send a message with whatever you want telling them you're busy, for instance:
Code:
I am currently driving. I will respond back to you as soon as I am able. Thank you.
Task --> Else
Task --> Goto. Set type to "Action Label." Go to label "DECIDE" which is Action Number 2.
Task --> End If
Exit out, and finally, you will need to add one more context to the profile in order to ensure that this profile ONLY runs when you are actually driving. One way you can do this is to create a context connected to your car's bluetooth, you can make a shortcut on your homescreen to turn the task on/off when you get in the car, you can scan an NFC tag, you use location geofences ala AutoLocation, etc. For me, I use an NFC tag.
Here are screenshots of the task:
Next up, the notification reader:
Create a new Profile and title it "Driving Mode - Read Notification"
Create an Event context, go to Plugin --> AutoNotification and pick Intercept. Go to the apps to intercept and select only the apps that produce notifications that you think are important enough to bother you while driving. I'm sure you're not interested in knowing you're being invaded in Clash of Clans while driving....right?
Exit and create a task. Name it anything.
Alert --> Say. For the text, put %antitle. Check If and make it if %antitle is Set.
Alert --> Say. Make the text %antext. Check If and make it If %antext is Set.
Alert --> Say. Make the text %ansubtext. Check If and set it to If %ansubtext is Set.
If you are using Notification Listener instead, simply change %antitle to %nltitle, change %antext to %nltext, and change %ansubtext to %nlsubtext.
Exit out, and finally, you will need to add one more context to the profile in order to ensure that this profile ONLY runs when you are actually driving. One way you can do this is to create a context connected to your car's bluetooth, you can make a shortcut on your homescreen to turn the task on/off when you get in the car, you can scan an NFC tag, you use location geofences ala AutoLocation, etc. For me, I use an NFC tag.
Here is a screenshot of the task:
Finally, a text message response profile:
Create a new profile and name it "Driving Mode - Read Text."
Go to Event --> Phone --> Received Text. Make the Type Any and leave everything else blank.
Now, we'll create the task. Leave the name blank.
Alert --> Say. Make it say the following:
Code:
%SMSRN says %SMSRB. Would you like to respond?
Input --> Get Voice. Label it "REPEAT".
Task --> If. Set it to if %VOICE ~ Yes.
Input --> Get Voice. Label it "AGAIN."
Variables --> Variable Set. Set name to %voice and set it to %VOICE.
Alert --> Say. Make the text this:
Code:
%VOICE. Is this okay?
Input --> Get Voice.
Phone --> Send SMS. The number should be set to %SMSRF. Go down and add an If statement to this task, and set it to If %VOICE ~ Yes
Task --> Goto. Set the type to "Action Label" and set the label to "AGAIN."
Task --> Else If. Set it to if %VOICE ~ No
Phone --> Send SMS. Set the number to %SMSRF. Make the message something like this:
Code:
I am currently driving. I will respond back to you as soon as I am able. Thank you.
Task --> Else
Task --> Goto. Set type to "Action Label" and make the label "REPEAT."
Task --> Else If.
Here are screenshots of the task:
And that's it! Enjoy the profiles and let me know. I've attached the XMLs below you can import by moving them to /sdcard/Tasker/Profiles and then long-pressing on the Profiles tab up top while in Tasker and clicking on Import.
Input --> Get Voice. Go to Label and make it "DECIDE". You will come back to this action with a Goto later.
Click to expand...
Click to collapse
I do not have this option to sett Label? All I can set is Title?
Edit: I had to untick beginner mode in preferences
I also noticed that voice command does not work when writing "Yes", it has to be "yes" with small letters. If anyone else is facing simular troubles.
olskar said:
Input --> Get Voice. Go to Label and make it "DECIDE". You will come back to this action with a Goto later.
I do not have this option to sett Label? All I can set is Title?
Edit: I had to untick beginner mode in preferences
I also noticed that voice command does not work when writing "Yes", it has to be "yes" with small letters. If anyone else is facing simular troubles.
Click to expand...
Click to collapse
Doh! You're right, I've had Tasker enabled for so long that I forgot that Tasker hides that by default. And thanks for the correction on the voice part. My autocorrect screwed that up
How can I force the audio through the phone speaker versus Bluetooth if connected?
I want my whatsapp messages to be read through the speaker versus Bluetooth while I am driving only.
jskala said:
How can I force the audio through the phone speaker versus Bluetooth if connected?
I want my whatsapp messages to be read through the speaker versus Bluetooth while I am driving only.
Click to expand...
Click to collapse
That's not something Tasker can do, sorry. Get the app SoundAbout
jskala said:
How can I force the audio through the phone speaker versus Bluetooth if connected?
I want my whatsapp messages to be read through the speaker versus Bluetooth while I am driving only.
Click to expand...
Click to collapse
You can use BlueTask plugin
Hi, nice works!!
Question: can an email be fully read?
Regards,
What can I use instead of secure settings to pick up the call? Secure settings is bugged nowadays can't find root
Read Notification profile not importing
I can't get the Read Notification .prf.xml file to import at all. Anyone else experience this or can tell me what I might be doing wrong or if the file has an error in it? The other two imported just fine.
Thanks in advance for any assistance and clarification.
Related
Since tasker can be complicated ive tried to make this as simple as possible even though it might not seem like it. This is my first tutorial so constructive criticism and comments are appreciated!
NOTE: If you dont know what Tasker is research it and what it does otherwise you wont understand this tutorial.
1. Setting up the first profile
A. Okay first we need to start a new profile in tasker by clicking "new" on the bottom.
Name it whatever you want or leave it blank.
Your first profile should look like this once completed:
{
"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"
}
2. Setting when your context so tasker will know when its supposed to do something
A. You want your context to be "received text".
Choosing through menus go to "Event>Phone>Received Text"
3. Setting up what tasker is supposed to do when the "conditions/context" are met
A. Next we need a task, name it whatever you want or leave it blank. Add a task by clicking the plus on the bottom left. When choosing actions you want to navigate to "Variable>Variable Set"
When setting up this variable, you want it to look like this:
Make sure there are spaces between the + and 1 and "Do Maths" is checked otherwise it wont display right.
4. Setting up tasker so it will send the sms count to Minimalistic Text widget
A. Add a 2nd task by clicking the plus on the bottom left. When choosing an action navigate to "Plugin>Minimalistic Text variable settings. The settings will show up, set them up like this:
Okay so we've set up a profile to add a 1 to the count everytime you have a new text. Problem is, we have to set up another profile to reset the count to 0 after youve read your texts
5. Setting up the 2nd profile so your sms app to reset the count to 0 when closed
A. Start a new profile, name it or not, and add a context of "Application>whatever messaging app you use here". I use chompsms so for me its "Application>chompsms".
It will look like this when completed:
B. Set up the new variable like so:
This will reset the counter to zero everytime you close out of your messaging app
EDIT: its also possible to have not have the zero displayed so theres nothing there. Instead of using "variable set" use "variable clear" with the variable your using.
THANKS: ayhaadam for reminding me of this
C. Add one more variable to have Tasker display it through Minimalistic text. Its the same set up as step 4A
6. Setting up minimalistic text to display tasker variables
A. Create a new minimal text widget on your homescreen/lockscreen and choose "custom layout". Add "Locale Variable" from Misc and set up the variable name to be % MNMLMSGCOUNT
NOTE: Minimal text will not add "SMS" or "MESSAGES" in front of the count. You have to manually add it with "Static Text" under Misc
Exapmles of how i use it:
Please leave questions or comments if you have them and since i did this on my phone i will check how it looks on a computer soon
Thanks: thedesolatesoul for explaining to me how to set this up! He should post a screen of his so we'll see how his is set up
Update 2-10
Missed Call Count: call count is achieved by following the tutorial and changing "MSGCOUNT" to "MISSEDCALL" and changing the 2nd profile app to phone
Update 2-11
Unread Email Count: this works with only K-9 since its open source. Same set up for sms count just different context "K9 Email Received" and different variable "%UNREADEMAILCOUNT". The 2nd profile context to set it to zero is app "K9"
thanks for the guide! this is wayy shorter than the other variants
i think a couple images are missing though
I appreciate you posting this.. always looking for new ways to use Tasker.. I've only scratched the surface so far..
Thanks guys! Ill add more pictures too
Do you have any other cool things you've done with Tasker?
rrambo said:
Do you have any other cool things you've done with Tasker?
Click to expand...
Click to collapse
Ive only used it for sms but you can use it for weather, call count, battery, just about anything
Great TUT, thank-you very much!
giank30 said:
Great TUT, thank-you very much!
Click to expand...
Click to collapse
No problem
Hi,
Awesome, I will try !!
Edit : I succeed everything, only one. When I go in Minimalistic, I create my own, and in my homescreen there is : "SMS : " but no 0 with ..
Have you got any idea?
( I am so sorry for my bad english, I hope you understand..)
Loam1990 said:
Hi,
Awesome, I will try !!
Edit : I succeed everything, only one. When I go in Minimalistic, I create my own, and in my homescreen there is : "SMS : " but no 0 with ..
Have you got any idea?
( I am so sorry for my bad english, I hope you understand..)
Click to expand...
Click to collapse
Try going into your sms app and then hitting home or back
Nothing happens
I don't understant, I did like you said
In minimalistic, it's writing : "SMS[LOCTV]
Loam1990 said:
Nothing happens
I don't understant, I did like you said
In minimalistic, it's writing : "SMS[LOCTV]
Click to expand...
Click to collapse
Did you set LOC to %MNMLMSGCOUNT?
In "Variable Name" ? I did..
Great post!
Loam1990 said:
In "Variable Name" ? I did..
Click to expand...
Click to collapse
Hmm im not sure. With the app profile make sure your variable is set "To 0"
It is in "To 0"...
Maybe I found the problem ! Tasker says me "no profil active", is it the problem ? How can I active my profil ?
Sorry for all my questions
Loam1990 said:
It is in "To 0"...
Maybe I found the problem ! Tasker says me "no profil active", is it the problem ? How can I active my profil ?
Sorry for all my questions
Click to expand...
Click to collapse
Haha its alright. Make sure all your profiles are checked on the right and in the bottom right make sure the on is green like so:
Then hit apply and it should work fine
I don't understand, everything looks good, but nothing happens ! I don't understand
Loam1990 said:
I don't understand, everything looks good, but nothing happens ! I don't understand
Click to expand...
Click to collapse
Do you have a task killer running? Im not sure if it matters with tasker but i always set it to "ignore"
Our next option - post your screens of your tasks from the task edit menu
Sent from planet earth
Nice work akoe...i like the direction this is heading in
Loam1990,
You need to break down what actually isnt working
First find out if the context is being triggered, then find out if the task is working, then find out why the variable isnt reaching minimalistic text
...and easy way to do this is go into the tasks you made for clearing the count, and press the 'Test' button at the bottom
If it works it means your tasks are fine and your context is wrong
otherwise your context is right but your tasks/variables are wrong
anyways...just wanted to post my screenshot too
Introduction:
So you have a Pebble and you love how you can check your emails and mute your boss's call without even looking at your phone?
It's all really cool, but if you're anything like me, that's just not enough. You want to do more with even less effort.
How can we expand the possibilities to near-infinity?
With the help of three awesome apps:
- Tasker [Paid]
- AutoPebble [Free/Paid]
- PebbleTasker [Paid]
Other apps mentioned in this guide:
- Canvas for Pebble [Free]
- Calendar for Pebble [Free]
Note: You can use the free version of AutoPebble, but Tasker is a must.
I believe most of you know how powerful tool Tasker is, so imagine all those possibilities on your wrist and let's do something practical:
The Basics of AutoPebble:
Every watchapp, that has a companion app or a settings in the Pebble app communicates through the Pebble app itself.
AutoPebble's purpose is to intercept and filter these communications right from Tasker and execute tasks accordingly.
My favorite feature is the ability to start watchapps on your Pebble.
One of my profile:
When I press button DOWN in Canvas it will load the Calendar watchapp.
1) To be able to load an app, we need to know the apps UUID (it's an id that is unique to every app):
a) start the AutoPebble app on your phone (you don't have to install the watchapp, it is for more advanced stuff) and make sure the "Automatically Detect" is ticked.
{
"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"
}
b) now start the Calendar watchapp on your Pebble, AutoPebble should recognise its UUID.
c) in AutoPebble open "Manage Other Pebble Apps" and longpress on the new entry, it is convenient to rename it to Calendar, now longpress again and Enable it
(if AutoPebble doesn't recognise an app, you have to manually type in the UUID, Calendar's one is: b41e3dcf-6162-4147-9c58-643e1091fb93)
d) now you have to do the same with Canvas (it's UUID is 654db887-5135-4b22-be8b-2e1b5c0cb49d)
(you have to do this procedure for every watchapp you'd like to interact with)
2) Open Tasker and create a new task:
a) add an action to it: Plugin->AutoPebble App
b) click on Configuration and scroll down to Other Pebble App, choose Calendar from the list
c) click on Action and choose Open
Note: now if you execute the task, the Calendar watchapp should start on your Pebble
3) Check the buttons and values we want to trigger the task:
a) open AutoPebble app on your phone
b) check Log other Apps
c) go to Log Listing
d) press the button on your Pebble while in Canvas (Canvas' button's are 200 and values are CL_S1 for UP, CL_S2 for SELECT and CL_S3 for DOWN)
4) Open Tasker and create a new profile:
a) choose State->Plugin->AutoPebble Other App
b) click on Configuration
c) App: Canvas
d) Direction: Watch To Phone
e) Key Filter: 200
f) Value Filter: CL_S3
Important: to make this work, uncheck every watchface in the Canvas app, except the active one
Now if you press the DOWN button while in Canvas, Tasker will catch the command and launch the Calendar watchapp.
Additional notes: This only works with watchfaces that actually send commands to the phone and sadly the BACK button cannot be intercepted.
PebbleTasker:
PebbleTasker is a handy watchface, that lets you execute any Tasker task on your phone. I'm no Tasker guru, but I use it to mute my phone, turn on/off tethering, and launch more watchfaces.
If you launch the PebbleTasker app on your phone, you can assign 3 Tasker task to the three button and one-one to longpress UP/DOWN.
If you click on "More..." and "Select Tasks for menu" you can assign another 20 tasks to the list which comes up if you longpress SELECT.
Tip: If you create an AutoPebble App task with a "Key filter: 0" you can start Canvas (or anything) on a button press in PebbleTasker while the task is being executed on your phone.
Outro:
This guide only covers the very basics of these awesome apps, but if you grasp these concepts you can do pretty much anything Tasker can do without taking out your phone and make app switching on your Pebble more dynamic.
I hope you appreciate my guide and find it useful. :fingers-crossed:
Not so bright... I have the calendar on Pebble but can't do anything with it. This step:
d) press the button on your Pebble (Canvas' button's are 200 and values are CL_S1 for UP, CL_S2 for SELECT and CL_S3 for DOWN)
WHICH button on my Pebble?
@rogerperk:
The one you want to use to start calendar. It can be any one of the UP, SELECT, DOWN.
This step's reason is to see what commands the buttons in different watchapps send to the phone (or to check if they send any).
Erovia said:
@rogerperk:
The one you want to use to start calendar. It can be any one of the UP, SELECT, DOWN.
This step's reason is to see what commands the buttons in different watchapps send to the phone (or to check if they send any).
Click to expand...
Click to collapse
Yeah, that's what I thought. Can't seem to get it to work though. Let me try again... Can't get it to pull up though. I lose it at setp 4 - Create Another State.
@rogerperk: I've just realised I've made a few mistakes and corrected them.
Erovia said:
@rogerperk: I've just realised I've made a few mistakes and corrected them.
Click to expand...
Click to collapse
Well I must be doing something wrong because I get to step 3 (check buttons) and it doesn't work.
You have Canvas and Calendar in AutoPebble's "Manage Other Pebble Apps" list?
Are they enabled?
Is "Log other Apps" turned on?
Is there any info in the "Log listing"?
erovia said:
you have canvas and calendar in autopebble's "manage other pebble apps" list?
are they enabled?
is "log other apps" turned on?
is there any info in the "log listing"?
Click to expand...
Click to collapse
yes
yes
yes
yes. A bunch of in app licence success notifications.
@rogerperk: You have to be in Canvas to catch its button values.
Erovia said:
@rogerperk: You have to be in Canvas to catch its button values.
Click to expand...
Click to collapse
Maybe I"m missing something. I now have calendar and weather on my up and down buttons. But I thought they would open those programs from my main watchface, which is a Canvas face. Instead I have to go into PebbleTasker, through the menu, on my watch and activate them. Is that right??
PebbleTasker simply starts Tasker tasks on your phone. To be able to use the buttons we have to use AutoPebble.
Also, Canvas have to be installed as a watchapp, because watchfaces can't send commands to your phone.
If you're the kind who likes to post screenshots of your device (...like, say, you're making a picture guide to help people with Tasker tasks ), then you'll probably find it a bit tedious having to manually open your screenshot in an image editor app, edit it, and then manually uploading the edited file to an image hosting service such as Imgur. If you would like to automate some of these steps, then look no further!
Please note that my guide is set up with some particular free apps that I'm using, but it can be generalized to edit in other image editor apps or upload to other hosting services so long as you find out the proper intent. Thankfully, you can use apps such as Intent Intercept to capture the proper intent you'll need. On the other hand, I'm also using a few paid apps to make things a bit easier, but if you're getting into Tasker I highly recommend you purchase them as it will make things significantly easier.
Prerequisites
OPTIONAL: Snackbar Tasker Plugin to implement the prompt. Can be replicated using a Tasker scene, but Snackbar is free so I recommend grabbing it anyways.
AutoNotification or Notification Listener. You will need either in order to intercept notifications and toast messages.
OPTIONAL: AutoShare. You can use regular intent broadcasts from within Tasker to do this, but if you don't know what intent to use then AutoShare can help.
Uploader for Imgur (or any other hosting app with a sharing receiver)
Instructions
Enable the notification listener for AutoNotification or Notification Listener in Settings. Enable the Accessibility service for either app so it can intercept toast notifications.
Open a new profile and name it 'Screenshot Edit.'
Create an Event context and go to Plugin --> AutoNotification/Notification Listener and set it up to listen to the screenshot posted notification. Here's the information you'll need to do so. I recommend you set it to react to Only Created Notifications so it doesn't trigger when the notification is dismissed.
Code:
Notification Title: Screenshot captured.
Notification Text: Touch to view your screenshot.
Package Name: com.android.systemui
Exit the configuration for AutoNotification and create a new task named whatever it is you want. For me, I left the name blank because I won't be using the task anywhere else.
{
"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"
}
Now for the task...
Plugin --> Snackbar Tasker Plugin. For the title, put "Edit Screenshot?" or whatever else you want. For the items, put 'Yes,No.' For the commands, put 'yes,no.' Edit the colors to theme the snackbar however you would like.
Task --> If. Set it to %bs_command ~ yes. This is so you'll only edit/upload the screenshot if you want, otherwise it'll do nothing.
Code --> Run Shell. You'll want to run the following command:
Code:
ls /sdcard/Pictures/Screenshots
Write %File under "Store Output In". This will get the filenames of all the screenshots you have in your screenshot folder and put it into a variable.
Variables --> Variable Split. Under name put %File, but leave Splitter blank. This splits the filename variable into an array from File1...FileN with each variable holding an individual filename.
Variables --> Variable Set. Under name put %new and set it to %File(#). This gets the pointer to the latest filename in the filename array.
Variables --> Array Pop. Under Variable put %File, for the Position put %new, and for the To Var put down %file. In %file now you've got the filename of the screenshot you just took!
System --> Send Intent. This is the intent information you'll need to fill in:
Code:
Data: file:///storage/emulated/0/Pictures/Screenshots/%file
Package: com.iudesk.android.photo.editor
Class: app.activity.PhotoViewActivity
Target: Activity
If you have AutoShare installed like I recommended, then you can easily use its find intent option to find and automatically fill in most of this information. You will still need to manually specify the file using the %file variable, though.
Task --> End If.
Okay, so what we've done so far is set-up Tasker to automatically send the screenshot you took to your image editor app. Now you'll want it to automatically upload it to Imgur. Take note of which folder you're saving your edited screenshots in, because you'll need to reference it below when sending the path to the edited file.
Create a new Profile and name it Screenshot Upload.
Create an Event context, go to Plugin and choose AutoNotification Toast Intercept.
Choose Photo Editor for the app you want to intercept, and for the Notification Text you want to intercept write down "saved successfully."
Back out, and create a task with any name you want.
Code --> Run Shell. For the command, put this down:
Code:
ls /sdcard/Pictures/Edited
For Store Output In, put it in %File (just like the previous task).
Variables --> Variable Split. Split %File.
Variables --> Variable Set. Set name as %new and set it to %File(#)
Variables --> Array Pop. For variable put %File, under position put %new, and in the to var put %file.
System --> Send Intent. Here's the information you need:
Code:
Package: net.moosen.imgur
Class: net.moosen.imgur.DoUpload
Data: file:///storage/emulated/0/Pictures/Edited/%file
That's it! Enjoy the new automation of screenshot editing. You can go a little further to automate things by perhaps immediately sharing the Imgur link to your app of choice or push it with Pushbullet, but that's up to you. For me, this profile has been an immense help in putting together these guides. Let me know if there are any changes you would make.
Very cool implementation! I use literally the same setup to help with screenshots, but with some different Actions in certain places. My setup is like:
AN Intercept, AN click action for the notification, then use AutoInput to go through some steps to get to a very specific screen in a specific editor. Then a Profile for 'Gesture' (when I tilt the device to the left) uses AutoShare to share the file over to the (new plugin) AutoWeb API for direct upload to Imgur, then when the link comes back it puts it in the Clipboard and shows a Snackbar to confirm upload complete.
Definitely take a bit of time to setup, but it works like magic and sooo fast and automated it's well worth it!
Ratchet_Guy said:
Very cool implementation! I use literally the same setup to help with screenshots, but with some different Actions in certain places. My setup is like:
AN Intercept, AN click action for the notification, then use AutoInput to go through some steps to get to a very specific screen in a specific editor. Then a Profile for 'Gesture' (when I tilt the device to the left) uses AutoShare to share the file over to the (new plugin) AutoWeb API for direct upload to Imgur, then when the link comes back it puts it in the Clipboard and shows a Snackbar to confirm upload complete.
Definitely take a bit of time to setup, but it works like magic and sooo fast and automated it's well worth it!
Click to expand...
Click to collapse
Glad to see you here! I was actually inspired by your thread on /r/tasker, however, I didn't like the implementation that relied a bit too much on AutoInput in my view, so I thought to generalize it a bit using intents and shell commands.
MishaalRahman said:
Glad to see you here! I was actually inspired by your thread on /r/tasker, however, I didn't like the implementation that relied a bit too much on AutoInput in my view, so I thought to generalize it a bit using intents and shell commands.
Click to expand...
Click to collapse
Thanks! Glad to be here! Tasker Week has been great. Awesome to see the effort and detail that went into the Guides and Tutorials, screenshots and all.
Speaking of screenshots (lol) yes I was having lots of fun with AutoInput clicking around everywhere Eventually I did condense certain portions of it, but one thing I noticed is that depending on the imaging app, using an AutoShare Intent didn't quite get it to the exact screen I was looking for. Of course the beauty of Tasker is that just about anything can be customized for your exact/specific needs
MishaalRahman said:
Now for the task...
Plugin --> Snackbar Tasker Plugin. For the title, put "Edit Screenshot?" or whatever else you want. For the items, put 'Yes,No.' For the commands, put 'yes,no.' Edit the colors to theme the snackbar however you would like.
Task --> If. Set it to %bs_command ~ yes. This is so you'll only edit/upload the screenshot if you want, otherwise it'll do nothing.
Code --> Run Shell. You'll want to run the following command:
Code:
ls /sdcard/Pictures/Screenshots
Write %File under "Store Output In". This will get the filenames of all the screenshots you have in your screenshot folder and put it into a variable.
Variables --> Variable Split. Under name put %File, but leave Splitter blank. This splits the filename variable into an array from File1...FileN with each variable holding an individual filename.
Variables --> Variable Set. Under name put %new and set it to %File(#). This gets the pointer to the latest filename in the filename array.
Variables --> Array Pop. Under Variable put %File, for the Position put %new, and for the To Var put down %file. In %file now you've got the filename of the screenshot you just took!
System --> Send Intent. This is the intent information you'll need to fill in:
Code:
Data: file:///storage/emulated/0/Pictures/Screenshots/%file
Package: com.iudesk.android.photo.editor
Class: app.activity.PhotoViewActivity
Target: Activity
If you have AutoShare installed like I recommended, then you can easily use its find intent option to find and automatically fill in most of this information. You will still need to manually specify the file using the %file variable, though.
Task --> End If.
Okay, so what we've done so far is set-up Tasker to automatically send the screenshot you took to your image editor app. Now you'll want it to automatically upload it to Imgur. Take note of which folder you're saving your edited screenshots in, because you'll need to reference it below when sending the path to the edited file.
Create a new Profile and name it Screenshot Upload.
Create an Event context, go to Plugin and choose AutoNotification Toast Intercept.
Choose Photo Editor for the app you want to intercept, and for the Notification Text you want to intercept write down "saved successfully."
Back out, and create a task with any name you want.
Code --> Run Shell. For the command, put this down:
Code:
ls /sdcard/Pictures/Edited
For Store Output In, put it in %File (just like the previous task).
Variables --> Variable Split. Split %File.
Variables --> Variable Set. Set name as %new and set it to %File(#)
Variables --> Array Pop. For variable put %File, under position put %new, and in the to var put %file.
System --> Send Intent. Here's the information you need:
Code:
Package: net.moosen.imgur
Class: net.moosen.imgur.DoUpload
Data: file:///storage/emulated/0/Pictures/Edited/%file
That's it! Enjoy the new automation of screenshot editing. You can go a little further to automate things by perhaps immediately sharing the Imgur link to your app of choice or push it with Pushbullet, but that's up to you. For me, this profile has been an immense help in putting together these guides. Let me know if there are any changes you would make.
Click to expand...
Click to collapse
Hello and thank you for your guide. I was having some problems with getting the snack bar button to do anything but just ask. None of the responses did anything, my video which includes my question in greater detail is here. I wasn't able to put a link in the message because I am a new user so I can't put links in new posts but the YouTube video ID is U2OpwlK2BWc
If one goes to youtube dot com slash U2OpwlK2BWc they can watch the video.
Thanks again,
yonikasz
yonikasz said:
Hello and thank you for your guide. I was having some problems with getting the snack bar button to do anything but just ask. None of the responses did anything, my video which includes my question in greater detail is here. I wasn't able to put a link in the message because I am a new user so I can't put links in new posts but the YouTube video ID is U2OpwlK2BWc
If one goes to youtube dot com slash U2OpwlK2BWc they can watch the video.
Thanks again,
yonikasz
Click to expand...
Click to collapse
Video not loading for me
Video
MishaalRahman said:
Video not loading for me
Click to expand...
Click to collapse
Oh here I figured out how to put YouTube into the forum. Before I was on my mobile so I couldn't do that. Hope that helps.
Yoni
You're a busy person, and you've decided to organize your busy life by placing all your events on Google Calendar. If this describes you, then you might like to know that you can query Calendar for its events and set it up to notify you however you want. This means you don't have to open the app or even display a widget if you want to see what your events for the day are. Here's how.
This guide is based heavily off of the work of redditor CallMeLucky but written to be more friendly and with more documentation. Credits for the implementation go to him.
Prerequisites
Google Calendar
Instructions
Create a new task, and name it "Get Events."
Variables --> Variable Convert. Convert %DATE, set the Function to "Date Time to Seconds" and Store Result In %date.
Variables --> Variable Set. Name %schedstart and set To
Code:
%date + (60*60*6)
This sets the start time to 6AM in the morning. If you want to make it earlier, change the 6 to a different number. CHECK DO MATHS!
Variables --> Variable Set. Name %schedend and set To
Code:
%date + (60*60*24)
This sets the end time to midnight. CHECK DO MATHS!
App --> Test App. Type "Calendar Title", Data %schedstart, Store Result In %event. Set the Label to "TEST NEXT EVENT." This is querying Google Calendar using the time to see if there's an event at that time.
App --> Test App. Type "Calendar Calendar", Data %schedstart, Store Result In %calendar. This is querying the calendar to see, if there's an event, which calendar it belongs to.
Task --> If. If %event(#) neq 0 AND %event1 !~ %doubleevent AND %calendar1 ~ *MYCALENDAR*. This will basically check to see if %event is empty or if it matches the previous event, which in either case means there is no new event at this time. Replace MYCALENDAR with the name of the calendar you want to pull from.
Variables --> Variable Convert. Name %schedstart, set Function to "Seconds to Long Date Time." Store Result In %time. Once you've found an event, convert the time it starts at to a human readable time.
Variables --> Variable Split. Name %time, splitter is 2016. We know what today's date is, so let's split the variable to only give us the time today and not the date.
Variables --> Array Push. Name %calevents, Position 999, Value should be
Code:
%event1, at %time 2
Here, we're pushing the event title and its time into an array that we'll read from later.
Variables --> Variable Set. Name %doubleevent, To %event1. Save the event title so when we do our next check we compare to see if it matches, if so, don't save it again!
Task --> End If.
Variables --> Variable Add. Name %schedstart, Value 900. Increment the time to check next by 15 minutes (ie. move up through the day).
Task --> Goto. Type "Action Label" and label should be "TEST NEXT EVENT". Check If and set it to If %schedstart < %schedend. Basically, loop back if we're still in the same day testing the calendar.
Alert --> Say. Text: "You have no events today." Check If and set it to if %calevents(#) eq 0
Alert --> Say. Text: "You have one event today." Check If and set it to if %calevents(#) eq 1.
Alert --> Say. Text: "You have %calevents(#) events today." Check If and set it to if %calevents(#) > 1.
Task --> For. Variable %eventtosay, Items %calevents). In this for loop, we're simply reading the calendar events we've found in order.
Alert --> Say. Text: "%eventtosay"
Task --> End For.
Here are screenshots of the task:
{
"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"
}
Now you might ask, what do I do with this task? That's up to you! You can have this task run whenever your alarm is dismissed if you're using an app like AlarmPad, or you can make it run when you dismiss an NFC tag using an app like Trigger.
Below, I am attaching the XML file for the task that you can import. IF YOU IMPORT THIS, YOU MUST EDIT ACTION #6 (THE IF ACTION) AND CHANGE *MYCALENDAR*. REPLACE "MYCALENDAR" WITH THE NAME OF THE CALENDAR YOU WANT TO PULL FROM. You can import a task by putting it in /sdcard/Tasker/tasks. Then when inside Tasker, long-press on the Tasks tab up top and press import.
I love this task. I've been using it for a hot minute. I have it run immediately after another task that uses an HTTP get to pull and read the weather for the day as well. Great combo to use with an "Alarm Dismissed" trigger like you suggested.
how about if you have multiple calendars?
jskala said:
how about if you have multiple calendars?
Click to expand...
Click to collapse
Then simply remove the if condition that requires you to set a specific calendar
jskala said:
how about if you have multiple calendars?
Click to expand...
Click to collapse
I second the motion.
I have one exclusively for my work schedule, and one for my personal schedule. It would be ideal to be able to add several calendars at once.
For example, today I had work and a service repair call for my place. Yesterday, I had work, my child had an appointment and a Parent Teacher Meeting all in different calendars. To know that there are three events or all on one schedule that lists the agenda would be cool.
in topic "5", when you say "app" what exactly I have to do? I didn't get it. Sorry I'm a newbie
---------- Post added at 02:56 AM ---------- Previous post was at 02:52 AM ----------
Erlonbie123 said:
in topic "5", when you say "app" what exactly I have to do? I didn't get it. Sorry I'm a newbie
Click to expand...
Click to collapse
omg, nevermind, sorry! lol
You can use just a couple of actions of CalendarTask plugin in order to that.
i love your idea, it's amazing thanks!!
i'm trying to work in a mod: i don't like the voiceover option, i prefer to receive a notification with the list of events. then if i click on the notification it should open the calendar to check the details.
my mod:
- removed 15. alert, 15. alert, 17. alert
- replaced 19. alert with "Notify sound": Title "Daily Agenda"; Text: "%eventtosay"; Action: "open google calendar"; if "%calevents(#) >0
doing like that i receive a notification with sound (i've added the calendar icon too) instead the voice over.
I have 2 problems, i hope you can help me:
1. all the events are showed once at the time in the same notification (e.g. if i have 3 events, i receive a notification with event 1, than change to event 2 and event 3 in few seconds); it would be nice to have a a list with all the events
2. when i click on the action to open the calendar, it opens the calendar in background without closing the notification panel (see the screenshot)
any suggestions??
thanks a lot!!
Great work
Hi, I like the calendar program. I have a question. Where do you get the Calendar Task plugin for reading different events? For example
Personal Calendar: Sister Birthday
Appointments: Dr. Appointment.
Etc.
Another feature that would be good is to read the events out for the week or have a drop down box with selecting By Week or By Day.
I'm trying to make tasker read my events of tomorrow. I changed %date + (60*60*25) and %date + (60*60*48)
Now I want it to say the day and date of tomorrow (for instance "14.03.2016. Tomorrow is Monday.").
I can't use the default variables like %DATE and %DAYW, because they are for the current day.
I already tried converting the schedstart value from seconds back to date.
flash629 said:
Hi, I like the calendar program. I have a question. Where do you get the Calendar Task plugin for reading different events? For example
Personal Calendar: Sister Birthday
Appointments: Dr. Appointment.
Etc.
Another feature that would be good is to read the events out for the week or have a drop down box with selecting By Week or By Day.
Click to expand...
Click to collapse
You find it on the play store obviously
flash629 said:
Hi, I like the calendar program. I have a question. Where do you get the Calendar Task plugin for reading different events?
Click to expand...
Click to collapse
https://play.google.com/store/apps/details?id=com.balda.calendartask
Thanks
j03x2 said:
https://play.google.com/store/apps/details?id=com.balda.calendartask
Click to expand...
Click to collapse
Thanks J03. Now I just have to try and learn it, unless you can give me some hints.
flash629 said:
Thanks J03. Now I just have to try and learn it, unless you can give me some hints.
Click to expand...
Click to collapse
Here you go! You can download an example profile from here:
https://plus.google.com/102582215848134314158/posts/BZfUp88jwc8
hmm
Weather
I like the program, but please forgive me. I'm using this routine but changing MyCalendar to *. For example: --> If %event(#) neq 0 AND %event1 !~ %doubleevent AND %calendar1 ~ *.
That will read ALL my calendars. The problem comes up after reading the "Event" it will keep on telling me the weather. That's what I'd like to stop. I may have 3 events in different calendars and it reads those events plus the weather for each.
I guess what's happening is because the "Events" are in different calendars I get the weather from each.
Is there away I can just get the weather once?
Thanks for your help.
Nice script! I tried using it for my university calendar but unfortunately it doesn't get the events right.
Today I have three events, one from 9:30 till 11:30, one from 11:30 till 13:30 and another one from 13:30 till 14:30. The script says I have 20 events today. It says all the events in 15 minute increments. Thats 5 (hours) x 4 (events per hour) = 20.
How would I solve this issue? Unfortunately this makes the script not very useful.
Please answer
In a previous post it was suggested that taking out the if statement would give you all your events for the day for all your calendars. I took mine out and it said that I had 72 events.
I changes the If statement in line 6 %calendar1 ~ *Appointments* to %calendar1 ~ ** and what I get is double events. For example Work event at 5:30am then again Work event at 7:15. I don't understand this.
I hope this post is monitored.
flash629 said:
In a previous post it was suggested that taking out the if statement would give you all your events for the day for all your calendars. I took mine out and it said that I had 72 events.
I changes the If statement in line 6 %calendar1 ~ *Appointments* to %calendar1 ~ ** and what I get is double events. For example Work event at 5:30am then again Work event at 7:15. I don't understand this.
I hope this post is monitored.
Click to expand...
Click to collapse
You still need the Variables --> Variable Set. Name %doubleevent, To %event1 and the If statement: %event1 !~ %doubleevent otherwise you will get double events like you mentioned.
Thank you MishaalRahman,
I have read numerous solutions to pulling events from Google Calendar, but none so elegant. I have recently discovered phones and more recently discovered Tasker. My skills are quite rusty but with the help others (you included) I am finding my way. This is a wonderful resource.
As some have already pointed out, this is a great task to include in a wake-up profile. However, not all of us work or sleep on a regular schedule. I remember the 'good ole days' when I could get by on just two jobs.
A moving time segment from 'now' to 'set_length' would be ideal. I think I can work that out. But Event location (address) to pass to Google Maps or Waze as a destination is a topic for which I haven't found much information. Do you (or anyone else) have any suggestions?
If you use a WiFi hotspot, you might be interested in monitoring how many devices and which devices are still connected to it. This is useful for when you're sharing your hotspot with friends or family. There is no real way to do this easily in Android, but with some clever shell commands, variable manipulation, and database searching, we can do so using Tasker!
Disclaimer: this is a profile created by redditor StillAzure over on the /r/tasker forum. I have taken the liberty to add comments explaining each step of the process as well as make a few changes to make it work on devices that his implementation does not work on.
Prerequisites
Root Access
Snackbar Tasker Plugin. This is what handles the pop-ups telling you what devices are connected. Not necessary but if you want to just import and forget just install it anyways.
AutoNotification. This handles the notification telling you how many devices are connected by creating a persistent notification.
The IEEE OUI database. Download it at http://standards-oui.ieee.org/oui.txt. I've found that this download server is slow and prone to time-out, so try it a few times until it fully downloads. Move it to /sdcard/Tasker. The redditor's task downloads it automatically but again it could fail and you wouldn't know without a progress bar telling you so.
Instructions
First profile will be the hotspot monitor profile (this is my own creation separate from the redditor's because his method did not trigger the profile):
{
"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"
}
Create a new profile and name it Hotspot Monitor.
Create an Event context and go to System --> Intent Received. Set Action to:
Code:
android.net.wifi.WIFI_AP_STATE_CHANGED
Leave everything else blank.
Enter the task creation, but leave the name blank.
Task --> If. If %wifi_state eq 13. This means the hotspot is active.
Variables --> Variable Set. Set %Hotspot to 1.
Task --> Else.
Plugin --> AutoNotification Cancel. Id: 55555. This will cancel the persistent notification from the hotspot monitor if the hotspot disconnects.
Variables --> Variable Set. Set %Hotspot to 0. This means the hotspot has disconnected.
Task --> End If.
Here's a screenshot of the task:
Next, we'll set up the task that actually looks up the manufacturer of the device connected to your hotspot by using its MAC ID.
Create a task and name it "MAC Lookup"
File --> Test File. Type: Modified. Data: Tasker/oui.txt. Store Result In: %MODIFIED. Check "continue task after error."
Task --> If. If %err Set. Basically, if error is set, it means you don't have the database in the folder, so we'll need to download it.
Plugin --> AutoNotification. Title: OUI Database not found! Text: Downloading the database... Id: Database. Persistent: true.
Task --> Goto. Type: Action Label. Label: DOWNLOAD.
Task --> End If.
Variables --> Variable Set. Name %TODAY to %DATE.
Variables --> Variable Convert. Name %TODAY, Function "Date Time to Seconds."
Variables --> Variable Set. Name %SINCE to (%MODIFIED - %TODAY)/24/60/60. Check "Do Math." This is basically figuring out how many days it has been since the oui.txt has been last modified.
Task --> If. Set it to if %SINCE > 14. If it's been more than 2 weeks since the database has been modified, we'll update it.
Plugin --> AutoNotification. Title: OUI Database outdated! Text: Updating the database... Id: Database. Persistent: true.
Net --> HTTP Get. Severort set to http://standards-oui.ieee.org/oui.txt Make the file output to Tasker/oui.txt
Plugin --> AutoNotification Cancel. Id: Database
Plugin --> AutoNotification. Title: Database has been downloaded. Text: You can now swipe away this notification. Id: Database.
Task --> End If.
Variables --> Variable Clear. Name %MANU. This clears the current array of manufacturer IDs if it's already set (so we'll only get the most currently connected devices to our hotspot).
Variables --> Array Clear. Name %MANU. Same idea.
Code --> Run Shell. Run this command:
Code:
ip neigh show dev wlan0 | grep -i -e reachable -e delay | grep -o' ..\:..\:..'
Check "Use Root", Store Output In %CLIENTS, and Store Errors in %error. Check "Continue Task after Error". This action basically gets the currently connected devices' MAC addresses and puts it into an array.
Task --> If. If %error is Set. Meaning no devices are connected.
Alert --> Flash. Text: Zero clients were found.
Task --> Stop. Exit the task.
Task --> End If.
Variables --> Variable Split. Name: %CLIENTS. Leave Splitter blank.
Task --> For. Variable is %for and Items are 2:%CLIENTS(#). Here, we're looping through each connected MAC ID and using our OUI database to look up and determine what manufacturer it belongs to.
Variables --> Variable Convert. Name %CLIENTS(%for). Function: To Upper Case.
Variables --> Variable Search Replace. Variable: %CLIENTS(%for), Search set to : (a colon), check Replace Matches, and for Replace With make it a blank space.
Code --> Run Shell. Here's the command:
Code:
sed -n '/%CLIENTS(%for)/ p' /sdcard/Tasker/oui.txt
Check Use Root, Store Output In %MANU(%for) and check Continue Task after Error.
Variables --> Variable Section. Name %MANU(%for) From 23, Length 100. Cut out all the extraneous data.
Task --> End For.
Here's screenshots of the task:
Next, we'll set up the profile that triggers when the hotspot is confirmed to be on.
Create a new profile and name it "Hotspot Connected."
Create a new State context and go to Variables --> Variable Value. Set it to when %Hotspot eq 1.
Create a new task, but you don't need to name it anything.
Task --> Perform Task. Name: MAC Lookup.
Variables --> Variable Set. Name %PPLCOUNT to %CLIENTS(#)-1. This gets us how many clients are connected.
Task --> If. If %CLIENTS(2) !Set. Meaning nobody is connected.
Variables --> Variable Set. Name: %msg to <font color=yellow>No one's there!
Task --> Else
Variables --> Variable Set. Name: %msg to <font color=red>%PPLCOUNT <font color=white>people are still connected!
Task --> End If.
Variables --> Variable Join. Name %MANU, Joiner is , (a comma). This turns the manufacturer array into a comma-separated list.
Plugin --> AutoNotification. Title: Warning! Text: Your hotspot is still on! %msg Action on Touch: CLIENTS. Id: 55555. Persistent: true. Title Expanded: List of Registered clients:
That's it for this task. Exit out, and add a time context to this profile. Set it to every 5 minutes so your hotspot notification will update.
Here are screenshots of the task:
Finally, we will make the profile that triggers when you click on the notification.
Create a new profile and name it Hotspot Information.
Create an Event context and go to Plugin --> AutoNotification Event. Filter: CLIENTS.
Create a task with no name. Go to the task editor.
Plugin --> Snackbar Tasker Plugin --> Snackbar Without Button. Message: No one is connected to the hotspot! At the bottom, check If and set it to if %MANU !Set.
Plugin --> Snackbar Tasker Plugin --> Snackbar Without Button. Message: Connected devices: %MANU. Check If at the bottom and set it to if %MANU is Set.
Here's a screenshot of the task:
I've attached the XMLs below. Please import them, but read through the labels and instructions above if you want to understand how these profiles work and how to edit them in the future.
Hi,
I am getting this error. Please see the attachment. Where am i going wrong?
did not get it with the auto notification. how do i change the name?
/u/StillAzure here, didn't notice this thread lol.
jayzero76 said:
did not get it with the auto notification. how do i change the name?
Click to expand...
Click to collapse
What name again?
iamronin said:
Hi,
I am getting this error. Please see the attachment. Where am i going wrong?
Click to expand...
Click to collapse
It means there's no client connected. Are you sure there are any?
If you are rooted, try arcais netcut (cant link because i am new) which helps you to check who is connected to your network and also lets you kill the connection (Even if you are on someone elses connection) [WORKS IN ANDROID, IOS, MAC WINDOWS , LINUX . 100% TESTED]
Hope this helps!
Getting following error in Mac lookup task
EDIT
that's my bad
Where's the MAC Lookup task? You've got everything else to import except it.