Joined the beta today I have been looking forward to IFTTT support for a long time.
Before IFTTT was available I was using a combination of spark.variable and a Google Apps script to poll the spark API to acquire the new data and add this to a spreadsheet. This worked well for the most part, there was the odd issue when the API request to check the spark variable would time out, it was also impossible to put the spark in to deep sleep mode whilst still having the variable available, this would cause issues with battery powered projects.
Here is the link to the Google Apps script if you haven’t already seen it :https://community.spark.io/t/example-logging-and-graphing-data-from-your-spark-core-using-google/2929
Now I have IFTTT support I have been able to use the spark core to take temperature and humidity readings and push them in to a spreadsheet for later use using IFTTT. Once the publish is completed the core goes straight in to deep sleep for 15 minutes.
My next plan is to have IFTTT push the current temperature and humidity readings to Numerous App using IFTTT once Numerous is released for Android. Numerous app looks pretty cool, but I do not have access to an iDevice. http://numerousapp.com
The code for this is very simple, there is no processing, the data is simply collected, formattedand thrown at the cloud using Spark.publish.
// This #include statement was automatically added by the Spark IDE.
#include "idDHT22/idDHT22.h"
// declaration for DHT11 handler
int idDHT22pin = D4;
void dht22_wrapper(); // must be declared before the lib initialization
// DHT instantiate
idDHT22 DHT22(idDHT22pin, dht22_wrapper);
// mus be defined like this for the lib work
void dht22_wrapper() {
DHT22.isrCallback();
}
char publishData[] = "" ;
void setup(){
updateTempReadings();
Spark.publish("data",publishData);
delay(10000);
Spark.sleep(SLEEP_MODE_DEEP, 900); //sleep for 5min.
}
void updateTempReadings(){
DHT22.acquire();
//wait will acquiring.
while (DHT22.acquiring())
;
int result = DHT22.getStatus();
if (result == IDDHTLIB_OK){
sprintf(publishData,"%.2f ||| %.2f ",DHT22.getCelsius(),DHT22.getHumidity());
}
}
Screenshot of IFTTT recipe:
Based on the data collected this evening, it looks like the triggers have been pretty reliable. When pulling data from Spark.variable using a Google apps script I would have periods of missing data.
Screenshot of sheet + graph: