data = thingSpeakRead(929272, "NumMinutes", 100); aveTemp = mean(data(:,7)); apiKey = '****'; alertURL = "https://api.thingspeak.com/alerts/send"; options = weboptions("HeaderFields",["ThingSpeak-Alerts-API-Key", apiKey]); alertBody = sprintf("The temperature is %0.2fF.", aveTemp); if avg_temperature > 60.0 webwrite(alertURL, "body", alertBody, "subject", alertSubject, options); end
avg_temperature
aveTemp
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)