The ultimate un-attended Android device setup
I recently am roaming a different country for personal work. And I have a cellphone number in my home country, which receives all OTPs and transaction messages. It would be highly inconvenient and unpredictable (especially the effectiveness) if I suddenly changed my regular number to an international one and expected the OTPs to arrive on time. Hence I needed to keep a phone physically in the origin country and devise a way to get the messages pushed out of it so I could use them. And here is how I did it.
My requirements:
- Get OTPs securely pushed to a place where I can easily access them.
- To be able to troubleshoot if anything goes wrong; remotely.
- To be able to manage the device charging unattended.
The tools I used:
- Rooted android device.
- Tasker software (https://tasker.joaoapps.com/)
- Autosheets Tasker Plugin (https://joaoapps.com/autosheets/)
- Tasmota (https://tasmota.github.io/docs/) for controlling ESP chip based WiFi enabled switches using HTTP APIs.
- Airdroid (https://www.airdroid.com/) for its screen mirroring capability as a backup in case I need to troubleshoot something remotely.
- Pushbullet (https://www.pushbullet.com/) as a backup for notification mirroring, in case the tasker task goes wrong.
How and why I used the above:
Rooted Android Device
I went with an old Oneplus 5T that I had lying around. Used the LineageOS — Dumpling edition (Specifically built for Oneplus 5T) — https://download.lineageos.org/dumpling.
I used a rooted device because I needed to make sure that all the apps helping me achieve this unattended setup have the maximum privilege on the android OS and will never be blocked from doing the essential functions. It might even be possible to use a non-rooted device. However, I suggest not to waste your time with a non-rooted device.
Tasker
Tasker is kind of the central piece in the puzzle.
Tasker was used to:
- Intercept all incoming SMS and push it to a google sheet using the Autosheet plugin
- Automatically switch ON the charger in a specific battery range and switch it OFF at the desired battery level.
Below are the screenshots of the tasker profiles that I used and the corresponding tasks.


All tasker variables start with the symbol — %
%evtprm(1) → Package name of the app. Eg. `com.gkns.testapp`
%evtprm(2) → Notification Title.
%evtprm(3) → Notification text body. i.e. the SMS text in case of SMS.
Data is configured as: %evtprm(1)###%evtprm(2)###%evtprm(3)$$$, and note that the column Separator is ### and the row seperator is $$$. This will help in adding adding readable rows to the google sheets.
Self Switch ON charger logic:
Note: For priming the Sonoff switch with Tasmota firmware, see this post:



Tasmota HTTP API for powering ON the Switch — GET/POST — http://192.168.1.43/cm?cmnd=POWER+ON
Similarily configure the TurnOffCharger with the API — GET/POST — http://192.168.1.43/cm?cmnd=POWER+OFF
And finally, to make sure the Airdroid and Pushbullet apps comes to the foreground after a reboot of the phone (The developers claim that the connectivity is better if these apps are in foreground)


Additionally, an unrelated tip — If you experience delays in getting the SMS delivered to your phone (As I did because due to a bug in LineageOS, I could not get the VoLTE feature ON, and the carrier was trying SMS delivery primarily through VoLTE channel since this phone reports that capability. However, since the feature had a bug, the SMS was not getting delivered in time to my device from the carrier.)
This was fixed by configuring the network settings to use only 2G networks and disabling the mobile data featur; so that the carrier will no longer try the VoLTE channel to push the SMS to the device, and the carrier will, by default, use the GSM/2G network for pushing this SMS.
In your case, VoLTE might already be working, and you may not need this. And it can also be that 2G connectivity is no more available on your carrier, But hey, just in case if it is applicable :)
My SMS spreadsheet looks like this:

And that is how I got my unattended android device set up!
Cheers!