Page 1 of 1
LED Lights off when not scheduled to be on.
Posted: Mon Aug 10, 2015 1:07 pm
by Sacohen
I'm using this code for my LED lunar lights so the lights are off between 1pm and 9pm
if ( hour()>=13 && hour()<21 )
ReefAngel.PWM.SetChannel( 5, 0 );
else
ReefAngel.PWM.SetChannel( 5, PWMSlope(21,0,13,0,0,MoonPhase() ,60,0) );
I just want to confirm that this won't work on the Chinese LED's (like the Evergrow/Reefbreeders LED's) that don''t go all the way to 0.
If I'm correct in my question is there anyway to do it short of turning off the port when it's nit in use?
Re: LED Lights off when not scheduled to be on.
Posted: Mon Aug 10, 2015 7:55 pm
by lnevo
I would do something like
ReefAngel.PWM.SetChannel( 5, PWMSlope(21,0,13,0,0,MoonPhase() ,60,0) );
if (ReefAngel.PWM.GetChannelValue(5) > 5) ReefAngel.Relay.On(Port6) else ReefAngel.Relay.Off(Port6);
Change the > 5 to whatever cut off % you want to use and then change Port 6 to whatever ports you want to turn on/off. The nice thing about doing it this way versus a schedule is that if you override the dimming through the app, it should still turn the lights on / off.
Re: LED Lights off when not scheduled to be on.
Posted: Tue Aug 11, 2015 5:58 am
by Sacohen
Thanks Lee.
So with this I would still need to have the light plugged into one of the ports on the relay, correct?
I was kind of hoping to free them up for some other uses.
Like the moonlights are just plugged into a regular outlet that is not controlled and the code just keeps them off when not needed.
I really don't use the Lights on/off on the app that much anyway.
Listen if it can't be done because limitation in the lighting I understand that, but it doesn't hurt to ask.
Re: LED Lights off when not scheduled to be on.
Posted: Tue Aug 11, 2015 12:44 pm
by lnevo
Yeah these will not go off without power being shut off. If you want go with an external timer

Re: LED Lights off when not scheduled to be on.
Posted: Tue Aug 11, 2015 12:45 pm
by lnevo
And I wasn't referring to Lights On/Off...that mechanism never really was useful. I mean if you go into the dimming section and want to turn a light on you just change the dimming from 0 to 65 lets say. That code will see the dimming over 5% and turn the lights on accordingly.
Re: LED Lights off when not scheduled to be on.
Posted: Tue Aug 11, 2015 12:53 pm
by Sacohen
Oh. I get it now.
Gotta think about what I want to do.
I don't really want to tie up 4 relay ports to just turn off the power to the lights or buy another relay and relay expansion.
The external timers is not the way I want to go.
Thanks for the suggestions and the code.
Re: LED Lights off when not scheduled to be on.
Posted: Tue Aug 11, 2015 8:28 pm
by lnevo
Dilemmas dilemmas...i hear you. Just give in and get the extra relay bar

Re: LED Lights off when not scheduled to be on.
Posted: Wed Aug 12, 2015 10:08 am
by Sacohen
I think I make have enough ports to do it when I move over to the 90 gallon.
I have the main relay and then the RANet wireless relay in the garage.So my ATO and Kalkwasser pumps will be moving to the garage and open up some spaces on the main relay.