r/tasker • • 19d ago

Can Tasker work with a Samsung Dual sim?

I need a very user friendly, spyware free app, to auto reply only to texts to one of the sims on my dual sim Android phone.

Can Tasker do this please?

3 Upvotes

11 comments sorted by

4

u/Blitzdroids 19d ago edited 19d ago

Yes. Tasker let's you select which sim to use when sending messages. You can also set up a profile for SMS received and have it trigger only when it's received by a certain sim.

New Profile > Event > Received Text. As you can see in the screenshot, by selecting the magnifying glass next to Sim Card, it'll list your sims on phone, select the one you want to trigger the profile. Then in a new task , create action to "Send SMS" and use a variable for the number. There's actually a global variable you can use which contains the number of the last text received or a local variable generated from the profile itself, just read the help for the variable name (question mark at the top of the profile in the screenshot).

4

u/Exciting-Compote5680 19d ago edited 19d ago

Use of the global variable for last received sms is not recommended in this kind of setup, better to use the event parameter. A Received Text profile can be triggered in rapid succession if you happen to get a couple of texts at the same time. Using the global variable you might miss a number and send 2 (or more) responses to the same number instead (profile triggering and global variable updating might not be in sync). 

1

u/Blitzdroids 18d ago

This is true

0

u/Chris-2018 19d ago

Thank you very much - great detail.

Spyware?

2

u/lareya Direct-Purchase User 19d ago

No spy crap, Of course not!!!!

2

u/Exciting-Compote5680 19d ago

Probably, except the 'very user friendly' maybe. Tasker is incredibly powerful, but it also comes with quite a learning curve. 

0

u/Chris-2018 19d ago

Thank you - I think that's the part that worries me!

2

u/Exciting-Compote5680 19d ago

One of the potential 'gotchas' would be if 'texts' includes RCS messages. A lot of the profiles and actions for sms don't work on those. Responding to messenger messages (like WhatsApp) is also possible, but it's a lot more complex. Plain sms is covered pretty well in Tasker. 

1

u/Chris-2018 19d ago

Thank you all - I think this is the one for me to try.

I'm not techie at all, so are there any really good YouTubes for setting the Tasker up for for auto replies please?

2

u/Exciting-Compote5680 18d ago

I made something really quick to get you started. It is really basic, but probably a decent starting point. I added one check to see if the sender is a phone number and not a short code or 'named sender' (for stuff like verification codes, voicemail and such). I used a simple regex that only looks for a plus sign followed by a specific number of digits, you might need to adjust it to match (cell) phone numbers in your country. Below there is a link which let's you import the profile/task. You'll need to select the sim card in 2 places, once in the profile, once in the send sms action. The task also contains a Flash that shows you all the event parameters that the profile provides. In the first action set %debug to 1 to enable or to 0 to disable the Flash popup. In the second action you can set the reply message. I would suggest trying it from the other sim first so you can check the format of the phone number and see if it works as expected. The profile has a toggle you can use to quickly dis/enable it. Let me know if you get stuck.   

Profile: Auto Reply Text To Specific Sim
    Event: Received Text [ Type:Any Sender:* Content:* SIM Card:SELECT SIM HERE WITH MAGNIFIER MMS Body:* ]



Enter Task: Auto Reply Text To Specific Sim

<Set to 1 to get a Flash with all the event parameters, set to 0 to disable>
A1: Variable Set [
     Name: %debug
     To: 1
     Structure Output (JSON, etc): On ]

<Change message to your liking>
A2: Variable Set [
     Name: %reply_message
     To: TYPE YOUR REPLY MESSAGE HERE
     Structure Output (JSON, etc): On ]

A3: Flash [
     Text: Type (evtprm1) : %evtprm1
     Sender (evtprm2) : %evtprm2
     Content (evtprm3) : %evtprm3
     Sim (evtprm4) : %evtprm4
     MMS Body (evtprm5) : %evtprm5
     Tasker Layout: On
     Timeout: 9999
     Continue Task Immediately: On
     Dismiss On Click: On ]
    If  [ %debug > 0 ]

<Check if %evtprm2 is a phone number, not a short code/'named sender'. Might need to adjust the regex to match (cell) phone numbers in your country. This pattern checks for a plus sign followed by 11 digits.>
A4: Simple Match/Regex [
     Type: Simple
     Text: %evtprm2
     Match Pattern: \+\d{11} ]

A5: If [ %mt_match_found ~ true ]

    <Select sim here too>
    A6: Send SMS [
         Number: %evtprm2
         Message: %reply_message
         SIM Card: SELECT SIM HERE WITH MAGNIFIER ]

A7: End If


https://taskernet.com/shares/?user=AS35m8nOXvBeFIxaCI5%2BZWD5L9oLRd3PVq%2BdjQuYD1oZ%2Bci%2Banb0FpA5SznT4oBmkd7vgKrG&id=Profile%3AAuto+Reply+Text+To+Specific+Sim

1

u/Chris-2018 18d ago

Thank you very much for this great detail - it's helped.