Hi All,
I would like to build an alert system which will send a alert msg thru Whatsapp. But, instead of send to my personal number, it will send it to Group Whatsapp. Is this achievable?
Hi All,
I would like to build an alert system which will send a alert msg thru Whatsapp. But, instead of send to my personal number, it will send it to Group Whatsapp. Is this achievable?
I tried to find out how to do it, but didn't have any success.
The comments in this tutorial say it's not supported.
I also found some info on reddit saying it's not supported.
Maybe someone else on here, with more knowledge than me, will be able to help
I think you can do with some service provider as ifttt ( search of others too, don't know if free or paid )
Hi Hisyam,
Yes, sending messages to a WhatsApp group using Arduino is achievable with the right approach. While WhatsApp doesn’t offer a direct API for sending messages to a group, you can use services like Twilio’s WhatsApp API to send messages to the group’s phone number (the admin or member’s phone number).
Here's a simple outline of the solution:
You can integrate this process with any monitoring or alert system where your Arduino sends the data and, based on certain conditions, triggers the message to WhatsApp.
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
const char* ssid = "your_SSID";
const char* password = "your_PASSWORD";
const char* host = "api.twilio.com";
const char* twilioSID = "your_TWILIO_SID";
const char* authToken = "your_TWILIO_AUTH_TOKEN";
void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting to WiFi...");
}
Serial.println("Connected to WiFi");
}
void loop() {
WiFiClientSecure client;
if (client.connect(host, 443)) {
String url = "/2010-04-01/Accounts/" + String(twilioSID) + "/Messages.json";
String data = "To=whatsapp:+group_admin_number&From=whatsapp:+twilio_number&Body=Alert%20Message";
client.print(String("POST ") + url + " HTTP/1.1\r\n" +
"Host: " + host + "\r\n" +
"Authorization: Basic " + base64::encode(twilioSID + ":" + authToken) + "\r\n" +
"Content-Type: application/x-www-form-urlencoded\r\n" +
"Content-Length: " + data.length() + "\r\n\r\n" + data);
delay(5000); // wait for response
}
}
This will send an alert message to the WhatsApp group. Keep in mind that your Twilio number must be authorized for WhatsApp, and the group number should be added as a recipient.
Hope this helps! Let me know if you need further assistance with the setup.
Hello hyluoonz
Many thanks fpr your hint. One question arose:
Can WhatsApp send and receive information to and from the ESP32 application?
Yes, it’s achievable, but WhatsApp doesn’t officially support direct group messaging via APIs. You can use:
pywhatkit
or selenium
for WhatsApp Web automation.Ensure compliance with WhatsApp’s policies to avoid issues. Let me know if you need details!