Iād add that another easy thing to do from Google Apps Scripts is to send emails.
This could be used in the cases like when the temp rises above a certain level, or rises too fast too quickly, or drops below a certain point; alerts when itās unexpectedly freezing so you can check pipes, or emails to discover that your HVAC system may not be on (or not working at all).
For example, after the sheet.appendRow()
line in the collectData() script above, add
var triggerTemp = 90; // test is Fahrenheit, adjust for Celsius
if (p.data1 > triggerTemp) {
MailApp.sendEmail('youremail@address.com', '[ SPARK ALERT ] It's getting hot in here!', 'The current temp is : ' + p.data1);
}
You might want to add in logic to see if youāve already sent the email so you only send it once, or to check if it falls back below your trigger temp. (Google does have a method call you can use to see how many more emails you can send that day, if youāre sending a lot).
You might have to run the script once in the script editor to authorize the script to send emails, but that depends on various other settings, IIRC.
Thereās no end to the things you can do here, including interfacing with other services easily, like Twitter.
Once Spark has the ability to call https URLs, you can also turn these scripts into āweb appsā in Google Apps, which provide a URL that you can simply make a GET request to and do all manner of things. For instance, instead of Google polling to see if the temp is over a limit, the Spark could simply call a URL when it senses itās too hot and send the alert email, not waiting for your polling interval.