Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By DaniloFix
#39691 Hi

I have a ESP8266 connected to my network and serving a webpage. That part is working just fine.
I want to add a function: void sendMessage() that will post to ifttt.com but I can't get it working right.

I tried this:

Code: Select all    WiFiClient Client;

    // IFTTT message setting
    String ifttt_url = "/trigger/temperatur_for_lav/with/key/d7i**********lThq2DB2i";
    String ifttt_host = "maker.ifttt.com";
   
    sensors.requestTemperatures(); // Send the command to get temperatures
   
    sensor1_temp = sensors.getTempCByIndex(0);
 
    if ( sensor1_temp > 28 ) {
      Client.print(String("POST ") + ifttt_url + "&headers=false" + " HTTP/1.1\r\n" + "Host: " + ifttt_host + "\r\n" + "Connection: close\r\n\r\n");
    }


But it doesn't work... the IFTTT recipe is not being triggered.
Any help is appreciated.

Thanks
Last edited by DaniloFix on Mon Jan 25, 2016 5:37 pm, edited 1 time in total.