Email notifications on ports

Related to the development libraries, released by Curt Binder
Post Reply
Ferdi
Posts: 31
Joined: Thu Jan 02, 2014 1:02 pm

Email notifications on ports

Post 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
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Email notifications on ports

Post 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. :)
Ferdi
Posts: 31
Joined: Thu Jan 02, 2014 1:02 pm

Re: Email notifications on ports

Post 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?
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Email notifications on ports

Post by lnevo »

Sorry, no I did not. Should have some time tomorrow.
Ferdi
Posts: 31
Joined: Thu Jan 02, 2014 1:02 pm

Re: Email notifications on ports

Post by Ferdi »

lnevo wrote:Sorry, no I did not. Should have some time tomorrow.
No problem. Thanks for taking the time to help
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Email notifications on ports

Post 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.");
    }
  }
}
Ferdi
Posts: 31
Joined: Thu Jan 02, 2014 1:02 pm

Re: Email notifications on ports

Post by Ferdi »

Thank you kindly lnevo. Can't wait to test it out.
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Email notifications on ports

Post by lnevo »

Oh those spaces in the send message should be + instead as http wont like the space (maybe..)
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Email notifications on ports

Post 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
Post Reply