Page 1 of 1

Email notifications

Posted: Mon Sep 03, 2012 8:37 pm
by jsclownfish
Hi all,

If I understand it correctly, when the portal sends an email alert it can only occur in 5 minute intervals and once per hour. I ask because there are times when it would be good to know quicker. For instance if my power cuts out. Usually everything comes back on OK, but sometimes there are problems. I also don't know if my battery back-up will run that long. Another example might be if there was a water leak. I might be able to get to it quicker or call home before things get out of hand.

Thanks,
Jon

Re: Email notifications

Posted: Mon Sep 03, 2012 8:52 pm
by rimai
Try this:

Code: Select all

void WifiSendAlert(byte id, boolean IsAlert)
{
  static byte alert_status;

  if (IsAlert)
  {
    if ((alert_status & 1<<(id-1))==0)
    {
      alert_status|=1<<(id-1);
      Serial.print("GET /status/alert.asp?e=xxxxx@messaging.sprintpcs.com&id=");
      Serial.println(alert_status,DEC);
      Serial.println("\n\n");
    }
  }
  else
  {
    if (id==0)
    {
      alert_status=0;
      delay(900);
    }
    else
    {
      alert_status&=~(1<<(id-1)); 
    }
  }
}
Then use something like this in your loop:

Code: Select all

  if (ReefAngel.Params.Temp[1]<750 && ReefAngel.Params.Temp[1]>0) WifiSendAlert(3,true); 
  if (ReefAngel.Params.Temp[1]>760 && ReefAngel.Params.Temp[1]<1850) WifiSendAlert(3,false);
This thread is a little old, but you should be able to get the idea:
https://groups.google.com/forum/?fromgr ... -nQcPIF4hA