[GUIDE][Difficulty: Intermediate] Driving Mode (Answer Calls, Texts, Read Notifs)

Search This thread

MishaalRahman

Retired Editor in Chief
Nov 2, 2015
1,045
2,153
www.xda-developers.com
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

  1. Root Access to automatically answer calls
  2. Secure Settings plugin
  3. 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.

vesDnyJ.jpg


Instructions

  1. First profile you will make should be called "Driving Mode - Incoming Call"
  2. 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.
  3. 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.
  4. Input --> Get Voice. Go to Label and make it "DECIDE". You will come back to this action with a Goto later.
  5. Task --> If. Set it to if %VOICE ~ Yes. Basically, if you saw "yes" then you've chosen to answer the call.
  6. Plugin --> Secure Settings. Root Settings --> Phone Options. Pick "Answer Call."
  7. Audio --> Speakerphone. Set it to On.
  8. Task --> Else If. Set it to if %VOICE ~ No. This is if you choose to not answer the call.
  9. Plugin --> Secure Settings. Root Settings --> Phone Options. Pick "End Call."
  10. 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.
  11. Task --> Else
  12. Task --> Goto. Set type to "Action Label." Go to label "DECIDE" which is Action Number 2.
  13. Task --> End If
  14. 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:
ifb7zzf.jpg

MNUi42G.jpg


Next up, the notification reader:
S9UWgzg.jpg

  1. Create a new Profile and title it "Driving Mode - Read Notification"
  2. 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?
  3. Exit and create a task. Name it anything.
  4. Alert --> Say. For the text, put %antitle. Check If and make it if %antitle is Set.
  5. Alert --> Say. Make the text %antext. Check If and make it If %antext is Set.
  6. Alert --> Say. Make the text %ansubtext. Check If and set it to If %ansubtext is Set.
  7. If you are using Notification Listener instead, simply change %antitle to %nltitle, change %antext to %nltext, and change %ansubtext to %nlsubtext.
  8. 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:

NLE96SE.jpg


Finally, a text message response profile:
tPJ2vKR.jpg

  1. Create a new profile and name it "Driving Mode - Read Text."
  2. Go to Event --> Phone --> Received Text. Make the Type Any and leave everything else blank.
  3. Now, we'll create the task. Leave the name blank.
  4. Alert --> Say. Make it say the following:
    Code:
    %SMSRN says %SMSRB. Would you like to respond?
  5. Input --> Get Voice. Label it "REPEAT".
  6. Task --> If. Set it to if %VOICE ~ Yes.
  7. Input --> Get Voice. Label it "AGAIN."
  8. Variables --> Variable Set. Set name to %voice and set it to %VOICE.
  9. Alert --> Say. Make the text this:
    Code:
    %VOICE. Is this okay?
  10. Input --> Get Voice.
  11. 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
  12. Task --> Goto. Set the type to "Action Label" and set the label to "AGAIN."
  13. Task --> Else If. Set it to if %VOICE ~ No
  14. 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.
  15. Task --> Else
  16. Task --> Goto. Set type to "Action Label" and make the label "REPEAT."
  17. Task --> Else If.
Here are screenshots of the task:
0cq2K3n.jpg

PDsIhVY.jpg


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.
 

Attachments

  • Driving_Mode___Incoming_Call.prf.xml
    5.4 KB · Views: 1,356
  • Driving_Mode___Read_Notification.prf.xml
    14.9 KB · Views: 894
  • Driving_Mode___Read_Text.prf.xml
    3.6 KB · Views: 914

olskar

Senior Member
Nov 10, 2006
183
26
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.
 
Last edited:

MishaalRahman

Retired Editor in Chief
Nov 2, 2015
1,045
2,153
www.xda-developers.com
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.

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
 

sbcrumb

Senior Member
Apr 17, 2010
867
374
Ohio
OnePlus 8T
OnePlus 9 Pro
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.
 

tylerdurden83

Senior Member
May 28, 2011
1,196
227
What can I use instead of secure settings to pick up the call? Secure settings is bugged nowadays can't find root
 

Whark

New member
May 8, 2016
4
0
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.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 11
    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

    1. Root Access to automatically answer calls
    2. Secure Settings plugin
    3. 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.

    vesDnyJ.jpg


    Instructions

    1. First profile you will make should be called "Driving Mode - Incoming Call"
    2. 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.
    3. 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.
    4. Input --> Get Voice. Go to Label and make it "DECIDE". You will come back to this action with a Goto later.
    5. Task --> If. Set it to if %VOICE ~ Yes. Basically, if you saw "yes" then you've chosen to answer the call.
    6. Plugin --> Secure Settings. Root Settings --> Phone Options. Pick "Answer Call."
    7. Audio --> Speakerphone. Set it to On.
    8. Task --> Else If. Set it to if %VOICE ~ No. This is if you choose to not answer the call.
    9. Plugin --> Secure Settings. Root Settings --> Phone Options. Pick "End Call."
    10. 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.
    11. Task --> Else
    12. Task --> Goto. Set type to "Action Label." Go to label "DECIDE" which is Action Number 2.
    13. Task --> End If
    14. 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:
    ifb7zzf.jpg

    MNUi42G.jpg


    Next up, the notification reader:
    S9UWgzg.jpg

    1. Create a new Profile and title it "Driving Mode - Read Notification"
    2. 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?
    3. Exit and create a task. Name it anything.
    4. Alert --> Say. For the text, put %antitle. Check If and make it if %antitle is Set.
    5. Alert --> Say. Make the text %antext. Check If and make it If %antext is Set.
    6. Alert --> Say. Make the text %ansubtext. Check If and set it to If %ansubtext is Set.
    7. If you are using Notification Listener instead, simply change %antitle to %nltitle, change %antext to %nltext, and change %ansubtext to %nlsubtext.
    8. 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:

    NLE96SE.jpg


    Finally, a text message response profile:
    tPJ2vKR.jpg

    1. Create a new profile and name it "Driving Mode - Read Text."
    2. Go to Event --> Phone --> Received Text. Make the Type Any and leave everything else blank.
    3. Now, we'll create the task. Leave the name blank.
    4. Alert --> Say. Make it say the following:
      Code:
      %SMSRN says %SMSRB. Would you like to respond?
    5. Input --> Get Voice. Label it "REPEAT".
    6. Task --> If. Set it to if %VOICE ~ Yes.
    7. Input --> Get Voice. Label it "AGAIN."
    8. Variables --> Variable Set. Set name to %voice and set it to %VOICE.
    9. Alert --> Say. Make the text this:
      Code:
      %VOICE. Is this okay?
    10. Input --> Get Voice.
    11. 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
    12. Task --> Goto. Set the type to "Action Label" and set the label to "AGAIN."
    13. Task --> Else If. Set it to if %VOICE ~ No
    14. 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.
    15. Task --> Else
    16. Task --> Goto. Set type to "Action Label" and make the label "REPEAT."
    17. Task --> Else If.
    Here are screenshots of the task:
    0cq2K3n.jpg

    PDsIhVY.jpg


    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.