IFTTT defines a clear and concise protocol that your service’s API will implement. Each trigger and action for your service will map 1-to-1 to an API endpoint on your service built specifically for IFTTT. Trigger endpoints will be event streams that IFTTT will poll for new data. Conversely, action endpoints will be writable endpoints that IFTTT will send data to. For services that use OAuth, IFTTT is fully compatible with a couple of the common flavours of OAuth 2.0
.
I have used a publish
and subscribe
method for current demonstration.ESP8266-12E module incuded as a microcontroller for the communication with Adafruit IO and IFTTT.
Here we have some points to note:
- You must need an Adafruit IO and IFTTT console/account for the demonstation.Details on below section (Steps).
- This concept works on ESP8266 Arduino Core v2.4.2 and v2.4.0.
- For Adafruit IO, please remember
key
andfeed
parameters along with yourusername
:
- Arduino IDE for Windows, Linux or Mac OS.
-
Download the repo.
-
For those who don't have an Adafruit IO and IFTTT console/account 😇 download the ADAFRUIT_IFTTT_GOOGLE ASSISTANT named pdf from the DOC folder and carefully read it.
-
Open LIB folder from the downloaded repo then extract the
ZIP
file and place the 2 folders into your Arduino local directory folder (libraries). Folders(libraries) with name given below :- Adafruit_IO_Arduino
- Adafruit_MQTT_Library
You have an alternate option to download the library from the Arduino library manager. But I am not suggesting that way in this case 👎.
-
The source code for our ESP8266 simulation can be found in the CODE folder. Open source code from the downloaded repo and make some changes as mentioned below :
- Open global.h and provide your wifi router's
ssid
andpassword
:
- Open ada.cpp and fill your credentials here 👇 . For more info refer the document page number 2.
- Open the source code and do changes by Adafruit IO USERNAME & KEY.
- Paste the publish and subscribe feed name in ada.h to the marked space:
This library was tested with the NodeMCU V1.0 & ESP8266-12E board. It should also work with other standard ESP8266 that are compatible with the Arduino IDE.
ESP8266 core version that I have tested is 2.4.2
.
Demonstration of publish
and subscribe
between ESP8266 and Adafruit_IO dashboard described in the documentation from page No:3 to 5.
WiFi Connection status :
- Publish to IO: