Skip to content
This repository was archived by the owner on Aug 23, 2024. It is now read-only.

Commit 3f16706

Browse files
authored
Add files via upload
1 parent f6ab07d commit 3f16706

File tree

3 files changed

+72
-7
lines changed

3 files changed

+72
-7
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
# ESP8266Webhook
2-
## Arduino library to trigger events using Webhooks and IFTTT.
3-
4-
## Official Arduino Link: https://www.arduino.cc/reference/en/libraries/esp8266-webhooks/
2+
Arduino library to trigger events using Webhooks and IFTTT.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#include <ESP8266Webhook.h>
2+
#include <ESP8266WiFi.h>
3+
4+
#define _SSID "ENTER HERE" // Your WiFi SSID
5+
#define _PASSWORD "ENTER HERE" // Your WiFi Password
6+
#define KEY "ENTER HERE" // Webhooks Key
7+
#define EVENT "ENTER HERE" // Webhooks Event Name
8+
9+
Webhook webhook(KEY, EVENT); // Create an object.
10+
11+
void setup() {
12+
Serial.begin(115200);
13+
pinMode(LED_BUILTIN, OUTPUT);
14+
digitalWrite(LED_BUILTIN, LOW);
15+
WiFi.mode(WIFI_STA);
16+
WiFi.disconnect();
17+
delay(1000);
18+
19+
// Connect to WiFi
20+
Serial.println();
21+
Serial.println();
22+
Serial.print("Connecting to: ");
23+
Serial.println(_SSID);
24+
WiFi.begin(_SSID, _PASSWORD);
25+
26+
while (WiFi.status() != WL_CONNECTED) {
27+
delay(500);
28+
Serial.print("-");
29+
}
30+
31+
Serial.println("");
32+
Serial.println("WiFi Connected");
33+
34+
// Print the IP address
35+
Serial.print("IP Address: ");
36+
Serial.print("http://");
37+
Serial.print(WiFi.localIP());
38+
Serial.println("/");
39+
digitalWrite(LED_BUILTIN, HIGH);
40+
41+
//================================================================//
42+
//================================================================//
43+
44+
// Trigger with 3 values.
45+
webhook.trigger("value1","value2","value3");
46+
delay(5000);
47+
48+
// Trigger with 2 values.
49+
webhook.trigger("ABC","XYZ");
50+
delay(5000);
51+
52+
// Trigger with 1 value.
53+
int Num = 1234;
54+
webhook.trigger(String(Num));
55+
delay(5000);
56+
57+
// Trigger without any value and get response.
58+
int response = webhook.trigger();
59+
if(response == 200)
60+
Serial.println("OK");
61+
else
62+
Serial.println("Failed");
63+
}
64+
65+
void loop() {
66+
// Nothing
67+
}

library.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name=ESP8266 Webhooks
2-
version=1.1.0
1+
name=ESP8266 Webhook
2+
version=1.2.0
33
author=Rupak Poddar
44
maintainer=Rupak Poddar <poddarrupak2808@gmail.com>
5-
sentence=Library for ESP8266 to trigger events using Webhooks and IFTTT.
6-
paragraph=Easily trigger events using Webhooks with this library in just 1 line. Works flawlessly with IFTTT.
5+
sentence=Library for ESP8266 to trigger events using Webhook and IFTTT.
6+
paragraph=Easily trigger events using Webhook with this library in just 1 line. Works flawlessly with IFTTT.
77
category=Communication
88
url=https://github.com/Rupakpoddar/ESP8266Webhook
99
architectures=esp8266

0 commit comments

Comments
 (0)