I can't find the WifiSendAlert() function in the libraries.

Requests for new functions or software apps

Posts: 133
Joined: Sun Dec 09, 2012 7:23 pm
PostPosted: Sun May 12, 2013 5:15 pm
Could someone please tell me where the WifiSendAlert() function is located in the libraries? I would like to see if I can figure out how to add a few more custom alert messages beyond the few that currently exist which are:

WifiSendAlert(0)="Nothing"
WifiSendAlert(1)="Auto top-off timeout"
WifiSendAlert(2)="Water temperature too high"
WifiSendAlert(3)="Water temperature too low"
WifiSendAlert(4)="Lights temperature too high"
WifiSendAlert(5)="PH too high"
WifiSendAlert(6)="PH too low Alert"

Examples of a few messages that I want to add are:
WifiSendAlert(7)="ATO reservior is empty"
WifiSendAlert(8)="Sump water level is too low"
WifiSendAlert(9)="Sump water level is too high"

I would also like to see if it could send the SMS alerts faster (ex. within 1 minute).

Thanks,
John
User avatar
Posts: 2739
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
PostPosted: Sun May 12, 2013 5:22 pm
it's not in the libraries.
here's a post made by you with the code you need:
viewtopic.php?f=12&t=2373&p=18083&hilit=wifisendalert#p18083
User avatar
Posts: 5349
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Sun May 12, 2013 5:24 pm
I dont think that function is in the libraries...i think it was a custom one...if i'm wrong though you can find it in the Doxygen docs.

http://www.easte.net/RA/html/
User avatar
Posts: 5349
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Sun May 12, 2013 5:57 pm
binder wrote:it's not in the libraries.
here's a post made by you with the code you need:
viewtopic.php?f=12&t=2373&p=18083&hilit=wifisendalert#p18083


Ahh yeah, looks like its happening in the portal...

Posts: 133
Joined: Sun Dec 09, 2012 7:23 pm
PostPosted: Sun May 12, 2013 8:51 pm
This is the code that I am using but I don't see where the alert messages are being defined.
Code: Select all
// Setup SMS alerts
 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=3141234567@vtext.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));
    }
  }
}


I don't see where these ids are defined in the code.
WifiSendAlert(0)="Nothing"
WifiSendAlert(1)="Auto top-off timeout"
WifiSendAlert(2)="Water temperature too high"
WifiSendAlert(3)="Water temperature too low"
WifiSendAlert(4)="Lights temperature too high"
WifiSendAlert(5)="PH too high"
WifiSendAlert(6)="PH too low Alert"

Can someone explain how it works?

Thanks,
John
User avatar
Posts: 5349
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Sun May 12, 2013 9:16 pm
This code is sending the alert to the portal...it's not happening in the library code.

mudcat1 wrote:
Code: Select all
      alert_status|=1<<(id-1);
      Serial.print("GET /status/alert.asp?e=3141234567@vtext.com&id=");
      Serial.println(alert_status,DEC);



Roberto, maybe we can extend this to take some custom strings instead of just id=

That could solve having to use custom variables for alert flags and solve mudcat's issue, also enable faster alerting to make it RA triggered instead of possible 5 minute delay waiting for portal timer to trigger.

Posts: 133
Joined: Sun Dec 09, 2012 7:23 pm
PostPosted: Sun May 12, 2013 9:21 pm
Yes, a 5 minute delay, if my sump is overflowing would be tragic.
User avatar
Posts: 5349
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Sun May 12, 2013 9:22 pm
If my sump starts overflowing, I have a float switch activate and turn off return pump... Something to consider :) no need to wait for disaster to strike.

Posts: 12242
Joined: Fri Mar 18, 2011 6:47 pm
PostPosted: Sun May 12, 2013 9:29 pm
How can we restrict this to avoid anyone from maliciously use it to spam email with custom string?
Roberto.
User avatar
Posts: 5349
Joined: Fri Jul 20, 2012 9:42 am
PostPosted: Mon May 13, 2013 3:07 am
Portal key?
Next

Return to Requests

Who is online

Users browsing this forum: No registered users and 2 guests