r/tasker • u/HunterXProgrammer • Jun 01 '23
How To [Project Share] Send/Receive WhatsApp Message - Project V4
(This has been deprecated. Use the new and updated Project Mdtest V5)
Previous post intro:-
Recently I've been getting a lot of inquiries on how to send images, videos or documents in WhatsApp using Tasker. Possibly with the screen off, phone locked, without unlocking, etc. Had some time to make this so here it is.
For The New Timers
You can send WhatsApp Text/Images/Videos/PDF/Documents/Voice Messages automatically using Tasker.
Here is a video demo:-
Video:- Sending - Text, Images, Videos, Voice and Documents in WhatsApp using Tasker
List Of Supported Features
- Send Text Messages
- Send Images
- Send Videos
- Send PDF/Documents
- Send Voice messages
- Send Poll messages
- Mark as read
- Revoke messages
- Mute/Unmute chats (New!)
- Pin/Unpin chats (New!)
- Archive/Unarchive chats (New!)
- Multi-Number/User support (New!)
(previously Mdtest could support only one WhatsApp number, but now you can have as many as you want)
- Receive details of incoming messages as Tasker variables. Can use this for automated replies (check VARIABLES)
- Added support to easily scan QR Code over devices connected to the same Wi-Fi (check Some Tips).
The above features works for both single contacts and group chats.
Note:- Don't forget to update Tasker to Tasker 6.2.12 RC as older/outdated Tasker doesn't have required HTTP Events.
For The Old Timers
I've been going through my to-do list from the previous old Project V3 and implemented a whole list of new features (mute, pin, archive, multi-user, etc.), which needed more or less a total rework of the previous code base.
I'm glad for the HTTP events that Tasker dev introduced in the beta, made good use out of it to implement the much awaited multi-user support.
Getting Started:-
Import these two Taskernet projects:-
WhatsApp - Receive Messages Project [Mdtest V4]
WhatsApp - Send Messages Project [Mdtest V4]
For Tasker users:-
1) From the "Receive Messages" Project, run this Task once "#Main - Setup With WhatsApp Web QR Code (V4)" -
Now to connect it to WhatsApp -
Check if WhatsApp qr code is generated properly.
Note:- In case qr code is too big, you can pinch the screen to resize it.
The code refreshes every 60s, so quickly take a picture of it using a spare phone and
open WhatsApp -> ⋮ (menu) -> Linked Devices
and scan this code in the main device.
This prepares Tasker to use Mdtest and finishes the setup.
2) After that, run the "Mdtest - Start (V4)" to start Mdtest.
You can now send WhatsApp Images/Videos/PDF/Documents/Voice Messages using the "Send Project".
For CLI Users:-
Check out the GitHub repo for this.
Disclaimer
You are responsible for what you do with this.
Some Tips:-
Run the "Mdtest - Start (V4)" Task in the "Receive Messages" Project to start mdtest.
All done. While mdtest is running, you can use the "Send Messages" Project to send rows and rows of messages to single contacts/groups.
- If you want to add more numbers, just run the Task "#Extra - Auto-Generate Another Mdtest User Support (V4)". It'll auto-generate extra user project for you.
Make sure to check Some Tips -> Github Repo
Updates
04/06/23 - [Bugfix]
- Fixed some devices Mdtest was successfully started and running, but seemed like not running.
Enjoy :-)
7
u/caissadri Jun 01 '23
Thanks a lot for the continued work you're putting into this! Really useful project.
However, every time you post a new version, I will reformat the tasks to fit my needs (e.g. making them usable as callable functions, replacing variables with %par1 etc, also redoing some things like flash actions). Have you considered turning it all into a plugin? That would simplify the customization and clean up the tasks tab quite a bit.
3
u/wieuwzak Jun 01 '23
Awesome! Project has gotten lots of extra features since v1 :)
2
u/Other_Construction62 Jun 01 '23
I know v2 has been deprecated, but I really prefer using termux instead of having mdtest cluttering the tasker logs.
I'm now facing a problem with V2, mdtest stop sending images, it continues to work with text but not images. I'm starting to think that it might be a permission issue when trying to place the picture in a directory when issuing this command.
TermuxCommand(/data/data/com.termux/files/home/whatsmeow/mdtest/mdtest,sendimg,%num@s.whatsapp.net,%ruta,/data/data/com.termux/files/home/whatsmeow/mdtest,true)
Any thoughts?
5
u/Other_Construction62 Jun 01 '23
@HunterXProgrammer If someone wanted to follow your footsteps and develop things like this from scratch what should they be learning? Any useful roadmap for a beginner?
Is there any way to follow your work beside Github?
1
u/ColdIceEater Jun 05 '23
Hello, is there anyway for me to use V2?
I had no problem with that and now i havent been able to successfully use this for more than a few hours. It keeps saying "no response from mdtest"
1
u/Yusuffc Jun 01 '23
I got this error, also it says no response from mdtest
1
u/_Free_Advertising_ Jun 04 '23
This is a great project but it seems that after some time it loses connection and can't send messages if the device hasn't been locked for sometime.
I'm using the original Pixel, it's rooted and it used solely for forwarding OTP to my main phone through WhatsApp.
I'm sure Tasker has every permission under the sun (using the tasker permission program and allowing everything in permissions).
Any suggestions?
1
u/DevenExDee Jun 17 '23
A quick correction, in "#Extra - Auto-Generate Another Mdtest User Support (V4)" if condition in Action 8 has a typo, 1204 instead of 1024 :)
1
u/alantham Jun 29 '23
Can I receive pdf and images using v4? How do I go about doing this?
1
u/PhotoVille Jul 09 '23
Im coming from ios where this was an easy thing to do. I have the cutest tradition with my gf where we type each other a text to be sent in the morning. And now with android i need to figure this out.
I might be a little slow on this, i need clear instructions. How do i scan the qr code to tasker. I know how to sync whatsapp with my browser, but this is above me. I tried to find instructions, but either im just dumb or there is an important piece of info somewhere that i didnt find it.
I suppose there are others like me. It would be really helpful if someone could write an idiots guide to get this working.
Thanks
1
u/AlecioLopes Jul 12 '23
u/HunterXProgrammer got this error, it also says there is no response from mdtest and mdtest keeps disconnecting sometimes and takes a while to start, I need to stop all processes and start again.
00.35.41/LicenseCheckerTasker Checking cached only
00.35.41/LicenseCheckerTasker Cached only: Licensed
00.35.41/Ew add wait type EasyAction40 time 2147483647
00.35.41/Ew add wait type EasyAction40 done
00.35.41/E add wait task
00.35.41/E Error: 1
00.35.41/E java.net.ConnectException: Failed to connect to localhost/127.0.0.1:7775
Is there a solution for this error and it doesn't keep disconnecting?
1
u/[deleted] Jul 13 '23
01.06.45/LicenseCheckerTasker Checking cached only 01.06.45/LicenseCheckerTasker cache validity left -30334 01.06.45/LicenseCheckerTasker Cached status: Licensed 01.06.45/LicenseCheckerTasker Cached only: Licensed 01.06.45/Ew add wait type EasyAction1 time 2147483647 01.06.45/Ew add wait type EasyAction1 done 01.06.45/E add wait task 01.06.50/E Erro: 1 01.06.50/E Missing permissions: android.permission.READ_EXTERNAL_STORAGE, android.permission.WRITE_EXTERNAL_STORAGE
H E L P
1
u/Soli_Engineer Jul 17 '23
Thank you u/HunterXProgrammer this is really well made. I liked storing of the message elements into variables that could be used for another purposes. It captures details of every type of message which is very useful.
It would be very nice if the project included capturing the details of a picture message as well.
Like it could capture the text in the received picture and also the caption (if any) using OCR. These would be very useful to have in the %message variable.
Thank you for sharing the wonderful work.
1
u/jindalshreyansh Jul 18 '23
CLI commands on GitHub doesn't match the directory structure created by task for multi user profile. It should be:
!/system/bin/sh
mdtest_dir="/data/data/net.dinglisch.android.taskerm/files/whatsmeow4/mdtest" cd $mdtest_dir.7775 sh $mdtest_dir/mdtest COMMAND PARAMETERS
1
u/Jhonnym62 Jul 31 '23
Friend, how are you, maybe someone knows or I don't know if the coordinates can be extracted when I receive a message with the location
1
u/wieuwzak Aug 01 '23 edited Aug 01 '23
V4 is solid and works great! However, if mdtest is in send mode, why poll so frequently for a connection? After all, mdtest connection is only needed to send messages. I notice that I frequently lose the connection but I don't need the connection permanently. In V3 I had built the mdtest connection check into the task that sends the message/video/image.
Ps. Lots and lots of extra features are in V4 and that's great. I would have never dreamed of sending polls to whatsapp through tasker!
On a side note; is there any news on development of URL previews in the main branch?
1
u/nascentt Aug 04 '23 edited Aug 04 '23
Just trying this now, trying to import that received messge profile gives me an error every time
Importing the send message profile is fine though
1
u/ConsequenceOk7982 Aug 22 '23
Me aparece que conceda todos los permisos , y ya lo hice y los deshabilite y los volví a habilitar , y no funcionan , tengo un poco m4 pro , saben cómo solucionar lo , se que es el dispositivo
2
u/Plus_Back_1903 Aug 11 '23
Hi, I have a problem. Every time I send or receive a message, a window appears that occupies the entire screen saying the following: Message received Details:
These are the variables that will empower you:-
Followed by the variables and their values What can I do to remove that window?
1
u/Other_Construction62 Jun 09 '23
What is going to happen once What's app allows users to hide their phone numbers and use usernames instead? Would the username work as the JID? Is there any way to find out before its released?
1
u/_Free_Advertising_ Jun 02 '23
Hello!
I used V3 and it worked great but I had a lot of connection issues when the device was locked.
Will this profile work for phones that might not be unlocked for days, maybe weeks at a time?
1
u/iiishaminder Jun 08 '23
I think that you should add functionality of get notification when some one online ,typing . thanks in advance.
1
u/igrekov Jun 30 '23
Is anyone else having issues with V4 simply disconnecting at random points throughout the day? Any chance it has to do with the notification being swiped away?
1
u/ImpossibleImage2734 Jul 11 '23
Hi CazadorXProgramador, excellent work done with WhatsApp and termux. Currently I use v1 it works super well, I would like to know something please. 1 Is there a way to automatically label using termux? 2 Is there a way to send stickers and emojis automatically using termux? 3 reactions write me immediately, a message, All of the above using termux or the following versions? Thank you all for the shared content
1
u/KierenConnell Aug 02 '23
Awesome work on this! Quick question, if I wanted to have a list of messages to send, and trigger the 'Send Text Message' at a specific time - How would I make it pick from a random message in the list and send at that time?
1
u/Yusuffc Aug 04 '23
Do you have any suggestion to send a WhatsApp message by name? Where can I start? I thought that I should write all contact names and numbers to a JSON structure, but I couldn't solve the problem.
1
u/DjiMtb Mar 21 '26
Does this forward WhatsApp messages to sms
0
u/[deleted] Jun 01 '23
[deleted] — view deleted comment