Gary Leeds UK Posted January 7, 2013 Share Posted January 7, 2013 I have my lights set as follows - 6.15am turn on - Sunrise Turn off Sunset Turn on - 10pm Turn off My question is when sunrise is before 6.15am will this stop my lights being turn on ? and if sunset is after 10pm will this stop my lights being turn on ? Many Thanks in Advance ? Link to comment Share on other sites More sharing options...
msgreenf Posted January 7, 2013 Share Posted January 7, 2013 no it won't. There is a day/night variable that may want to use to help make this code more fool proof. Link to comment Share on other sites More sharing options...
Gary Leeds UK Posted January 7, 2013 Author Share Posted January 7, 2013 msgreenf, How do I do that ? Link to comment Share on other sites More sharing options...
TexasBill Posted January 7, 2013 Share Posted January 7, 2013 I have my lights set as follows - 6.15am turn on - Sunrise Turn off Sunset Turn on - 10pm Turn off My question is when sunrise is before 6.15am will this stop my lights being turn on ? and if sunset is after 10pm will this stop my lights being turn on ? Many Thanks in Advance ?What are you actually trying to accomplish?In your first item - it will ALWAYS turn on your light at 6:15 AM. Your sunrise turn off will do the following - if you get up early one day at 4 AM it will turn off your light when it gets to sunrise that is before 6:15 and then at 6:15 it will turn on again and stay on all day - this will continue to happen until sunrise occurs again after 6:15 AM.I think that you are saying that you get up at 6:15 AM every morning and if it is dark you want light? Is that right?What MSGREENF stated was that you want to use the day night variable as well - I would probably write the code like this:If NIGHT If Time = 6:15 turn on lightIf Day turn off light.This way if sunrise comes BEFORE 6:15 the light will never turn on in this case, and when daylight comes if the light is on it will turn off. Link to comment Share on other sites More sharing options...
RyanE Posted January 7, 2013 Share Posted January 7, 2013 I think what msgreenf is suggesting is that you put in conditionals in your events:(at 6:15 scheduler event)if not daytime Turn lights on(at sunset scheduler event)if not nighttime Turn lights offRyanE Link to comment Share on other sites More sharing options...
msgreenf Posted January 8, 2013 Share Posted January 8, 2013 I was suggesting what Ryan laid out. Thanks Ryan! Link to comment Share on other sites More sharing options...
Gary Leeds UK Posted January 8, 2013 Author Share Posted January 8, 2013 Cheers Guys will give it a go Link to comment Share on other sites More sharing options...
Gary Leeds UK Posted January 8, 2013 Author Share Posted January 8, 2013 Gone into the conditions and was only allow to use If day or if night. So I have used on both 6.15 am (turn on light) if night And on the sunset (turn on light ) if nightMy logic is that if the lights have not turn on, I do not have to place a condition onThe turn off. I'm thinking in the control4 way?Gary Link to comment Share on other sites More sharing options...
TexasBill Posted January 8, 2013 Share Posted January 8, 2013 Gone into the conditions and was only allow to use If day or if night. So I have used on both 6.15 am (turn on light) if night And on the sunset (turn on light ) if nightMy logic is that if the lights have not turn on, I do not have to place a condition onThe turn off. I'm thinking in the control4 way?GaryMake sure that you have them indented appropriately:If night if 6:15 AM TURN ON LIGHTIf DAY TURN OFF LIGHTI would ALWAYS turn off the light when it is day time - there is no harm in turning off a light that is not on - but if you are anal retentive about these things - then:if DAY If light is on Turn light offBill Link to comment Share on other sites More sharing options...
Gary Leeds UK Posted January 9, 2013 Author Share Posted January 9, 2013 Cheers Bill, Will insert that line - The lights all worked today:DSo lets hope we keep going on the right tracks Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.