Auto reply to a particular person when received a specific phrases via WhatsApp - Tasker Tips & Tricks

If that particular person whatsapp me eg. are you busy? Can WhatsApp auto reply to that person automatically?
Profile: Reply1 (8)
Cooldown: 5
Event: AutoNotification Intercept [ Configuration:Event Behaviour: true
Has Reply Action: true
Notification Apps: WhatsApp ]
Enter: Anon (9)
A1: Flash [ Text:Replying to %antitle Longff ]
A2: AutoNotification Query [ Configuration:Title: %antitle()
Text: are you busy? *
Has Reply Action: true Timeout (Seconds):20 ]
A3: Flash [ Text:Busy. Longff ] If [ %antitle() ~ person's name]

Related

Created a Tasker profile for continuous notification upon receiving SMS, how to Exit?

I have created below tasker profile to generate continuous notification with Flash on & off upon receiving a text message with word "Emergency" in it. It works perfectly however I cannot find a way to stop the sound, vibration and Flash light loop.
I tried to create a scene with TAP action = cancel alarm (disable any) but it just opens system's alarm app.
Please suggest a way to stop this loop. I created this profile so I do not miss any Important SMS page from work while sleeping.
P. S. = I used alarm as notification type because it will play even while my phone is set to silent profile (Device - oneplus 3T). If alert slider is set to silent only alarms are working.
Code:
Profile: SMS_Notif_911 (15)
Event: Received Text [ Type:SMS Sender:* Content:*Emergency* ]
Enter: PerotSound (12)
A1: Vibrate Mode [ Mode:eek:ff ]
A2: Ringer Volume [ Level:7 Display:eek:ff Sound:eek:ff ]
A3: Alarm Volume [ Level:7 Display:eek:ff Sound:eek:ff ]
A4: Notification Volume [ Level:7 Display:eek:ff Sound:eek:ff ]
A5: Media Volume [ Level:30 Display:eek:ff Sound:eek:ff ]
A6: Show Scene [ Name:PerotNotifStop Display As:Dialog, Dim Behind Horizontal Position:100 Vertical Position:100 Animation:System Show Exit Button:eek:n Show Over Keyguard:eek:n Continue Task Immediately:eek:n ]
A7: Play Ringtone [ Type:Alarm Sound:Rhythm Stream:4 ]
A8: Vibrate [ Time:200 ]
A9: Torch [ Set:eek:n ]
A10: Wait [ MS:753 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A11: Torch [ Set:eek:ff ]
A12: Wait [ MS:500 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A13: Goto [ Type:Action Number Number:7 Label: ]
The ringtone action can't be stopped, it runs autonomously (unless the "silence ringer" action works on your device).
So, I would use a Music Play action with the output stream set to alarm. Then in the scene, you can have a Music Stop action attached to a button in the scene. If you don't have a stop button in the scene, you need to add one.
There is also a variable "%PerotStop" that I added. It is set to "true" when the stop button is tapped and the GoTo action executes only if it's not true.
Notice that the GoTo doesn't go back to the Music Play action, but only back to cycle the vibrate and torch. It's not necessary to do more, just check the box to loop the music in the Music Play action.
Finally, after the GoTo stops executing, we clear the "%PerotStop" variable and it's ready for the next time.
Note: the [X] at action 7 shows that it's paused and won't run.
Code:
Profile: SMS_Notif_911 (179)
Event: Received Text [ Type:SMS Sender:* Content:*Emergency* ]
Enter: PerotSound (180)
A1: Vibrate Mode [ Mode: Off ]
A2: Ringer Volume [ Level:6 Display: Off Sound: Off ]
A3: Alarm Volume [ Level:7 Display: Off Sound: Off ]
A4: Notification Volume [ Level:7 Display: Off Sound: Off ]
A5: Media Volume [ Level:30 Display: Off Sound: Off ]
A6: Show Scene [ Name:PerotNotifStop Display As:Dialog, Dim Behind Horizontal Position:100 Vertical Position:100 Animation:System Show Exit Button: On Show Over Keyguard: On Continue Task Immediately: On ]
A7: [X] Play Ringtone [ Type:Alarm Sound:Cuckoo clock Stream:4 ]
A8: Music Play [ File:Ringtones/fur_elise_dubstep.mp3 Start:0 Loop: On Stream:4 Continue Task Immediately: On ]
A9: Vibrate [ Time:200 ]
A10: Torch [ Set: On ]
A11: Wait [ MS:753 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A12: Torch [ Set: Off ]
A13: Wait [ MS:500 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A14: Goto [ Type:Action Number Number:9 Label: ] If [ %PerotStop !~ true ]
A15: Variable Clear [ Name:%PerotStop Pattern Matching: Off Local Variables Only: Off ]
These are the actions that the stop button that is displayed in the scene should have. They are added on the "tap" tab within the element edit. Notice the final action of the stop button is to clear the scene.
Code:
A1: Variable Set [ Name:%PerotStop To:true Recurse Variables: Off Do Maths: Off Append: Off ]
A2: Music Stop [ Clear Dir: Off ]
A3: Destroy Scene [ Name:PerotNotifStop ]
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Thank you so much. It worked.
ktmom said:
The ringtone action can't be stopped, it runs autonomously (unless the "silence ringer" action works on your device).
So, I would use a Music Play action with the output stream set to alarm. Then in the scene, you can have a Music Stop action attached to a button in the scene. If you don't have a stop button in the scene, you need to add one.
There is also a variable "%PerotStop" that I added. It is set to "true" when the stop button is tapped and the GoTo action executes only if it's not true.
Notice that the GoTo doesn't go back to the Music Play action, but only back to cycle the vibrate and torch. It's not necessary to do more, just check the box to loop the music in the Music Play action.
Finally, after the GoTo stops executing, we clear the "%PerotStop" variable and it's ready for the next time.
Note: the [X] at action 7 shows that it's paused and won't run.
Code:
Profile: SMS_Notif_911 (179)
Event: Received Text [ Type:SMS Sender:* Content:*Emergency* ]
Enter: PerotSound (180)
A1: Vibrate Mode [ Mode: Off ]
A2: Ringer Volume [ Level:6 Display: Off Sound: Off ]
A3: Alarm Volume [ Level:7 Display: Off Sound: Off ]
A4: Notification Volume [ Level:7 Display: Off Sound: Off ]
A5: Media Volume [ Level:30 Display: Off Sound: Off ]
A6: Show Scene [ Name:PerotNotifStop Display As:Dialog, Dim Behind Horizontal Position:100 Vertical Position:100 Animation:System Show Exit Button: On Show Over Keyguard: On Continue Task Immediately: On ]
A7: [X] Play Ringtone [ Type:Alarm Sound:Cuckoo clock Stream:4 ]
A8: Music Play [ File:Ringtones/fur_elise_dubstep.mp3 Start:0 Loop: On Stream:4 Continue Task Immediately: On ]
A9: Vibrate [ Time:200 ]
A10: Torch [ Set: On ]
A11: Wait [ MS:753 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A12: Torch [ Set: Off ]
A13: Wait [ MS:500 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A14: Goto [ Type:Action Number Number:9 Label: ] If [ %PerotStop !~ true ]
A15: Variable Clear [ Name:%PerotStop Pattern Matching: Off Local Variables Only: Off ]
These are the actions that the stop button that is displayed in the scene should have. They are added on the "tap" tab within the element edit. Notice the final action of the stop button is to clear the scene.
Code:
A1: Variable Set [ Name:%PerotStop To:true Recurse Variables: Off Do Maths: Off Append: Off ]
A2: Music Stop [ Clear Dir: Off ]
A3: Destroy Scene [ Name:PerotNotifStop ]
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Click to expand...
Click to collapse

Silence when flipp, but not when the phone is already flipped

I'm using a downloaded task profile to silence my phone when ringing when i'm flipping it. The tasker profile also sends a SMS to the caller to let them know i'm not be able to pick u the phone richt now.
This task works out great except for one thing . When the phone is already upside down (flipped) the task will be activated right away, so I won't be able to pick up the phone and answer the call even if I wanted to.
Can somebody please help me solve this problem, by (for example) adding a timer of 10 seconds or something like that.
Down under the tasker profile
Profile: Face Down (32)
State: Variable Value [ %CallOrientation ~ 1 ]
State: Orientation [ Is:Face Down ]
Enter: Anon (26)
A1: Ringer Volume [ Level:0 Displayff Soundff ]
A2: Send SMS [ Number:%CNUM Message:Sorry ik kan nu even niet opnemen, ik bel je z.s.m. terug. Store In Messaging Appff SIM Card: ]
A3: Vibrate Mode [ Modeff ]
Exit: Anon (27)
A1: Ringer Volume [ Level:0 Displayff Soundff ]
Profile: Phone Idle (33)
Event: Phone Idle
Enter: Anon (28)
A1: Variable Set [ Name:%CallOrientation To:0 Recurse Variablesff Do Mathsff Appendff ]
A2: Stop [ With Errorff Task: ] If [ %PACTIVE ~ ,*Library*, ]
A3: Ringer Volume [ Level:7 Displayff Soundff ]
Profile: Disable DND During Call (34)
Event: Phone Offhook
Enter: Anon (23)
A1: Wait [ MS:0 Seconds:5 Minutes:0 Hours:0 Days:0 ]
A2: Do Not Disturb [ Mode:Allow All ]
Profile: Phone Ringing (35)
Event: Phone Ringing [ Caller:* ]
State: Not Orientation [ Is:Face Down ]
Enter: Anon (22)
A1: Variable Set [ Name:%CallOrientation To:1 Recurse Variablesff Do Mathsff Appendff ]
tekst file
Tekst file

SMS Read, reply, change , cancel profile

Credit goes to João Dias and Golden-Death
I just did little modifications.
I had some problems with AutoNotification it just doesn't want to read aloud anything.
I used google Text - to - Speech which was updated again just today.
Note 4, Tasker v5.8.5. Android 6.0.1. Not rooted.
Installed Media Utilities and Security Setting from Google Play. Honestly I have no idea what do they do but I believe they will stop music playing when a text message comes.
I used one of the voices in the Google TTS. It works without WIFI or DATA or Internet connection.
It used Media stream and most of the Respect Audio Focus were set to OFF.
Here is the profile:
Profile: Answer (16)
Event: Received Text [ Type:Any Sender:* Content:* ]
Enter: Answer (8)
A1: Secure Settings [ Configuration:Screen & Keyboard Lights On
1 Minute Timeout (Seconds) : 0 ]
A2: Media Utilities Action [ Configurationause Timeout (Seconds) : 0 ]
A3: Wait [ MS: 0 Seconds : 1 Minutes:0 Hours : 0 Days : 0 ]
A4: Say [ Text:New message received from %SMSRN Engine:Voice:default:default Stream:3 Pitch:5 Speed:7 Respect Audio Focus: off Network: off Continue Task Immediately: off ]
A5: Wait [ MS: 500 Seconds: 0 Minutes: 0 Hours: 0 Days: 0 ]
A6: Say [ Text: Do you want me to Read it ? Engine:Voice:default: default Stream: 3 Pitch: 5 Speed: 7 Respect Audio Focus: off Network: off Continue Task Immediately: off ]
A7: Get Voice [ Title:Language Language Model: Free Form Language: Maximum Results: 1 Timeout (Seconds):30 ]
A8: Say [ Text: Sorry, I did not recognize that , do you want me to read it ? please say yes or no . Engine: Voice:default:default Stream:3 Pitch:5 Speed:7 Respect Audio Focus: off Network: off Continue Task Immediately: off] If [ %VOICE !~ yes/no ]
A9: Goto [ Type:Action Number Number:39 Label: ] If [ %VOICE ~ cancel ]
A10: Goto [ Type:Action Number Number:7 Label: ] If [ %VOICE !~ yes/no ]
A11: If [ %VOICE ~ yes ]
A12: Say [ Text:Message says %SMSRB Engine:Voice:default:default Stream:5 Pitch:5 Speed:7 Respect Audio Focus: off Network: off Continue Task Immediately: off ]
A13: Wait [ MS:472 Seconds:0 Minutes:0 Hours:0 Days:0 ]
A14: Say [ Text:Would you like to reply ? Engine:Voice:default:default Stream:5 Pitch:5 Speed:7 Respect Audio Focus: off Network: off Continue Task Immediately: off ]
A15: Get Voice [ Title:Language Language Model:Free Form Language: Maximum Results:1 Timeout (Seconds):30 ]
A16: Goto [ Type:Action Number Number:39 Label: ] If [ %VOICE ~ cancel ]
A17: End If
A18: If [ %VOICE ~ no ]
A19: Goto [ Type:Action Number Number:39 Label: ]
A20: End If
A21: Say [ Text:Sorry , I did not recognize that , do you want to reply ? please say yes or no. Engine:Voice:default:default Stream:3 Pitch:5 Speed:7 Respect Audio Focus: off Network: off Continue Task Immediately: off ] If [ %VOICE !~ yes/no ]
A22: Goto [ Type:Action Number Number:14 Label: ] If [ %VOICE !~ yes/no ]
A23: Goto [ Type:Action Number Number:39 Label: ] If [ %VOICE ~ cancel ]
A24: If [ %VOICE ~ yes ]
A25: Say [ Text:What would you like to say ? Engine:Voice:default:default Stream:3 Pitch:5 Speed:7 Respect Audio Focus: off Network: off Continue Task Immediately: off ]
A26: Get Voice [ Title:Language Language Model:Free Form Language: Maximum Results:1 Timeout (Seconds):30 ]
A27: Variable Set [ Name:%VOICEM To:%VOICE Recurse Variables: off Do Maths: off Append: off Max Rounding Digits:3 ]
A28: Goto [ Type:Action Number Number:39 Label: ] If [ %VOICEM ~ cancel ]
A29: Say [ Text:Your message is %VOICEM. Would you like me to send it or change it ? Engine:Voice:default:default Stream:3 Pitch:5 Speed:7 Respect Audio Focus: off Network: off Continue Task Immediately: off ]
A30: Get Voice [ Title:Language Language Model:Free Form Language: Maximum Results:1 Timeout (Seconds):30 ]
A31: Goto [ Type:Action Number Number:25 Label: ] If [ %VOICE ~ change it ]
A32: Goto [ Type:Action Number Number:39 Label: ] If [ %VOICE ~ cancel ]
A33: Say [ Text:Sorry I did not recognize that , would you like me to send it or change it ? Engine:Voice:default:default Stream:3 Pitch:5 Speed:7 Respect Audio Focus: off Network: off Continue Task Immediately: off ] If [ %VOICE !~ send/send it/try again/change/change it ]
A34: Goto [ Type:Action Number Number:30 Label: ] If [ %VOICE !~ send/send it/try again/change/change it ]
A35: Send SMS [ Number:%SMSRF Message:%VOICEM Store In Messaging App: off SIM Card: ] If [ %VOICE ~ send/send it ]
A36: Say [ Text:Message sent . Engine:Voice:default:default Stream:3 Pitch:5 Speed:7 Respect Audio Focus: off Network: off Continue Task Immediately: off ]
A37: End If
A38: If [ %VOICE ~ no ]
A39: Say [ Text: Okay . Engine:Voice:default:default Stream:3 Pitch:5 Speed:7 Respect Audio Focus: off Network: off Continue Task Immediately: off ]
A40: End If
A41: Media Utilities Action [ Configurationlay (Smart) Timeout (Seconds):0 ]

My variable profile isn't active but it is when I add it to a task?

I've been using Tasker for awhile but I'm not too tech savvy so I thought I had this right but it isn't working. I basically want the sound on my phone to mute when I turn off my earbuds in certain situations. 1 of the situations I want it to turn off is when I am at home, during the week, after 6pm. I made a variable with those 3 in it called Weekdays. So I set the exit variable task If the weekday variable is set to mute my phone. When I look at the actual variable profile right now it is red, which it should be because it is not past 6pm. But when I put the variable in the task it is showing green as if it is active. Am I doing something wrong?
Here is the Weekday variable I set up 1st.
Profile: Weekdays (102)
Restore: no
Day: Mon, Tue, Wed, Thu or Fri
Time: From 6:00PM Till 6:30AM
State: Variable Value [ %ParadiseTrail Set ]
Enter: Weekdays After 6 (101)
A1: Variable Set [ Name:%Weekdays To:1 Recurse Variablesff Do Mathsff Appendff Max Rounding Digits:3 ]
Exit: Anon (106)
A1: Variable Clear [ Name:%Weekdays Pattern Matchingff Local Variables Onlyff Clear All Variablesff ]
This is the earbud profile.
Profile: Sound On With (47)
State: BT Connected [ Name:MDR-XB950BT/TOZO-NC9 Address:10:4F:A8:63:47:41/54:B7:E5:62:07:65 ]
Enter: Sound On (67)
A1: If [ %VOLN = 0 ]
A2: Sound Mode [ Mode:Sound ]
A3: Notification Volume [ Level:7 Displayff Soundff ]
A4: Ringer Volume [ Level:7 Displayff Soundff ]
Exit: Sound Off After 6pm (99)
A1: If [ %Weekdays Set ]
A2: Sound Mode [ Mode:Mute ]
A3: Else If [ %ParadiseTrail Set & %DAYW eq Saturday | %DAYW eq Sunday ]
A4: Sound Mode [ Mode:Mute ]

YouTube Vanced AutoPlay after being disconnected (not paused) from car bluetooth

Hello,
I came across XDA in my various searches for Tasker and media related inquiries. I posted this originally on Reddit and got some replies and made some things happen but it seems I've hit a dead end. What I would like to do is have my YouTube Vanced auto restart playback when I am reconnected to my car. Depending on the sequence of things, at times, the application can be paused (with the play button visible in the mini-player) and other times it has a pause button displayed in the mini player and won't initiate playback after turning back on the car.
I've been able to follow this description left by a user on Reddit - which has allowed me to playback any "APM Policy Manager start and stop output". It works with the toast notification but alas if my car is turned off and I see the pause button and not the play button, it won't continue playback on connection. My car seems to send a disconnect message and therefore I see the pause button - my headphones seem to send a pause and therefore I see a play button on the mini-player if they are ever disconnected.
Initially we are acting on logcat messages - perhaps I thought about deciphering the difference between my car disconnect message and the headphone disconnect message but I am not sure. Here is the code to make this happen - anyone try the same thing?
XML:
Profile: LP-MEDIA-DETECT
Settings: Enforce: no Notification: no
Event: Logcat Entry [ Output Variables:* Component:APM_AudioPolicyManager Filter:startOutput() Grep Filter (Check Help):Off ]
Enter Task: media-DETECT
Settings: Run Both Together
A1: [X] Multiple Variables Set [
Names: %lp_media_apps
Variable Names Splitter: #
Values: youtube|maxmpz|newpipe|bbc.sound|kodi|mx|
Values Splitter: #
Max Rounding Digits: 3 ]
A2: Run Shell [
Command: dumpsys media_session
Timeout (Seconds): 0
Store Output In: %data
Use Global Namespace: On ]
A3: Variable Search Replace [
Variable: %data
Search: (?<=packages=).*?(?=\s)
Store Matches In Array: %app ]
A4: Stop [ ]
If [ %app1 !~R %lp_media_apps ]
A5: Variable Set [
Name: %LP_STATE
To: 1
Max Rounding Digits: 3 ]
A6: Variable Search Replace [
Variable: %app1
Search: .unlock
Replace Matches: On
Continue Task After Error:On ]
If [ %app1 ~R maxmpz ]
A7: Variable Set [
Name: %lp_media_app
To: %app1
Max Rounding Digits: 3 ]
If [ %app1 !~ (?i)%lp_media_app & %app1 ~R (?i)%lp_media_apps ]
A8: Flash [
Text: %app1
Tasker Layout: On
Background Colour: #FF000000 ]
EXIT
[MEDIA STOP] PROFILE it's the same profile name and other filter
Profile: LP-MEDIA-DETECT
Settings: Notification: no
Event: Logcat Entry [ Output Variables:* Component:APM_AudioPolicyManager Filter:stopOutput() Grep Filter (Check Help):Off ]
Enter Task: media-EXIT
Settings: Run Both Together
A1: Run Shell [
Command: dumpsys media_session
Timeout (Seconds): 0
Store Output In: %data
Use Global Namespace: On ]
A2: Variable Search Replace [
Variable: %data
Search: (?<=packages=).*?(?=\s)
Store Matches In Array: %app ]
A3: Stop [ ]
If [ %app1 !~R %lp_media_apps ]
A4: Variable Clear [
Name: %LP_STATE ]
A5: Stop [ ]
A6: [X] Flash [
Text: %app1
Continue Task Immediately: On
Dismiss On Click: On ]
Here is the Reddit link as well: YouTube Vanced - AutoPlay
I have had some success with making a task with Play (simulated) on %app1 etc... but %app1 can change to the display or .... LED cover if the screen is just opened on my phone... etc. I've even tried Open App, %app1, or YouTube Vanced... simulate play or toggle paused... no avail.
Can you intercept the bluetooth disconnect message in a logcat and block it? Or change it to something? Is Tasker the right tool for all automation ideas? I have tried MacroDroid, Automate... they seem more userfriendly but then I found myself left underwhelmed - perhaps my lack of experience and knowledge is the only factor.
Cheers,
Erik

Categories

Resources