Page 1 of 1

UV on night schedule

Posted: Wed May 29, 2013 5:40 am
by Smotz
I am trying to put my UV sterilizer on a schedule - can someone advise why this doesn't work and how to fix?

Code: Select all

#define Heater Port1
#define Topoff Port2
#define Reactor Port3
#define Skimmer Port4
#define Return Port5
#define Wave Port6
#define UVlight Port7
#define Fugelight Port8


//  Only turn on UV Sterilizer between 11pm and 5am
   if ( (hour() >= 5) || (hour() <= 23) )  // from 5a - 11p
    {
      ReefAngel.Relay.Off(UVlight);
    }

Re: UV on night schedule

Posted: Wed May 29, 2013 5:49 am
by lnevo
Where are you turning it on? Also your time comparison always succeeds because the hour will always be <= 23.

Try this instead

Code: Select all

//  Only turn on UV Sterilizer between 11pm and 5am
   if ( (hour() >= 5) && (hour() < 23) )  // from 5a - 11p
    {
      ReefAngel.Relay.Off(UVlight);
    } else {
      ReefAngel.Relay.On(UVlight);
    }

Re: UV on night schedule

Posted: Wed May 29, 2013 5:56 am
by Smotz
Thank you so much - will try!