Skip to content

Commit

Permalink
Update EmailNotifier.m
Browse files Browse the repository at this point in the history
  • Loading branch information
happybono committed Oct 1, 2021
1 parent be6b861 commit 651e823
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Plugins/Email/EmailNotifier.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
data = thingSpeakRead([Your ThingSpeak Channel ID], "NumMinutes", 60);

dust25 = mean(data(:, 1));
dust10 = mean(data(:, 2));

Expand All @@ -18,9 +19,21 @@


if dust25 >= 35.0 || dust10 >= 69.0
try
webwrite(alertURL, "body", alertBodyLv5, "subject", alertSubjectLv5, options);
catch someException
fprintf("Failed to send alert: %s\n", someException.message);
end
elseif dust25 >= 44.0 || dust10 >= 85.0
try
webwrite(alertURL, "body", alertBodyLv6, "subject", alertSubjectLv6, options);
catch someException
fprintf("Failed to send alert: %s\n", someException.message);
end
elseif dust25 >= 52.0 || dust10 >= 102.0
try
webwrite(alertURL, "body", alertBodyLv7, "subject", alertSubjectLv7, options);
catch someException
fprintf("Failed to send alert: %s\n", someException.message);
end
end

0 comments on commit 651e823

Please sign in to comment.