Hello,
I’m trying to send a notification email by IFTTT with verification that the notification is actually sent back by the IFTTT website.
I’ve found that recently the IFTTT channel is more stable, however I am unable to verify that an email notification is actually sent by IFTTT once a Spark.publish request is received. I would say it works 95% of the time. For instance this will reliably detect if there is an internet connection and if an IFTTT email notification is sent by the spark core.
It however cannot detect that IFTTT actually receives the request and sends out a notification email.
Is there a way to detect that a spark.publish request is received in order to resend it if it’s not received?
Regards to all, Stuart
int inputPin = D1; //push-button pin
int val = 0; //variable for push-button status
int state = 1; //variable for on/off state
int led = D7; // integrated LED
int status = D0; // Connection status LED or pin
void setup() {
pinMode(inputPin, INPUT); // input low to drive notification
pinMode(led, OUTPUT); // Pulse LED to signal notification
pinMode(status, OUTPUT); // High to signal active connection
Serial.begin(9600);
}
void loop() {
val = digitalRead(inputPin); //read the state of the push-button
connection(); //Polls the status of the connection
if (val == LOW) { //if push-button pressed
state = !state; //reverse on/off state
delay(250); //primitive button debounce
Serial.println("button pushed!");
digitalWrite(led, HIGH); // Turn ON the LED pins
notification();
}
}
void connection() // output status of internet connection on D0 high =connected, low= not connected
{
if (Spark.connected())
{
digitalWrite(status, HIGH);
}
else
{
digitalWrite(status, LOW);
}
}
void notification()
{
delay(1000);
Spark.publish("button1",NULL, 60, PRIVATE);
//
Serial.println("Complete");
//
digitalWrite(led, LOW); // Blink LED
delay(250);
digitalWrite(led, HIGH);
delay(250);
digitalWrite(led, LOW);
}