Specify a valid read API key, or make the channel public to avoid specifying the read API key.
data = thingSpeakRead(941028, "NumMinutes", 100); aveTemp = mean(data(:,7)); apiKey = 'PFZRTJ2JYTXW519I'; 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
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)