UV on night schedule

Do you have a question on how to do something.
Ask in here.
Post Reply
Smotz
Posts: 401
Joined: Sat Mar 30, 2013 5:02 pm
Location: CT, USA

UV on night schedule

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

Re: UV on night schedule

Post 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);
    }
Smotz
Posts: 401
Joined: Sat Mar 30, 2013 5:02 pm
Location: CT, USA

Re: UV on night schedule

Post by Smotz »

Thank you so much - will try!
Post Reply