So Easy MicroPython — IFTTT, IoT event platform

*** Just simply add 2~3 lines into your code, then the MCU can be an IFTTT Notifier enabled IoT device***

from MyREST_IFTTT import myIFTTT
my_ifttt = myIFTTT(YOUR_API_KEY, YOUR_EVENT)
my_ifttt.send(["2020-04-12 19:00:00-2020-04-13 21:00:00", "22-37", "Very Hot"])

*** MyREST_IFTTT is a library I designed for a MCU to trigger IFTTT and send real-time messages to your client device in very easy and fast way. Just as the script above, a MCU will send out weather data which from any global weather site to IFTTT and to LINE Notify app. ***

*** If you want to how easy I can simply add 2~3 lines to my script, have my MCU to got weather information from a Global Weather website, then you might be interested in reading my other article “So Easy MicroPython — Global Weather Station” . ***

*** Before moving to next demonstration, please to have applied your IFTTT & LINE Developer accounts first. ***

Step 1: Upload libraries to your MCU

First, download and upload the libraries to your MCU !

  • MyREST: A basic library for using Restful API communication
  • MyREST_IFTTT: A specific function library for accessing data on ThingSpeak platform
  • MyWifi: A basic library for WiFi connection (No need, if your MCU can connect to WiFi already by your own script)

*** If you have no idea how to upload the libraries to your MCU board, please read my another article “So Easy — ESP8266/ESP32 File Management” first. ***

Step 2: Lets’ learn some examples

Before your code …

First of all, you MUST have an IFTTT account, and setup the trigger event, got the API key before the next demo section.

Follow the demonstration, you will be able to understand how to trigger IFTTT event and send out a LINE notify to your client device

*** You can click on the Webhook icon of IFTTT web page, and find your API key inside the “Documentation” link. ***

Example 0: Let MCU connect to your WiFi AP first

from MyWifi import myWifi
my = myWifi(YOUR_WIFI_SSID, YOUR_WIFI_PWD)
my.connect()

As an IoT device, to make your MCU connect to Internet is essentially true always. And how to do it, no matter to use your own codes or use MyWifi library. JUST need to connect it to Internet, since called an “IoT” device !!!

*** If you want to how easy I can simply add 2~3 lines to the script, have my MCU connect to WiFi, then you might be interested in reading my other article “So Easy MicroPython — WiFi Connection, MCU as IoT” . ***

Example 1:Trigger IFTTT and send message to LINE Notify app

from MyREST_IFTTT import myIFTTT
my_ifttt = myIFTTT(YOUR_API_KEY, YOUR_EVENT)
my_ifttt.send(["2020-04-12 19:00:00-2020-04-13 21:00:00", "22-37", "Very Hot"])

DEMO

This demo shows how easy to trigger an IFTTT event and send out a LINE Notify, just simply add 2~3 lines of my codes using MyREST_IFTTT library same as the codes of my examples above.

That’s all, so easy right ? Hope this helps !

Posted by Yungger

If it really help you, you are welcome to clap your hands clicking on top-left icon, or want to buy me a coffee to encourage me to write more, I thank you too 😘 😘 !!

Maker & Freelancer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store