EZAlert.me Blog

Use cases, facts and tutorials about EZAlert.me

About EZAlert.me

EZAlert.me offers a simple API to allow your programs or devices send you alerts via popular instant messages applications like Telegram, Skype, Facebook Messenger or Slack.
Here we publish posts about use cases, samples and stuffs related to EZAlert.me use and configuration.
If you like to share notes about how you use EZAlert.me, just sent us an email to ezalert(at)ezalert.me.
EZAlert.me home

Send a Telegram / Skype / Messenger / Slack alert from Arduino

So, you have an Arduino board and you want to be notified with an istant message everytime something happens. Maybe when someone press a button or when temperature is higher or lower that a preset threshold, or when a pir sensor detects something. No problems, EZAlert.me can help you!

We just added in our GitHub repo a sample Arduino Sketch you can use as and example to send instant messages from an Arduino ESP8266 board. The sample can be easily fixed to work with other boards or with Arduino boards with ethernet/wifi hats. Anyway the core function is quite easy:

int sendAlert(String text) {

 // ******* EZALert.me API Key here *******
 String ezalert_ApiKey = "PUT YOUR EZALERT.ME API KEY HERE";

 const char* servername = "ezalert.me";
 String line1=F("GET /v1/sendAlert?apikey=")+String(ezalert_ApiKey)+F("&text=")+urlencode(text)+F(" HTTP/1.1");
 String line2=F("Host: ezalert.me");
 WiFiClient client; 
 if (client.connect(servername, 80)) {     
      // Make a HTTP request:
      client.println(line1);
      client.println(line2);
      client.println();      
      return 1;
 }  
 return 0;
}

In this function we create a WiFiClient object, then we connect to EZAlert.me API and send the contents of text string throught it.

The only thing you need to have is a working EZAlert.me account with its API key, and your Arduino board can alert you about any event you want to track.