Page 1 of 1

Email notifications on ports

Posted: Sun Jan 10, 2016 5:18 am
by Ferdi
Hi everyone,

Can someone please help with coding for the following.

Email notification when heater port comes on and when it switches off, when auto topup port comes on( no need for when it switches off as its timeout is 10sec, maybe a mail notification if it exceeds 10 sec) and lastly when my chiller port comes on and when it switches off.

Thank you in advance

Email notifications on ports

Posted: Sun Jan 10, 2016 6:14 am
by lnevo
The code will be very similar for the heater and the chiller. I'll try and work on something later tonight, but more than likely next weekend.

For the ATO timeout you can set that one up in the portal. :)

Re: Email notifications on ports

Posted: Wed Feb 03, 2016 1:51 pm
by Ferdi
lnevo wrote:The code will be very similar for the heater and the chiller. I'll try and work on something later tonight, but more than likely next weekend.

For the ATO timeout you can set that one up in the portal. :)
Hi lnevo,

Any luck yet on the coding?

Re: Email notifications on ports

Posted: Wed Feb 03, 2016 3:31 pm
by lnevo
Sorry, no I did not. Should have some time tomorrow.

Re: Email notifications on ports

Posted: Fri Feb 05, 2016 12:56 pm
by Ferdi
lnevo wrote:Sorry, no I did not. Should have some time tomorrow.
No problem. Thanks for taking the time to help

Re: Email notifications on ports

Posted: Sun Feb 07, 2016 11:53 am
by lnevo
Here you go. Please make sure to change the ports for your heater and chiller. This will alert when the heater goes on but not when it goes off. It will alert when the chiller goes on and when it goes off. Please keep in mind there is a 15 minute delay between each alert and if they both go at the same time (like if the controller reboots) you may only get one alert.

To use it, paste the function at the end of your INO and then call it from your loop AFTER your heater and chiller call.

Code: Select all

void HeaterAndChillerAlerts() {
  static boolean heaterStatus;
  static boolean chillerStatus;

  static WiFiAlert heaterAlert;
  static WiFiAlert chillerAlert;
  
  byte heaterPort=Port1;
  byte chillerPort=Port2;

  if (ReefAngel.Relay.Status(heaterStatus)) {
    if (!heaterStatus) {
      heaterStatus=true;
      heaterAlert.Send("Heater is on.");
    }
  } else {
    heaterStatus=false;
  }
  
  if (ReefAngel.Relay.Status(chillerStatus)) {
    if (!chillerStatus) {
      chillerStatus=true;
      chillerAlert.Send("Chiller is on.");
    }
  } else {
    if (chillerStatus) {
      chillerStatus=false;
      chillerAlert.Send("Chiller is off.");
    }
  }
}

Re: Email notifications on ports

Posted: Mon Feb 08, 2016 2:54 pm
by Ferdi
Thank you kindly lnevo. Can't wait to test it out.

Email notifications on ports

Posted: Mon Feb 08, 2016 8:28 pm
by lnevo
Oh those spaces in the send message should be + instead as http wont like the space (maybe..)

Re: Email notifications on ports

Posted: Tue Feb 09, 2016 2:57 pm
by binder
lnevo wrote:Oh those spaces in the send message should be + instead as http wont like the space (maybe..)
you are correct unless something has changed.

Sent from my XT1585 using Tapatalk