How to send automatic SMS reply (include & Exclude contacts)

68 views
Skip to first unread message

Easwaran Chandrasekaran

unread,
May 12, 2023, 11:51:58 PM5/12/23
to Tasker
I want to automatically send SMS reply if I get an SMS, but the reply need to be different for different audience
Example:
If my family (only 4 contacts) sends "Hi", I want tasker to reply, "Hi Dears I am driving"
In case other than above 4 contacts anybody else send message "Hi" I want tasker to reply different message "This is an automated message from Tasker, John is currently driving"

Please guide


aa6vh

unread,
May 13, 2023, 12:39:23 PM5/13/23
to Tasker
One comment I have is that I try not to auto reply to SMS messages that are unsolicited (from unknown users). I occasionally get SMS spam, and replying back just informs the sender that my phone number is valid, and they know they can send even more spam (not to mention placing your number on the global spammer white list).

You can tell if the phone number is in your contact list by comparing the number's name with the phone number. Tasker will place the phone number into the name field if the number is not in your contact list (in the SMS supplemental information).

Dan Muller

unread,
May 25, 2023, 3:38:50 PM5/25/23
to Tasker
I do something similar, but respond to any message from a known sender with the "I'm driving" message. 

As aa6vh wrote, you only want to respond to known senders, so I check the sender's name to see if it contains a number. If so, that's someone not in my contacts and I don't reply. After that, you'll check the name to see if it's "Mary Smith" OR "John Smith" OR "Jane Smith" OR "Chris Smith" to give the "family" response and anyone else (which would be non-family contacts) gets the standard response.

One other thing you'll want to do. The person you auto-respond to just might have an auto-response set up as well. So you send "I'm driving" and they auto-respond to that with "I'm driving", to which you respond with "I'm driving", to which they respond...

To prevent that, I created a task called Circuit Breaker, that has just a 5 minute wait block. Before I send an auto-response, I check to see if that task is running. If so, I don't send the response. If it's not running, I send the response and start the task. If they should auto-respond, I'll see that Circuit Breaker is running and that prevents the loop. (Of course, if anyone else texts me in that 5 minutes, they won't get a response, but that's OK with me. You could do something more complex if you want to avoid that.)

aa6vh

unread,
May 26, 2023, 10:19:36 AM5/26/23
to Tasker
(Oops, replied back to just the author, lets try again.)

I like your idea of preventing an loop with the auto-response. I think I might take a different tack though.

Create a global variable (normally just conatining ","), and when auto-responding append the phone number to that global (i.e. ",+18005551212,"), but check first to see if the number is already in that list. When I stop driving, re-initialize the global back to ",".

Dan Muller

unread,
May 26, 2023, 10:23:24 AM5/26/23
to Tasker
Yes, that's a better way. When I set up the timed circuit breaker, I wasn't familiar with setting up and searching arrays in Tasker, so I did it the quick and easy (and crude) way. I might implement your suggestion though.
Reply all
Reply to author
Forward
0 new messages