Build WhatsApp Bot That Always Call You Back Whenever You Text It
In this tutorial, I am going to share a simple trick to build a WhatsApp Bot which always call you back whenever you text it.


We will be using the MacroDroid for the automation and Xiaomi Mi Box S.
We also need to install the following apps on the Mi Box:
- Screen Coordinates
Screen Coordinates app is required to locate the X and Y position on the screen. - Set Orientation
Set Orientation app is required to force and lock the screen orientation to portrait.
Connect the Mi Box with a monitor, plug the keyboard and mouse and we are ready to start. No programming skill is required :).
Additional Hardware
- Sound Card Decoder PCM2704
- Mini Loudspeakers
- For microphone you can use the Xiaomi Mi Box S remote control
Create a New Macro
We will start by creating a new macro in MacroDroid. Open the app and click Add Macro.

Triggers
On the Triggers section, click + button and search for Notification.

- Select Option to Notification Received.
- Select Option to Select Application(s).
- Select WhatsApp and click Ok.
- On the Notification Received, follow this screenshot. Click Ok.

Actions
Similar to what we do for triggers, we will simulate the key press to open the WhatsApp app, and press the audio call button and finally launch the home screen button. This is required so the trigger action can be executed. I think we can also do the video call if we have enough RAM on the Mi Box.
I am using the screen coordinate app to locate the icon, button, etc and put the X, Y location in the macro action UI Interaction.




Other Thing
The other thing you need to consider is to ensure the device is not going to sleep mode. The setting can be found under Settings > Applications > Development > Stay Awake.
Click the microphone button on the Xiaomi remote control when you start to talk. You may also need to adjust the volume.

If you want to trigger the action by webhook, you also can do that and it opens up the integration with other systems. And that’s all for now!