LED Lights off when not scheduled to be on.

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

LED Lights off when not scheduled to be on.

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

Re: LED Lights off when not scheduled to be on.

Post 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.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: LED Lights off when not scheduled to be on.

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

Re: LED Lights off when not scheduled to be on.

Post by lnevo »

Yeah these will not go off without power being shut off. If you want go with an external timer :)
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: LED Lights off when not scheduled to be on.

Post 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.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: LED Lights off when not scheduled to be on.

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

Re: LED Lights off when not scheduled to be on.

Post by lnevo »

Dilemmas dilemmas...i hear you. Just give in and get the extra relay bar :)
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: LED Lights off when not scheduled to be on.

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