IFTTT Maker Channel: Tweet temperature and humidity

I´ll post an example about controlling a led from an Android Smartwatch, but is almost the same for de Android Location channel :wink:

Nice! thats the next thing ill do then (with a pebble time).

Hi @psukez, I have posted a video example controlling a led from the IFTTT Do button in the smartwatch. Probably today I have some time to publish the how-to. But you can use any IFTTT trigger to enable a led, a relay, a servo, or any other function of your microcontroller =)

@alvarolb really cool! I`ll be waiting for the how-to

Hi @psukez ! Just posted a example in this how-to:

Make your IoT things react to hundred of IFTTT Events

Let me know if you make something cool! And share it with the community =)

Hi All, I configured everything according to tutorial except I m using arduino ethernet shield instead of esp8266. querries run. I can read data from arduino but. maker channel event can be triggered. Secret key is correct. what can be the problem.

thanks…

one more question,
I want to control particuler arduino pin with posting a twit. foor example I will post “home turn on light” then arduino’s pin state become HIGH, if I post “home turn off lights” pin state is LOW.

is that possible. if so can you share tutorial that…

thanks…

Hi! It should work also with the Arduino Ethernet. Just make sure the maker event name and secret key are configured fine in the endpoint. Also check the endpoint name you are calling in you sketch (that should be the identifier used in the thinger platform, not in the IFTTT). It may be also useful to check the IFTTT channel to see if there is any debug information about your calls.

This is possible by using the following twitter trigger:

And using the IFTTT Maker channel as trigger, similar to described in this post:

With the twitter trigger I have mentioned, you can react to mentions you get, and get the text of the tweet. So, suppose you have a twitter account for your home that is @home. You could write “@home, turn lights on”. So every time you got a mention, your device resource is called with the text, and the user that have mentioned you. From this point, it is quite easy to check the user mentioned you (to be sure the user have the right credential to execute the action), and evaluate the text to detect what is the request.

I have tested this integration with IFTTT, configuring the maker event as the following:

And defining a resource in the device like this:

thing["mention"] << [](pson& in){
    const char* user = in["user"]; 
    const char* text = in["text"];
    Serial.println(user);
    Serial.println(text);
};

Which results in an output similar to the following result every time you got a mention:

alvarolb84
@thinger_io reacting to a twitter mention!

However, It seems that twitter does not allow you to write tweets with the same status, so if you turn on and off quite frequently from twitter, you must add a trailing number, or a different hashtag to pass the twitter filter.

thats valuable information. I believe I can manage device side according to my desires :slightly_smiling:

Hi @alvarolb,
I just got my first NodeMCU 0.9v (I think) and I’m a n00b about how it functions and how it works.
I’ve got it working with tinger.io, connected via wifi and such.
But, I’d like to make a simple/smart doorbell.
That would work like this:

  1. someone rangs
  2. NodeMCU sends notification via Pushbullet or IFTTT or Pushover or any other service
  3. Getting notified on my Android device

And later on when I get that working, I would add this features:
4. Ringing sound through my Raspberry Pi 1 or 0
5. Capturing the screen from my camera
6. Sending that screenshot to my Android device via IFTTT…

This worked well with Raspberry Pi 1, without problem, tho I’d like to do the first part with NodeMCU if that’s possible.

So, where I’m stuck is:

  1. how to write a code that NodeMCU sends notification to IFTTT when the button is pressed

Thanks! :slight_smile:

dear sir i have a doubt what shoud be the device credential in the code can any one please help me what device credential mean
i am using a maker channel i want to trigger events from node mcu
shahsoumil519@gmail.com
please reply as soon as possible

Hi @Soumil_Shah. The device credential is like the password you set when you create a device in the console.

Everything done same as said but , there is no tweeting of temperature? Is the IFTTT Maker key is Applet ID? plz help me

@alvarolb Everything done same as said but , there is no tweeting of temperature?. In the dashboard it is showing but in the twitter it is not tweeting ???

Hi @Ravi,

I have checked the integration and it is working fine.

Please, share your code (except credentials), and please share also your maker channel configuration. Please, review the endpoint names you are using, review the maker channel credentials, and verify that you did not include trailing spaces or something similar…

The code is same as the one for DHT11 sensor as you have posted.
IFTTT Configuration is shown in picture.

Is the IFTTT maker key is the Applet ID ?
Because I am getting only problem with integration. In thinger platform, output is showing. Plz reply asap plz

Ok @alvarolb I got the integration with twitter. Thanks for your help…The problem was in the endpoint configuration… Solved

For the temperature sensor the tweet interval is changing only when I change the interval in the code. The tweeting interval is not changing when I change the tweet interval in thinger.io API.
for example I put 2min interval in the code but I put 1min interval in the thinger platform.
So whats happening is LED is blinking every one 1min but tweeting is happening every 2min as in the code

Dear, I’ve been trying to use the code adaptation below for the nodemcu to send tweets to me without success. The IFTTT Webhooks are working and I believe that the settings of the thinger.io are correct. Any suggestions for the code to work?

#include <ESP8266WiFi.h>
#include <ThingerWifi.h>
#include <SPI.h>
#include <DallasTemperature.h>
#include <OneWire.h>

 

#define ONE_WIRE_BUS 12 // Data wire is plugged into port 2 on the Arduino
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);// Pass our oneWire reference to Dallas Temperature.

#define USERNAME "orengo"
#define DEVICE_ID "nodemcu01"
#define DEVICE_CREDENTIAL "caritasCHICO6098"

#define SSID "tupinamba"
#define SSID_PASSWORD "caritasCHICO6098"

ThingerWifi thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);

unsigned long previousMillis = 0;      // to know when to post the temperature
unsigned int minutes_interval = 60;              // variable in minutes for posting the temperature


void call_temperature_endpoint(){
 digitalWrite(BUILTIN_LED, LOW);
 pson tweet_content;
 tweet_content["value1"] = sensors.getTempCByIndex(0);
 tweet_content["value2"] = ((analogRead(A0)*0.00489)*3.3);
 thing.call_endpoint("temperature_tweet", tweet_content);
 digitalWrite(BUILTIN_LED, HIGH);
}

void setup() {

pinMode(BUILTIN_LED, OUTPUT);

thing.add_wifi(SSID, SSID_PASSWORD);

thing["temp"] >> [](pson & out) {
sensors.requestTemperatures(); // Send the command to get temperatures
out["TEMPERATURA"] = sensors.getTempCByIndex(0);
};

   
thing["PanelDC"] >> [](pson & out){
// Saída para tensão de 5V analógica out["VALORDC"] = ((analogRead(A0)*0.00489)*5);
out["VALORDC"] = ((analogRead(A0)*0.00489)*3.3);
};

// resource that will allow changing the tweet interval
thing["tweet_interval"] << [](pson& in){
if(in.is_empty()) in = minutes_interval;
else minutes_interval = (unsigned int) in;
 };

// this resource will allow sending the tweet as requested
thing["tracker_tweet"] = [](){
call_temperature_endpoint();
};


sensors.begin();
}

void loop() {
   thing.handle();
   unsigned long currentMillis = millis();
    if(minutes_interval>0 && currentMillis - previousMillis >= minutes_interval * 60000) {
        previousMillis = currentMillis;   
    call_temperature_endpoint();
    }
}