Email notification after 3 days drying plant
Martin
on 10 Sep 2022
Latest activity Reply by Christopher Stapels
on 19 Sep 2022
Help us please, we need to send email after measurement from sonde (GSM report) is under limit for three days.
"React" on the limit, is non for three days under limit., and time control is days or weeks runner.
I propose trigger on time control but what is the code?
????
% Read the recent data.
moistureData = thingSpeakRead(channelID,'NumDays',3,'Fields',1); {is that right, that I read last three days measurement (3000x)?}
% Check to make sure the data was read correctly from the channel.
if isempty(moistureData)
alertBody = ' No data read from plant. ';
else
%{need if
% moistureData is for three days under limit from sonde then send
% email}
span = max(moistureData) - min(moistureData);
dryValue = span;
% Get the most recent point in the array of moisture data.
lastValue = moistureData(end);
% Set the outgoing message
if (lastValue<=dryValue)
alertBody = ' I need water! ';
elseif (lastValue>dryValue)
alertBody = ' No water needed. ';
end
really thanks so much
5 Comments
Time Descendingthanx for reply,
what i need is code for this> if for three days is received data {gprs upload} under "limit" {integer, change constant}, then send email.
How may I do this please?
Im sorry, im not quite clear on your question. Can you try to simplify what you need? Perhaps describe what will happen if you get the correct code set up.
Sign in to participate