Waterlevel Expansion code.

Do you have a question on how to do something.
Ask in here.
Post Reply
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Waterlevel Expansion code.

Post by Sacohen »

2 questions.

1st if I don't want a time out on the ATO would I code it like this?

Code: Select all

ReefAngel.WaterLevelATO(ATO_Pump,0,1,100); 
I know that it is a safety to have the time out, but I'm going to use it to refill my RO/DI container and that can take several hours to refill.

Also is it possible to have it trigger another port (IE Port8 a light will be plugged in to that port to get my attention) or send me an e-mail when it reaches say 100% as a reminder for me to do something with the water.

Let say I'm filling up my saltwater bin with RO to make new saltwater. I want to know that it is full and I need to add the salt now and start it mixing.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Waterlevel Expansion code.

Post by rimai »

I've never tried using 0 to disable. I don't think it will work.
Use this instead:

Code: Select all

if (ReefAngel.WaterLevel.GetLevel()<=1) ReefAngel.Relay.On(ATO_Pump);
if (ReefAngel.WaterLevel.GetLevel()>=100) ReefAngel.Relay.Off(ATO_Pump);
Then, simply set a trigger in the portal to alert you when WL is greater than 95 or something.
Roberto.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Waterlevel Expansion code.

Post by Sacohen »

Thanks, I'll try it when I get to that point in everything.
I forgot about the triggers in the portal or the Andriod app.
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Waterlevel Expansion code.

Post by binder »

Sacohen wrote:Thanks, I'll try it when I get to that point in everything.
I forgot about the triggers in the portal or the Andriod app.
yeah, use those triggers / notifications. that's what they are there for :-)

Sent from my Nexus 7
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Waterlevel Expansion code.

Post by Sacohen »

I do use them, but I get a lot of errors unable to connect, so I tend not to pay attention to them all the time.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Waterlevel Expansion code.

Post by lnevo »

Use the portal notifications... they don't send you errors like that :)

As far as the timeout, the code you posted doesn't disable the timeout. We used that as a way to disable the ATO when we wanted to so an ATO Timeout wouldn't get triggered.

Roberto, as far as portal notifications, I was wondering if we could add Bitwise operator checks. That would allow us to alert on Flags, Relay status, etc. with the proper bits. Wouldn't be so intuitive, but maybe a checkbox for advanced setting? :)
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Waterlevel Expansion code.

Post by Sacohen »

So is the best way to disable or avoid a ATO timeout the way Roberto suggested?

Code: Select all

if (ReefAngel.WaterLevel.GetLevel()<=1) ReefAngel.Relay.On(ATO_Pump);
if (ReefAngel.WaterLevel.GetLevel()>=100) ReefAngel.Relay.Off(ATO_Pump);
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Waterlevel Expansion code.

Post by lnevo »

Honestly, I don't really like that code block... I'm not sure though what you're trying to do...
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Waterlevel Expansion code.

Post by lnevo »

Re-reading your earlier post... here's my RefillATO function trimmed down a bit...

Code: Select all

// ATO Refill mode. Top off ATO reservoir until it's at 100%    
void RefillATO() {
  static boolean refillActive=false;
  static WiFiAlert refillAlert;
  byte level;

  if (ReefAngel.Relay.Status(VO_RefillATO)) {
    if (level<100) {
      ReefAngel.Relay.On(Extension);
      refillActive=true;
    } else {
      ReefAngel.Relay.Override(VO_RefillATO,2);
      refillAlert.Send("ATO+Reservoir+is+full.");
    }
  } else {
      ReefAngel.Relay.Off(Extension);
      refillActive=false;
  }
}
VO_RefillATO is an unused port I use to trigger the process.
Extension is the port I plug my refill pump into.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Waterlevel Expansion code.

Post by Sacohen »

OK. I think I got it.
I'm not really going to get into this portion of things for a bit, I need to move my tank and setup the water change and then this process.

I'm looking at setting up an auto fill of my RODI bin (like here http://richmondreefers.com/phpbb/viewto ... 21&t=12343) and filling a 20 gallon RO trash can will take several hours so I don't want it to time out before it is full.
Post Reply